# Pastebin CoMWt6SB zyga@yantra:~/snapd/overlord/ifacestate> git diff diff --git a/overlord/ifacestate/ifacestate_test.go b/overlord/ifacestate/ifacestate_test.go index 5f249d8c7..b66bc3ec4 100644 --- a/overlord/ifacestate/ifacestate_test.go +++ b/overlord/ifacestate/ifacestate_test.go @@ -2388,6 +2388,11 @@ func (s *interfaceManagerSuite) TestReloadingConnectionsOnStartupUpdatesStaticAt "plug-static": map[string]interface{}{"attr": "old-plug-attr"}, "slot-static": map[string]interface{}{"attr": "old-slot-attr"}, }, + "unrelated-1:plug unrelated-2:slot": map[string]interface{}{ + "interface": "test", + "plug-static": map[string]interface{}{"attr": "unrelated"}, + "slot-static": map[string]interface{}{"attr": "unrelated"}, + }, }) s.state.Unlock() @@ -2456,6 +2461,21 @@ slots: // Because of the fact that during testing the system key always // mismatches, the security setup is performed. c.Check(secBackend.SetupCalls, HasLen, 2) + + // For completeness, the state of all connections. The unrelated connection + // was removed because the snap it belongs to no longer exists. This is + // done by removeStaleConnections. + s.state.Lock() + var conns map[string]interface{} + err = s.state.Get("conns", &conns) + c.Assert(err, IsNil) + c.Check(conns, DeepEquals, map[string]interface{}{ + "consumer:plug producer:slot": map[string]interface{}{ + "plug-static": map[string]interface{}{"attr": "new-plug-attr"}, + "slot-static": map[string]interface{}{"attr": "new-slot-attr"}, + "interface": "test", + }}) + s.state.Unlock() } // LP:#1825883; make sure static attributes in conns state are updated from the snap yaml on snap refresh