summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-02-25 21:47:26 +0100
committerChristian Poessinger <christian@poessinger.com>2022-02-25 21:47:44 +0100
commit2865acbbf01616bd768eec8f979528943642b3c4 (patch)
treea24fabe2d508de3aa97dddc732b203a3938b5a9c /smoketest
parent20b50535e8c8d923d202853df8d486102f77a4ea (diff)
downloadvyos-1x-2865acbbf01616bd768eec8f979528943642b3c4.tar.gz
vyos-1x-2865acbbf01616bd768eec8f979528943642b3c4.zip
smoketest: webproxy: use setUpClass() over setUp()
(cherry picked from commit 15eff1682613ad20f83c46fded866b132a1fb814)
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_webproxy.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_service_webproxy.py b/smoketest/scripts/cli/test_service_webproxy.py
index d12cc7d58..dfccced0a 100755
--- a/smoketest/scripts/cli/test_service_webproxy.py
+++ b/smoketest/scripts/cli/test_service_webproxy.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
@@ -30,11 +30,19 @@ listen_if = 'dum3632'
listen_ip = '192.0.2.1'
class TestServiceWebProxy(VyOSUnitTestSHIM.TestCase):
- def setUp(self):
- self.cli_set(['interfaces', 'dummy', listen_if, 'address', listen_ip + '/32'])
+ @classmethod
+ def setUpClass(cls):
+ # call base-classes classmethod
+ super(cls, cls).setUpClass()
+ # create a test interfaces
+ cls.cli_set(cls, ['interfaces', 'dummy', listen_if, 'address', listen_ip + '/32'])
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.cli_delete(cls, ['interfaces', 'dummy', listen_if])
+ super().tearDownClass()
def tearDown(self):
- self.cli_delete(['interfaces', 'dummy', listen_if])
self.cli_delete(base_path)
self.cli_commit()