pr307 update 2

This commit is contained in:
OAM7575
2024-12-23 17:43:37 +11:00
parent 48b9ee7deb
commit 231a47959a
4 changed files with 120 additions and 96 deletions
+8 -5
View File
@@ -12,7 +12,7 @@ class TestHardeningGuides:
@staticmethod
def _test_conf(conf, **kwargs):
options = {
'get_hardening_guides': ''
'get_hardening_guides': '',
}
for k, v in kwargs.items():
options[k] = v
@@ -26,13 +26,16 @@ class TestHardeningGuides:
with pytest.raises(SystemExit):
conf = c('--get-hardening-guides')
self._test_conf(conf)
with pytest.raises(SystemExit):
conf = c('--list-hardening-guides')
self._test_conf(conf)
for vendor in ["Amazon", "Debian", "Rocky", "Mint", "Ubuntu", "NoOS"]:
for vendor in ["Amazon", "Debian", "Rocky", "Mint", "Ubuntu", "NoOS", " "]:
vendor = vendor
for os_ver in ["2404", "2204", "2004", "1804", "2023", "22", "21", "20", "9", "Bookworm", "Bullseye", "NoVersion"]:
for os_ver in ["2404", "2204", "2004", "1804", "2023", "22", "21", "20", "9", "Bookworm", "Bullseye", "NoVersion", ""]:
os_ver = os_ver
for cs_type in ["Client", "Server", "Mistake"]:
for cs_type in ["Client", "Server", "Mistake", ""]:
cs_type = cs_type
with pytest.raises(SystemExit):
conf = c(f'--print-config {vendor} {os_ver} {cs_type}')
conf = c(f'--get-hardening-guides {vendor} {os_ver} {cs_type}')
self._test_conf(conf)