mirror of
https://github.com/jtesta/ssh-audit.git
synced 2026-10-27 11:31:29 +01:00
Listing built-in policies will now hide older versions, unless -v is used.
This commit is contained in:
1 parent
3220043aaf
commit
c0133a8d5f
3 files changed
+45
-9
No files matched your search
@@ -52,6 +52,14 @@ class TestPolicy:
|
||||
version_str = " (version %s)" % BUILTIN_POLICIES[policy_name]['version']
|
||||
assert policy_name.endswith(version_str)
|
||||
|
||||
# Ensure version field is a string, but can be parsed as an integer.
|
||||
version_field = BUILTIN_POLICIES[policy_name]['version']
|
||||
assert type(version_field) is str
|
||||
try:
|
||||
int(version_field)
|
||||
except ValueError:
|
||||
assert False, "version field of %s policy is not parseable as an integer." % policy_name
|
||||
|
||||
# Ensure no extra fields are present.
|
||||
assert len(required_fields) == len(BUILTIN_POLICIES[policy_name])
|
||||
|
||||
|
||||
Reference in new issue
Block a user