diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-25 19:04:28 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-25 19:15:17 +0200 |
commit | 4e36d5c0a502e31c3782bf97459eb822dd8ffa4f (patch) | |
tree | 20cf88f6812980333318c0e400cfb53a223bf16e /smoketest/scripts/cli | |
parent | c5e1d1ca131a0c98bbfb6ff2a4a07e3b8f0a8408 (diff) | |
download | vyos-1x-4e36d5c0a502e31c3782bf97459eb822dd8ffa4f.tar.gz vyos-1x-4e36d5c0a502e31c3782bf97459eb822dd8ffa4f.zip |
smoketest: dhcpv6-server: use setUpClass() over setUp()
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcpv6-server.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcpv6-server.py b/smoketest/scripts/cli/test_service_dhcpv6-server.py index 7177f1505..f83453323 100755 --- a/smoketest/scripts/cli/test_service_dhcpv6-server.py +++ b/smoketest/scripts/cli/test_service_dhcpv6-server.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2020 VyOS maintainers and contributors +# Copyright (C) 2020-2022 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 @@ -32,16 +32,24 @@ dns_1 = '2001:db8::1' dns_2 = '2001:db8::2' domain = 'vyos.net' nis_servers = ['2001:db8:ffff::1', '2001:db8:ffff::2'] -interface = 'eth1' +interface = 'eth0' interface_addr = inc_ip(subnet, 1) + '/64' -class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): - def setUp(self): - self.cli_set(['interfaces', 'ethernet', interface, 'address', interface_addr]) +class TestServiceDHCPv6Server(VyOSUnitTestSHIM.TestCase): + @classmethod + def setUpClass(cls): + super(TestServiceDHCPv6Server, cls).setUpClass() + cls.cli_set(cls, ['interfaces', 'ethernet', interface, 'address', interface_addr]) + + @classmethod + def tearDownClass(cls): + cls.cli_delete(cls, ['interfaces', 'ethernet', interface, 'address', interface_addr]) + cls.cli_commit(cls) + + super(TestServiceDHCPv6Server, cls).tearDownClass() def tearDown(self): self.cli_delete(base_path) - self.cli_delete(['interfaces', 'ethernet', interface, 'address', interface_addr]) self.cli_commit() def test_single_pool(self): |