summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/base_interfaces_test.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-16 16:37:22 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-16 19:31:41 +0100
commitf228a1ae057ad61bcdd04c02eae794ae595a2aba (patch)
tree376773295c4b7fa1dcecdb5a1885862c85a7c1ca /smoketest/scripts/cli/base_interfaces_test.py
parent6049ed9f329f5435846d63404285bee3a5633eca (diff)
downloadvyos-1x-f228a1ae057ad61bcdd04c02eae794ae595a2aba.tar.gz
vyos-1x-f228a1ae057ad61bcdd04c02eae794ae595a2aba.zip
smoketest: loopback: interface can not be deleted, it must always exist
Commit 35b049aa ("smoketest: interfaces: verify deletion of interfaces") validated that when the test completed (tearDown()) there must be no interfaces left registered for the tests. This is invalid for the loopback interface as it can not be deleted from the system. (cherry picked from commit b373d3841608838fd28f98691cb14e42c128c216)
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index fbedca3f3..8b25d85e6 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -18,9 +18,10 @@ import json
from binascii import hexlify
-from netifaces import ifaddresses
from netifaces import AF_INET
from netifaces import AF_INET6
+from netifaces import ifaddresses
+from netifaces import interfaces
from vyos.configsession import ConfigSession
from vyos.ifconfig import Interface
@@ -96,7 +97,7 @@ class BasicInterfaceTest:
# Ethernet is handled in its derived class
if 'ethernet' not in self._base_path:
for intf in self._interfaces:
- self.assertFalse(os.path.isdir('/sys/class/net/{intf}'))
+ self.assertTrue(intf not in interfaces())
def test_span_mirror(self):
if not self._mirror_interfaces: