diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-16 10:54:06 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-16 10:54:43 +0100 |
commit | 497f1866e71fadce33f9f19119f91a3c18263a70 (patch) | |
tree | 5b5598b49fa2563ccaba8fca52d8d889a9b59e01 /smoketest/scripts/cli | |
parent | 5da31c186c1c8defbe82ee2e8bba53c15c0cd655 (diff) | |
download | vyos-1x-497f1866e71fadce33f9f19119f91a3c18263a70.tar.gz vyos-1x-497f1866e71fadce33f9f19119f91a3c18263a70.zip |
smoketest: interface: test "disable" CLI option
Verify interface is in admin down state afterwards.
(cherry picked from commit 461a106cdaf892a067bcd5630952822242edd411)
Diffstat (limited to 'smoketest/scripts/cli')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index 8a09dd96f..4a65545a0 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -111,6 +111,19 @@ class BasicInterfaceTest: self.assertTrue(is_mirrored_to(interface, mirror, 'ffff')) self.assertTrue(is_mirrored_to(interface, mirror, '1')) + def test_interface_disable(self): + # Check if description can be added to interface and + # can be read back + for intf in self._interfaces: + self.session.set(self._base_path + [intf, 'disable']) + for option in self._options.get(intf, []): + self.session.set(self._base_path + [intf] + option.split()) + + self.session.commit() + + # Validate interface description + for intf in self._interfaces: + self.assertEqual(Interface(intf).get_admin_state(), 'down') def test_interface_description(self): # Check if description can be added to interface and @@ -150,6 +163,7 @@ class BasicInterfaceTest: for intf in self._interfaces: self.assertTrue(is_intf_addr_assigned(intf, addr)) + self.assertEqual(Interface(intf).get_admin_state(), 'up') def test_add_multiple_ip_addresses(self): # Add address @@ -269,6 +283,7 @@ class BasicInterfaceTest: tmp = read_file(f'/sys/class/net/{vif}/mtu') self.assertEqual(tmp, self._mtu) + self.assertEqual(Interface(vif).get_admin_state(), 'up') def test_8021ad_qinq_vlan_interfaces(self): |