Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces: disconnect hooks #4767

Merged
merged 152 commits into from Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
c3363c0
Merge branch 'master' into interface-hooks
stolowski Jan 30, 2018
3b12672
Added Connections method to the repo.
stolowski Jan 30, 2018
88eabba
Create reconnect task.
stolowski Jan 30, 2018
079d777
Merge branch 'master' into interface-hooks
stolowski Feb 8, 2018
23a215e
Merge branch 'interface-hooks' into interface-hooks-refresh
stolowski Feb 8, 2018
c3031eb
Updated the spread test for refresh.
stolowski Feb 8, 2018
3fced34
Merge branch 'autoconnect-tasks' into interface-hooks-refresh
stolowski Feb 8, 2018
57aaa8b
Fix prepare- plug.
stolowski Feb 9, 2018
c725d92
Policy checks.
stolowski Feb 9, 2018
9e95a6c
Merge branch 'master' into interface-hooks-refresh
stolowski Feb 19, 2018
00e236c
Mark connect hook tasks 'Done' on autoconnect if plug/slot/snap is no…
stolowski Feb 20, 2018
161e86d
Tests for marking hooks done on autoconnect if plug/slot snap is miss…
stolowski Feb 20, 2018
93f7544
Store old connection data if reconnecting.
stolowski Feb 20, 2018
a984f42
Added a test for connect undo.
stolowski Feb 20, 2018
e11df74
Fix formatting.
stolowski Feb 20, 2018
d0b395b
Fix typo.
stolowski Feb 21, 2018
30e65c9
One more typo fix.
stolowski Feb 21, 2018
601abe2
Merge branch 'master' into interface-hooks
stolowski Feb 21, 2018
69aacd6
Fix err assignement.
stolowski Feb 21, 2018
8ff8c20
Define PolicyFunc type.
stolowski Feb 21, 2018
d25bdad
Clean up after hooks spread test to avoid errors in other tests.
stolowski Feb 21, 2018
795b04f
Fix comment in the dummy interface.
stolowski Feb 22, 2018
5f2d13a
Merge branch 'master' into interface-hooks
stolowski Feb 23, 2018
51a4add
Merge branch 'master' into interface-hooks
stolowski Feb 23, 2018
4741a9e
Disconnect hooks.
stolowski Feb 26, 2018
c5f417e
Merge branch 'master' into disconnect-hooks
stolowski Feb 26, 2018
cb382f6
Spread test for disconnect.
stolowski Feb 27, 2018
466adae
Added missing files.
stolowski Feb 27, 2018
e377997
Detailed checks in disconnect hooks.
stolowski Feb 27, 2018
b2a76d9
Merge branch 'master' into interface-hooks
stolowski Feb 28, 2018
07565db
Small impovement to spread test.
stolowski Feb 28, 2018
ce8bcf8
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Feb 28, 2018
acc69b1
One more spread test improvement.
stolowski Feb 28, 2018
9655e07
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Feb 28, 2018
d6821ab
Fix snapctl get handling for disconnect- hook.
stolowski Feb 28, 2018
853706d
Don't call BeforeConnect* methods when reloding connections.
stolowski Feb 28, 2018
3bc7844
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Feb 28, 2018
ca0a98a
Merge branch 'master' into interface-hooks
stolowski Mar 1, 2018
66ec721
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Mar 1, 2018
d33f27d
disconnect-interfaces task.
stolowski Mar 2, 2018
00e9cbe
DisconnectHooks helper.
stolowski Mar 2, 2018
2125a2f
Merge branch 'master' into interface-hooks
stolowski Mar 6, 2018
8a1b248
Merge branch 'master' of https://github.com/snapcore/snapd into inter…
stolowski Mar 6, 2018
a4ebc07
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Mar 6, 2018
0c6f2ef
Remove commented code.
stolowski Mar 7, 2018
1f772a9
Merge branch 'master' into interface-hooks
stolowski Mar 12, 2018
48aee81
Renamed dummy interface types.
stolowski Mar 13, 2018
ea8704d
Changed BeforeConnect* methods of the dummy interface to update attri…
stolowski Mar 13, 2018
fa5c2d5
Merge branch 'master' into interface-hooks
stolowski Mar 15, 2018
180e9fa
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Mar 15, 2018
828587c
Updated disconnect hooks for dummy interface changes.
stolowski Mar 15, 2018
d9c68c7
Renamed connect-slot/plug-task to connect-slot/plug-hook-task.
stolowski Mar 19, 2018
48d147f
Made merged plug/slot attributes in the policy private.
stolowski Mar 19, 2018
047194f
Test case for policy check with plug attribute provided by dynamic at…
stolowski Mar 20, 2018
1403080
Test case for policy check with slot attribute provided by dynamic at…
stolowski Mar 20, 2018
b2230e7
Merge branch 'master' into interface-hooks
stolowski Mar 23, 2018
ced4431
Merge branch 'master' into interface-hooks
stolowski Mar 29, 2018
fa70f44
Return error other than NoOption from set.
stolowski Mar 29, 2018
5c307ab
Additional unit test case for fallback to dynamic attrs.
stolowski Mar 30, 2018
e3b9c03
Improved unit tests.
stolowski Mar 30, 2018
da465d2
Merge branch 'master' into interface-hooks
stolowski Mar 30, 2018
6b53d6c
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Mar 30, 2018
ab4bfcd
Merge branch 'master' into interface-hooks
stolowski Apr 3, 2018
c4354e6
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Apr 3, 2018
6a5a4b8
Merge branch 'master' into interface-hooks
stolowski Apr 11, 2018
3bc1f1f
Merge branch 'master' into interface-hooks
stolowski Apr 17, 2018
9fc2382
Review comments.
stolowski Apr 17, 2018
29ba44a
Merge branch 'master' into interface-hooks
stolowski Apr 20, 2018
804c1b3
Addressed review comments.
stolowski Apr 20, 2018
b85f76d
Merge branch 'interface-hooks' into disconnect-hooks
stolowski Apr 25, 2018
638b160
Merge branch 'master' into disconnect-hooks
stolowski May 8, 2018
a65787d
Use InjectTasks helper.
stolowski May 8, 2018
4740f86
Fix test.
stolowski May 8, 2018
a7fb7cc
Fix unkeyed fields error.
stolowski May 8, 2018
a25ed44
Merge branch 'master' into disconnect-hooks
stolowski May 11, 2018
57039c1
Removed code from bad merge.
stolowski May 14, 2018
9786be9
Merge branch 'master' into disconnect-hooks
stolowski May 17, 2018
87e2569
Small cleanup of attributesTask helper.
stolowski May 17, 2018
3c20901
Run disconnect hook after stopping snap services.
stolowski May 17, 2018
a89b89b
Unit test for Connection method.
stolowski May 17, 2018
c601eba
Set status after injecting tasks.
stolowski May 17, 2018
73d818c
Do not run plug/slot disconnect hooks if respective snap is not active.
stolowski May 18, 2018
102ba89
Conflict checking for disconnect hooks.
stolowski May 18, 2018
7f82429
Merge branch 'master' into disconnect-hooks
stolowski Jun 4, 2018
9bc7c37
Merge branch 'autoconnect-improve-errorhandling' into disconnect-hooks
stolowski Jun 5, 2018
0875b6b
Conflict checks tweaks.
stolowski Jun 5, 2018
0c9d669
Unit test.
stolowski Jun 5, 2018
73e8383
Merge branch 'master' into disconnect-hooks
stolowski Jun 5, 2018
4f51d68
Set undo hook setups on connect hooks.
stolowski Jun 5, 2018
1bdcfd3
Merge branch 'master' into disconnect-hooks
stolowski Jun 6, 2018
338000c
Spread test, fixes.
stolowski Jun 6, 2018
ef0c531
Spread test improved.
stolowski Jun 6, 2018
2c405c3
Updated unit test.
stolowski Jun 6, 2018
0a3b4fc
Reduce duplicated code - use just one handler for all interface hooks.
stolowski Jun 6, 2018
e2653f5
Minor test cleanup.
stolowski Jun 6, 2018
367f60d
DisconnectInterfaces unit test.
stolowski Jun 12, 2018
82447f0
Comments/cleanup.
stolowski Jun 13, 2018
e94622b
Test for Retry on unlink/link/setup-profiles
stolowski Jun 13, 2018
94357e3
Merge branch 'master' into disconnect-hooks
stolowski Jun 13, 2018
0767a02
Improved managers test.
stolowski Jun 13, 2018
9cbe816
Merge branch 'master' into disconnect-hooks
stolowski Jun 14, 2018
5c94036
Ensure/Wait instead of settle.
stolowski Jun 14, 2018
fdad323
Conflict checks changes.
stolowski Jun 18, 2018
55604a0
Merge branch 'master' into disconnect-hooks
stolowski Jun 18, 2018
2cf253b
Merge branch 'master' into disconnect-hooks
stolowski Jun 19, 2018
477cdd8
Fix spread test.
stolowski Jun 19, 2018
53a79d1
Merge branch 'master' into disconnect-hooks
stolowski Jun 20, 2018
c134c5c
Merge branch 'master' into disconnect-hooks
stolowski Jun 21, 2018
4d5bee5
Merge branch 'master' into disconnect-hooks
stolowski Jun 21, 2018
df8a225
Merge branch 'master' into disconnect-hooks
stolowski Jun 22, 2018
298891b
Repo: don't report self-connections twice.
stolowski Jun 22, 2018
57414c0
Merge branch 'master' into disconnect-hooks
stolowski Jun 25, 2018
fc6912a
Test fixes.
stolowski Jun 26, 2018
e804b32
undo for disconnect.
stolowski Jun 26, 2018
4ba6552
Merge branch 'master' into disconnect-hooks
stolowski Jul 2, 2018
e083088
Merge branch 'master' into disconnect-hooks
stolowski Jul 3, 2018
c48f62d
Set "automatic-disconnect" flag on disconnects created as part of dis…
stolowski Jul 4, 2018
d4af3e1
Updated managers test for uninstall+removal of auto-connections.
stolowski Jul 4, 2018
29813f6
Fix API test failure after making doDisconnect handler require 'conns'.
stolowski Jul 4, 2018
4f2aa8e
Merge branch 'master' into disconnect-hooks
stolowski Jul 4, 2018
04e43ea
Shellcheck fixes.
stolowski Jul 4, 2018
eab06db
Merge branch 'master' into disconnect-hooks
stolowski Jul 5, 2018
de78236
Added unit test for disconnect undo.
stolowski Jul 5, 2018
cb3a1bf
Simplify Disconnect method since hooks are always needed, don't store…
stolowski Jul 5, 2018
b6ceddc
Merge branch 'master' into disconnect-hooks
stolowski Jul 9, 2018
577d2b8
Updated conflict logic.
stolowski Jul 9, 2018
6098a07
Report confilict for individual (dis)connects.
stolowski Jul 9, 2018
bd27318
Merge branch 'master' into disconnect-hooks
stolowski Jul 10, 2018
7fd3a31
Tweaked the comments.
stolowski Jul 10, 2018
3435ac2
Merge branch 'master' into disconnect-hooks
stolowski Jul 18, 2018
5c94e53
Merge branch 'master' into disconnect-hooks
stolowski Jul 18, 2018
82713ee
Merge remote-tracking branch 'pedronis/single-shared-taskrunner' into…
stolowski Jul 19, 2018
a978ac9
Fix existing tests.
stolowski Jul 19, 2018
724565e
More test fixes.
stolowski Jul 19, 2018
a75122e
Simplified confilict check logic for disconnect-interfaces and auto-c…
stolowski Jul 19, 2018
f6e7a92
Use existing pattern for hook regexps.
stolowski Jul 19, 2018
a29a576
Addressed review comments.
stolowski Jul 19, 2018
5fd2f5e
Merge branch 'master' into disconnect-hooks
stolowski Jul 20, 2018
01b64b8
Review feedback.
stolowski Jul 20, 2018
f54ba35
Merge branch 'master' into disconnect-hooks
stolowski Jul 20, 2018
19755b7
Updated test.
stolowski Jul 20, 2018
bc7e54e
Remap snaps when constructing conn ID for conns lookup.
stolowski Jul 20, 2018
a515183
Updated snapstate tests for task runner changes.
stolowski Jul 20, 2018
57154ba
Revert "Remap snaps when constructing conn ID for conns lookup."
stolowski Aug 6, 2018
6ee6633
Merge branch 'master' into disconnect-hooks
stolowski Aug 6, 2018
5b63122
Merge branch 'master' into disconnect-hooks
stolowski Aug 6, 2018
680dade
Merge branch 'master' into disconnect-hooks
stolowski Aug 14, 2018
9fd9637
Renamed "disconnect-interfaces" task to "auto-disconnect".
stolowski Aug 14, 2018
f65ddd7
Merge branch 'master' into disconnect-hooks
stolowski Aug 16, 2018
4365841
Review comments.
stolowski Aug 16, 2018
23c5acf
Merge branch 'master' into disconnect-hooks
stolowski Aug 16, 2018
c078566
Two more review comments.
stolowski Aug 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion daemon/api.go
Expand Up @@ -1874,7 +1874,11 @@ func changeInterfaces(c *Command, r *http.Request, user *auth.UserState) Respons
}
for _, connRef := range conns {
var ts *state.TaskSet
ts, err = ifacestate.Disconnect(st, connRef.PlugRef.Snap, connRef.PlugRef.Name, connRef.SlotRef.Snap, connRef.SlotRef.Name)
conn, err := repo.Connection(connRef)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine

if err != nil {
break
}
ts, err = ifacestate.Disconnect(st, conn)
if err != nil {
break
}
Expand Down
20 changes: 18 additions & 2 deletions daemon/api_test.go
Expand Up @@ -4255,6 +4255,15 @@ func (s *apiSuite) testDisconnect(c *check.C, plugSnap, plugName, slotSnap, slot
_, err := repo.Connect(connRef, nil, nil, nil)
c.Assert(err, check.IsNil)

st := d.overlord.State()
st.Lock()
st.Set("conns", map[string]interface{}{
"consumer:plug producer:slot": map[string]interface{}{
"interface": "test",
},
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because doDisconnect handler needs access to conns now to make a copy of the connection for undo; and the connection needs to exist there or otherwise I report an error.

st.Unlock()

d.overlord.Loop()
defer d.overlord.Stop()

Expand All @@ -4276,7 +4285,6 @@ func (s *apiSuite) testDisconnect(c *check.C, plugSnap, plugName, slotSnap, slot
c.Check(err, check.IsNil)
id := body["change"].(string)

st := d.overlord.State()
st.Lock()
chg := st.Change(id)
st.Unlock()
Expand Down Expand Up @@ -4460,6 +4468,15 @@ func (s *apiSuite) TestDisconnectCoreSystemAlias(c *check.C) {
_, err := repo.Connect(connRef, nil, nil, nil)
c.Assert(err, check.IsNil)

st := d.overlord.State()
st.Lock()
st.Set("conns", map[string]interface{}{
"consumer:plug core:slot": map[string]interface{}{
"interface": "test",
},
})
st.Unlock()

d.overlord.Loop()
defer d.overlord.Stop()

Expand All @@ -4481,7 +4498,6 @@ func (s *apiSuite) TestDisconnectCoreSystemAlias(c *check.C) {
c.Check(err, check.IsNil)
id := body["change"].(string)

st := d.overlord.State()
st.Lock()
chg := st.Change(id)
st.Unlock()
Expand Down
27 changes: 27 additions & 0 deletions interfaces/repo.go
Expand Up @@ -277,6 +277,29 @@ func (r *Repository) Plug(snapName, plugName string) *snap.PlugInfo {
return r.plugs[snapName][plugName]
}

// Connection returns the specified Connection object or an error.
func (r *Repository) Connection(connRef *ConnRef) (*Connection, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine

// Ensure that such plug exists
plug := r.plugs[connRef.PlugRef.Snap][connRef.PlugRef.Name]
if plug == nil {
return nil, fmt.Errorf("snap %q has no plug named %q", connRef.PlugRef.Snap, connRef.PlugRef.Name)
}
// Ensure that such slot exists
slot := r.slots[connRef.SlotRef.Snap][connRef.SlotRef.Name]
if slot == nil {
return nil, fmt.Errorf("snap %q has no slot named %q", connRef.SlotRef.Snap, connRef.SlotRef.Name)
}
// Ensure that slot and plug are connected
conn, ok := r.slotPlugs[slot][plug]
if !ok {
return nil, fmt.Errorf("no connection from %s:%s to %s:%s",
connRef.PlugRef.Snap, connRef.PlugRef.Name,
connRef.SlotRef.Snap, connRef.SlotRef.Name)
}

return conn, nil
}

// AddPlug adds a plug to the repository.
// Plug names must be valid snap names, as defined by ValidateName.
// Plug name must be unique within a particular snap.
Expand Down Expand Up @@ -760,6 +783,10 @@ func (r *Repository) Connections(snapName string) ([]*ConnRef, error) {
}
for _, slotInfo := range r.slots[snapName] {
for plugInfo := range r.slotPlugs[slotInfo] {
// self-connection, ignore here as we got it already in the plugs loop above
if plugInfo.Snap == slotInfo.Snap {
continue
}
connRef := NewConnRef(plugInfo, slotInfo)
conns = append(conns, connRef)
}
Expand Down
49 changes: 48 additions & 1 deletion interfaces/repo_test.go
Expand Up @@ -36,6 +36,7 @@ type RepositorySuite struct {
testutil.BaseTest
iface Interface
plug *snap.PlugInfo
plugSelf *snap.PlugInfo
slot *snap.SlotInfo
emptyRepo *Repository
// Repository pre-populated with s.iface
Expand Down Expand Up @@ -83,9 +84,13 @@ slots:
interface: interface
label: label
attr: value
plugs:
self:
interface: interface
label: label
`, nil)
s.slot = producer.Slots["slot"]

s.plugSelf = producer.Plugs["self"]
// NOTE: Each of the snaps below have one slot so that they can be picked
// up by the repository. Some tests rename the "slot" slot as appropriate.
s.ubuntuCoreSnap = snaptest.MockInfo(c, `
Expand All @@ -96,6 +101,9 @@ slots:
slot:
interface: interface
`, nil)
// NOTE: The core snap has a slot so that it shows up in the
// repository. The repository doesn't record snaps unless they
// have at least one interface.
s.coreSnap = snaptest.MockInfo(c, `
name: core
version: 0
Expand Down Expand Up @@ -1356,6 +1364,21 @@ func (s *RepositorySuite) TestConnections(c *C) {
c.Assert(conns, HasLen, 0)
}

func (s *RepositorySuite) TestConnectionsWithSelfConnected(c *C) {
c.Assert(s.testRepo.AddPlug(s.plugSelf), IsNil)
c.Assert(s.testRepo.AddSlot(s.slot), IsNil)
_, err := s.testRepo.Connect(NewConnRef(s.plugSelf, s.slot), nil, nil, nil)
c.Assert(err, IsNil)

conns, err := s.testRepo.Connections(s.plugSelf.Snap.InstanceName())
c.Assert(err, IsNil)
c.Check(conns, DeepEquals, []*ConnRef{NewConnRef(s.plugSelf, s.slot)})

conns, err = s.testRepo.Connections(s.slot.Snap.InstanceName())
c.Assert(err, IsNil)
c.Check(conns, DeepEquals, []*ConnRef{NewConnRef(s.plugSelf, s.slot)})
}

// Tests for Repository.DisconnectAll()

func (s *RepositorySuite) TestDisconnectAll(c *C) {
Expand Down Expand Up @@ -2156,6 +2179,30 @@ func (s *RepositorySuite) TestBeforeConnectValidationPolicyCheckFailure(c *C) {
c.Assert(conn, IsNil)
}

func (s *RepositorySuite) TestConnection(c *C) {
c.Assert(s.testRepo.AddPlug(s.plug), IsNil)
c.Assert(s.testRepo.AddSlot(s.slot), IsNil)

connRef := NewConnRef(s.plug, s.slot)

conn, err := s.testRepo.Connection(connRef)
c.Assert(err, ErrorMatches, `no connection from consumer:plug to producer:slot`)

_, err = s.testRepo.Connect(connRef, nil, nil, nil)
c.Assert(err, IsNil)

conn, err = s.testRepo.Connection(connRef)
c.Assert(err, IsNil)
c.Assert(conn.Plug.Name(), Equals, "plug")
c.Assert(conn.Slot.Name(), Equals, "slot")

conn, err = s.testRepo.Connection(&ConnRef{PlugRef: PlugRef{Snap: "a", Name: "b"}, SlotRef: SlotRef{Snap: "producer", Name: "slot"}})
c.Assert(err, ErrorMatches, `snap "a" has no plug named "b"`)

conn, err = s.testRepo.Connection(&ConnRef{PlugRef: PlugRef{Snap: "consumer", Name: "plug"}, SlotRef: SlotRef{Snap: "a", Name: "b"}})
c.Assert(err, ErrorMatches, `snap "a" has no slot named "b"`)
}

type hotplugTestInterface struct{ InterfaceName string }

func (h *hotplugTestInterface) Name() string {
Expand Down
26 changes: 20 additions & 6 deletions overlord/hookstate/ctlcmd/get.go
Expand Up @@ -194,22 +194,36 @@ type ifaceHookType int
const (
preparePlugHook ifaceHookType = iota
prepareSlotHook
unpreparePlugHook
unprepareSlotHook
connectPlugHook
connectSlotHook
disconnectPlugHook
disconnectSlotHook
unknownHook
)

func interfaceHookType(hookName string) (ifaceHookType, error) {
if strings.HasPrefix(hookName, "prepare-plug-") {
switch {
case strings.HasPrefix(hookName, "prepare-plug-"):
return preparePlugHook, nil
} else if strings.HasPrefix(hookName, "connect-plug-") {
case strings.HasPrefix(hookName, "connect-plug-"):
return connectPlugHook, nil
} else if strings.HasPrefix(hookName, "prepare-slot-") {
case strings.HasPrefix(hookName, "prepare-slot-"):
return prepareSlotHook, nil
} else if strings.HasPrefix(hookName, "connect-slot-") {
case strings.HasPrefix(hookName, "connect-slot-"):
return connectSlotHook, nil
case strings.HasPrefix(hookName, "disconnect-plug-"):
return disconnectPlugHook, nil
case strings.HasPrefix(hookName, "disconnect-slot-"):
return disconnectSlotHook, nil
case strings.HasPrefix(hookName, "unprepare-slot-"):
return unprepareSlotHook, nil
case strings.HasPrefix(hookName, "unprepare-plug-"):
return unpreparePlugHook, nil
default:
return unknownHook, fmt.Errorf("unknown hook type")
}
return unknownHook, fmt.Errorf("unknown hook type")
}

func validatePlugOrSlot(attrsTask *state.Task, plugSide bool, plugOrSlot string) error {
Expand Down Expand Up @@ -275,7 +289,7 @@ func (c *getCommand) getInterfaceSetting(context *hookstate.Context, plugOrSlot
return fmt.Errorf("cannot use --plug and --slot together")
}

isPlugSide := (hookType == preparePlugHook || hookType == connectPlugHook)
isPlugSide := (hookType == preparePlugHook || hookType == unpreparePlugHook || hookType == connectPlugHook || hookType == disconnectPlugHook)
if err = validatePlugOrSlot(attrsTask, isPlugSide, plugOrSlot); err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion overlord/hookstate/ctlcmd/get_test.go
Expand Up @@ -223,7 +223,6 @@ func (s *getAttrSuite) SetUpTest(c *C) {
attrsTask.Set("plug-dynamic", dynamicPlugAttrs)
attrsTask.Set("slot-static", staticSlotAttrs)
attrsTask.Set("slot-dynamic", dynamicSlotAttrs)

ch.AddTask(attrsTask)
state.Unlock()

Expand Down
14 changes: 7 additions & 7 deletions overlord/ifacestate/export_test.go
Expand Up @@ -24,13 +24,13 @@ import (
)

var (
AddImplicitSlots = addImplicitSlots
SnapsWithSecurityProfiles = snapsWithSecurityProfiles
CheckConnectConflicts = checkConnectConflicts
FindSymmetricAutoconnect = findSymmetricAutoconnect
ConnectPriv = connect
GetConns = getConns
SetConns = setConns
AddImplicitSlots = addImplicitSlots
SnapsWithSecurityProfiles = snapsWithSecurityProfiles
CheckAutoconnectConflicts = checkAutoconnectConflicts
FindSymmetricAutoconnectTask = findSymmetricAutoconnectTask
ConnectPriv = connect
GetConns = getConns
SetConns = setConns
)

func MockRemoveStaleConnections(f func(st *state.State) error) (restore func()) {
Expand Down