From 4b8ee464d0899ae63ecc398b857eb144c013e4cb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 1 Feb 2020 19:21:55 +0100 Subject: interface: add test case for interface description --- scripts/cli/test_interfaces.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 """ -- cgit v1.2.3