From e6f623829da774d1bfecf3986f05cde589ee21d7 Mon Sep 17 00:00:00 2001 From: Vinicius Arcanjo Date: Wed, 30 Nov 2022 13:22:01 -0300 Subject: [PATCH 1/2] Load interfaces as inactive Updated unit test accordingly --- main.py | 1 + tests/unit/test_main.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/main.py b/main.py index f70cdcc..48e1121 100644 --- a/main.py +++ b/main.py @@ -189,6 +189,7 @@ def _load_switch(self, switch_id, switch_att): interface.disable() interface.lldp = iface_att['lldp'] interface.extend_metadata(iface_att["metadata"]) + interface.deactivate() name = 'kytos/topology.port.created' event = KytosEvent(name=name, content={ 'switch': switch_id, diff --git a/tests/unit/test_main.py b/tests/unit/test_main.py index 8101b05..dddfe4b 100644 --- a/tests/unit/test_main.py +++ b/tests/unit/test_main.py @@ -362,6 +362,7 @@ def test_load_switch(self, *args): 'interfaces': { iface_a: { 'enabled': True, + 'active': True, 'lldp': True, 'id': iface_a, 'switch': dpid_a, @@ -397,6 +398,7 @@ def test_load_switch(self, *args): self.assertEqual(interface.switch.id, dpid_a) self.assertEqual(interface.port_number, 1) self.assertTrue(interface.is_enabled()) + self.assertFalse(interface.is_active()) self.assertTrue(interface.lldp) self.assertTrue(interface.uni) self.assertFalse(interface.nni) From 46f2a756a2ec545a8b1f8b45ab72f0ef00efb6e0 Mon Sep 17 00:00:00 2001 From: Vinicius Arcanjo Date: Wed, 30 Nov 2022 13:22:46 -0300 Subject: [PATCH 2/2] Updated CHANGELOG.rst accordingly --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f212c7e..41ae897 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,7 @@ Removed Fixed ===== - Fixed link up to only notify when ``LINK_UP_TIMER`` has passed +- Load interfaces as inactive Security ========