Skip to content

Commit

Permalink
features: export parallel-instances feature flag
Browse files Browse the repository at this point in the history
The 'parallel-instances' feature flag can be used by snap-confine for enabling
low-level tweaks. Make sure it is exported

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
  • Loading branch information
bboozzoo committed Aug 23, 2019
1 parent ac8d580 commit cada148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var featuresEnabledWhenUnset = map[SnapdFeature]bool{
var featuresExported = map[SnapdFeature]bool{
PerUserMountNamespace: true,
RefreshAppAwareness: true,
ParallelInstances: true,
}

// String returns the name of a snapd feature.
Expand Down
4 changes: 3 additions & 1 deletion features/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ func (*featureSuite) TestKnownFeatures(c *C) {

func (*featureSuite) TestIsExported(c *C) {
c.Check(features.Layouts.IsExported(), Equals, false)
c.Check(features.ParallelInstances.IsExported(), Equals, false)
c.Check(features.Hotplug.IsExported(), Equals, false)
c.Check(features.SnapdSnap.IsExported(), Equals, false)

c.Check(features.ParallelInstances.IsExported(), Equals, true)
c.Check(features.PerUserMountNamespace.IsExported(), Equals, true)
c.Check(features.RefreshAppAwareness.IsExported(), Equals, true)
}
Expand Down Expand Up @@ -95,6 +96,7 @@ func (*featureSuite) TestIsEnabledWhenUnset(c *C) {
func (*featureSuite) TestControlFile(c *C) {
c.Check(features.PerUserMountNamespace.ControlFile(), Equals, "/var/lib/snapd/features/per-user-mount-namespace")
c.Check(features.RefreshAppAwareness.ControlFile(), Equals, "/var/lib/snapd/features/refresh-app-awareness")
c.Check(features.ParallelInstances.ControlFile(), Equals, "/var/lib/snapd/features/parallel-instances")
// Features that are not exported don't have a control file.
c.Check(features.Layouts.ControlFile, PanicMatches, `cannot compute the control file of feature "layouts" because that feature is not exported`)
}
Expand Down

0 comments on commit cada148

Please sign in to comment.