summaryrefslogtreecommitdiff
path: root/scripts/cli/test_interfaces.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-01 19:21:55 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-01 19:21:55 +0100
commit4b8ee464d0899ae63ecc398b857eb144c013e4cb (patch)
treedcdbacae453d6d8206db028ba2f4354d6414fc1d /scripts/cli/test_interfaces.py
parent558c6349dc8b851fdf57411196b20765531005eb (diff)
downloadvyos-1x-4b8ee464d0899ae63ecc398b857eb144c013e4cb.tar.gz
vyos-1x-4b8ee464d0899ae63ecc398b857eb144c013e4cb.zip
interface: add test case for interface description
Diffstat (limited to 'scripts/cli/test_interfaces.py')
-rwxr-xr-xscripts/cli/test_interfaces.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/cli/test_interfaces.py b/scripts/cli/test_interfaces.py
index fb5c53adc..5ba01a35c 100755
--- a/scripts/cli/test_interfaces.py
+++ b/scripts/cli/test_interfaces.py
@@ -35,6 +35,20 @@ class BasicInterfaceTest:
self.session.delete(self._base_path)
self.session.commit()
+ def test_add_description(self):
+ """ Check if description can be added to interface """
+ for intf in self._interfaces:
+ test_string='Description-Test-{}'.format(intf)
+ self.session.set(self._base_path + [intf, 'description', test_string])
+ self.session.commit()
+
+ # Validate interface description
+ for intf in self._interfaces:
+ test_string='Description-Test-{}'.format(intf)
+ with open('/sys/class/net/{}/ifalias'.format(intf), 'r') as f:
+ tmp = f.read().rstrip()
+ self.assertTrue(tmp, test_string)
+
def test_add_address(self):
""" Check if address can be added to interface """