aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cleaner_tests/ipv6_test
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2024-01-15 18:51:04 -0800
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2024-04-12 11:50:48 -0400
commit93bcf51257ec4ce2b97c942e51e56546ce8cd0cd (patch)
treedb1e835f5de49918553281726d86f4660731313e /tests/cleaner_tests/ipv6_test
parent4069af4bca5d20662389200f0d426d2d31f054e8 (diff)
downloadsos-93bcf51257ec4ce2b97c942e51e56546ce8cd0cd.tar.gz
[testing] Add most testing via tox.ini
Consolidate testing, so that things can be run from CLI, CI and various other means in a consistent way by using tox. * Updated all the flake8 tests in the tests folder. * Added pylint as a neutral test so that we can work on this in stages and have some collaboration on what we test and don't * The tox tests for unit, stageone, stagetwo testing makes is easier for users to know how to run tests, and not have to do things manually * Using tox for CI doesn't make sense, as that will create virtual envs and will disregard system/snap based python modules so may not work Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'tests/cleaner_tests/ipv6_test')
-rw-r--r--tests/cleaner_tests/ipv6_test/ipv6_test.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/cleaner_tests/ipv6_test/ipv6_test.py b/tests/cleaner_tests/ipv6_test/ipv6_test.py
index 851b7678..1334d92d 100644
--- a/tests/cleaner_tests/ipv6_test/ipv6_test.py
+++ b/tests/cleaner_tests/ipv6_test/ipv6_test.py
@@ -10,6 +10,7 @@ from sos_tests import StageTwoReportTest
MOCK_FILE = '/tmp/sos-test-ipv6.txt'
+
class IPv6Test(StageTwoReportTest):
"""Place artificial plugin collecting crafted text file with ipv6 adresses
to make sure ipv6 obfuscation works when calling 'sos clean' like a user
@@ -31,8 +32,14 @@ class IPv6Test(StageTwoReportTest):
def test_valid_ipv6(self):
self.assertFileCollected(MOCK_FILE)
self.assertFileHasContent(MOCK_FILE, 'GOOD_IP=')
- self.assertFileNotHasContent(MOCK_FILE, 'GOOD_IP=3000:505f:505f:505f:505f:505f:505f:505f')
+ self.assertFileNotHasContent(
+ MOCK_FILE,
+ 'GOOD_IP=3000:505f:505f:505f:505f:505f:505f:505f'
+ )
def test_bad_ipv6(self):
self.assertFileHasContent(MOCK_FILE, 'BAD_IP=')
- self.assertFileNotHasContent(MOCK_FILE, 'BAD_IP=505f:505f:505f:505f:505f:505f:505f:505f')
+ self.assertFileNotHasContent(
+ MOCK_FILE,
+ 'BAD_IP=505f:505f:505f:505f:505f:505f:505f:505f'
+ )