From ec8ffd2c967d178c913be645c896434aa3212c9c Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 26 May 2023 22:21:55 +0200 Subject: smoketest: T5242: automatically detect interface "capabilities" Current state of vyos-1x smoketests have hardcoded features to test. The feature support is inside the base class BasicInterfaceTest class BasicInterfaceTest: class TestCase(VyOSUnitTestSHIM.TestCase): _test_dhcp = False _test_ip = False _test_mtu = False _test_vlan = False _test_qinq = False _test_ipv6 = False _test_ipv6_pd = False _test_ipv6_dhcpc6 = False _test_mirror = False All derived classes need to enable the tests that are supported on this interface type. Adding new feature to a given interface (like vif support in T5237) require manually enabling those tests for the given interface. It would make much more sense, if we can query the config backend for supported interface options - or in other words - is there a CLI node available that corresponds to set interfaces ethernet vif - if that's the case, _test_vlan = True. --- smoketest/scripts/cli/test_interfaces_bonding.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'smoketest/scripts/cli/test_interfaces_bonding.py') diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py index cd3995ed9..2e09173a7 100755 --- a/smoketest/scripts/cli/test_interfaces_bonding.py +++ b/smoketest/scripts/cli/test_interfaces_bonding.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2020-2022 VyOS maintainers and contributors +# Copyright (C) 2020-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -28,14 +28,6 @@ from vyos.util import read_file class BondingInterfaceTest(BasicInterfaceTest.TestCase): @classmethod def setUpClass(cls): - cls._test_dhcp = True - cls._test_ip = True - cls._test_ipv6 = True - cls._test_ipv6_pd = True - cls._test_ipv6_dhcpc6 = True - cls._test_mtu = True - cls._test_vlan = True - cls._test_qinq = True cls._base_path = ['interfaces', 'bonding'] cls._mirror_interfaces = ['dum21354'] cls._members = [] @@ -251,4 +243,4 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase): self.assertIn(member, slaves) if __name__ == '__main__': - unittest.main(verbosity=2) + unittest.main(verbosity=2, failfast=True) -- cgit v1.2.3