summaryrefslogtreecommitdiff
path: root/scripts/cli
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-26 15:23:38 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-26 15:23:38 +0200
commitd6dc8874daa56e76a8d4ddccfe47224bcd73eb75 (patch)
tree8d2bb5e8c3ff321cc2f1712e84af33ca421ccca7 /scripts/cli
parentf717f3f3ddb2afca78cf0ff3aab8457242d5f3d0 (diff)
downloadvyos-1x-d6dc8874daa56e76a8d4ddccfe47224bcd73eb75.tar.gz
vyos-1x-d6dc8874daa56e76a8d4ddccfe47224bcd73eb75.zip
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.
Diffstat (limited to 'scripts/cli')
-rw-r--r--scripts/cli/base_interfaces_test.py15
1 files changed, 14 insertions, 1 deletions
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.
"""