summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/base_interfaces_test.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-14 18:38:15 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-14 18:38:42 +0100
commit9ea9ac37ddb0c59c2a05efaf1ef78063ac2526f9 (patch)
treebe07324bfc0d7c578e99dcb511ec59a49812e058 /smoketest/scripts/cli/base_interfaces_test.py
parent05fe556af1047f9c8fdb352390cd60e13833deb7 (diff)
downloadvyos-1x-9ea9ac37ddb0c59c2a05efaf1ef78063ac2526f9.tar.gz
vyos-1x-9ea9ac37ddb0c59c2a05efaf1ef78063ac2526f9.zip
smoketest: interface: validate empty description on removal
(cherry picked from commit 3b9ae4c22d8dffa8b5beee57bf5b19dac969a009)
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index 36b085c7f..8a09dd96f 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -127,7 +127,17 @@ class BasicInterfaceTest:
for intf in self._interfaces:
test_string=f'Description-Test-{intf}'
tmp = read_file(f'/sys/class/net/{intf}/ifalias')
- self.assertTrue(tmp, test_string)
+ self.assertEqual(tmp, test_string)
+ self.assertEqual(Interface(intf).get_alias(), test_string)
+ self.session.delete(self._base_path + [intf, 'description'])
+
+ self.session.commit()
+
+ # Validate remove interface description "empty"
+ for intf in self._interfaces:
+ tmp = read_file(f'/sys/class/net/{intf}/ifalias')
+ self.assertEqual(tmp, str())
+ self.assertEqual(Interface(intf).get_alias(), str())
def test_add_single_ip_address(self):
addr = '192.0.2.0/31'