diff options
| author | Christian Poessinger <christian@poessinger.com> | 2022-02-25 22:31:45 +0100 | 
|---|---|---|
| committer | Christian Poessinger <christian@poessinger.com> | 2022-02-25 22:31:48 +0100 | 
| commit | d25e07fd2e965b1193ad4d625167e890b0e36f6a (patch) | |
| tree | be5faba108e4a3f6c8d248c209a281a83af09207 | |
| parent | 0daf168d3d7583984431de2ef97682ff4c986f74 (diff) | |
| download | vyos-1x-d25e07fd2e965b1193ad4d625167e890b0e36f6a.tar.gz vyos-1x-d25e07fd2e965b1193ad4d625167e890b0e36f6a.zip | |
smoketest: zone-policy: use setUpClass() over setUp()
| -rwxr-xr-x | smoketest/scripts/cli/test_zone_policy.py | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/smoketest/scripts/cli/test_zone_policy.py b/smoketest/scripts/cli/test_zone_policy.py index 00dfe0182..6e34f3179 100755 --- a/smoketest/scripts/cli/test_zone_policy.py +++ b/smoketest/scripts/cli/test_zone_policy.py @@ -1,6 +1,6 @@  #!/usr/bin/env python3  # -# Copyright (C) 2021 VyOS maintainers and contributors +# Copyright (C) 2021-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 @@ -21,12 +21,18 @@ from base_vyostest_shim import VyOSUnitTestSHIM  from vyos.util import cmd  class TestZonePolicy(VyOSUnitTestSHIM.TestCase): -    def setUp(self): -        self.cli_set(['firewall', 'name', 'smoketest', 'default-action', 'drop']) +    @classmethod +    def setUpClass(cls): +        super(cls, cls).setUpClass() +        cls.cli_set(cls, ['firewall', 'name', 'smoketest', 'default-action', 'drop']) + +    @classmethod +    def tearDownClass(cls): +        cls.cli_delete(cls, ['firewall']) +        super(cls, cls).tearDownClass()      def tearDown(self):          self.cli_delete(['zone-policy']) -        self.cli_delete(['firewall'])          self.cli_commit()      def test_basic_zone(self): | 
