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:08 +0100 |
commit | 461a106cdaf892a067bcd5630952822242edd411 (patch) | |
tree | 2fb0468feaf4af203912e9a5195e9233dabb95ce /smoketest/scripts/cli | |
parent | e1b2f1012ca18ef4ecf2b53e9bb01a50880cbd3c (diff) | |
download | vyos-1x-461a106cdaf892a067bcd5630952822242edd411.tar.gz vyos-1x-461a106cdaf892a067bcd5630952822242edd411.zip |
smoketest: interface: test "disable" CLI option
Verify interface is in admin down state afterwards.
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): |