From d6dc8874daa56e76a8d4ddccfe47224bcd73eb75 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 26 Jun 2020 15:23:38 +0200 Subject: interfaces: add basic test adding only one interface IP address ... this is required for proper testing the "weird" bahavior of T2636 and that the underlaying config parse fabric works as expected while migrating interface code. --- scripts/cli/base_interfaces_test.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'scripts/cli') diff --git a/scripts/cli/base_interfaces_test.py b/scripts/cli/base_interfaces_test.py index 3f8a74254..4fef01236 100644 --- a/scripts/cli/base_interfaces_test.py +++ b/scripts/cli/base_interfaces_test.py @@ -66,7 +66,20 @@ class BasicInterfaceTest: tmp = f.read().rstrip() self.assertTrue(tmp, test_string) - def test_add_address(self): + def test_add_address_single(self): + """ + Check if a single address can be added to interface. + """ + addr = '192.0.2.0/31' + for intf in self._interfaces: + self.session.set(self._base_path + [intf, 'address', addr]) + + self.session.commit() + + for intf in self._interfaces: + self.assertTrue(is_intf_addr_assigned(intf, addr)) + + def test_add_address_multi(self): """ Check if IPv4/IPv6 addresses can be added to interface. """ -- cgit v1.2.3