From a06b0051ff3643fdf532db71cceb3a5c9cc40dea Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 17 Jul 2020 19:42:41 +0200 Subject: ethernet: support testing via SSH Instead of running the smoketest on all available interfaces it is now possible to specify a whitespace separated list as environment variable where the test is performed. This is especially usefull when developing/testing via SSH and to limit the test to an interface you are not connected to. Test only with interface eth1: $ TEST_ETH='eth1' /usr/libexec/vyos/tests/smoke/cli/test_interfaces_ethernet.py --- scripts/cli/base_interfaces_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/cli/base_interfaces_test.py') diff --git a/scripts/cli/base_interfaces_test.py b/scripts/cli/base_interfaces_test.py index 53fe553bc..00a6f16e4 100644 --- a/scripts/cli/base_interfaces_test.py +++ b/scripts/cli/base_interfaces_test.py @@ -38,8 +38,11 @@ class BasicInterfaceTest: def tearDown(self): # we should not remove ethernet from the overall CLI if 'ethernet' in self._base_path: - self.session.delete(self._base_path) for intf in self._interfaces: + # when using a dedicated interface to test via TEST_ETH environment + # variable only this one will be cleared in the end - usable to test + # ethernet interfaces via SSH + self.session.delete(self._base_path + [intf]) self.session.set(self._base_path + [intf]) else: self.session.delete(self._base_path) -- cgit v1.2.3