Skip to content

Commit

Permalink
Tests: alltests/test_config_validation converted
Browse files Browse the repository at this point in the history
Reviewed-by: Justin Stephenson <[email protected]>
Reviewed-by: Tomáš Halman <[email protected]>
  • Loading branch information
patriki01 authored and jakub-vavra-cz committed Jan 5, 2024
1 parent 9d6caae commit d3a2bd0
Show file tree
Hide file tree
Showing 3 changed files with 715 additions and 8 deletions.
32 changes: 32 additions & 0 deletions src/tests/multihost/alltests/test_config_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
class TestConfigValidation(object):
""" SSSD Config Validation """
@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_option_name')
def test_0001_searchbase(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in option
Expand All @@ -41,6 +42,7 @@ def test_0001_searchbase(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_domain_name')
def test_0002_domainname(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in domain
Expand All @@ -58,6 +60,7 @@ def test_0002_domainname(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_invalid_option_name_in_snippet')
def test_0003_snippetfile(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in option
Expand All @@ -79,6 +82,7 @@ def test_0003_snippetfile(self, multihost, backupsssdconf):
multihost.client[0].run_command(rm_snippet_file, raiseonerr=False)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_invalid_domain_name_in_snippet')
def test_0004_snippetfile(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in domain
Expand All @@ -100,6 +104,7 @@ def test_0004_snippetfile(self, multihost, backupsssdconf):
multihost.client[0].run_command(rm_snippet_file, raiseonerr=False)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_misplaced_option')
def test_0005_misplaced(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify misplaced
Expand All @@ -119,6 +124,7 @@ def test_0005_misplaced(self, multihost, backupsssdconf):
assert log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_option_name')
def test_0006_sameerrors(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify same error when
Expand All @@ -140,6 +146,7 @@ def test_0006_sameerrors(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__missing_equal_sign')
def test_0007_equalsign(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: No equal sign between
Expand All @@ -157,6 +164,7 @@ def test_0007_equalsign(self, multihost, backupsssdconf):
print(log.search(cmd.stderr_text))

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__special_character_option_name')
def test_0008_specialcharacter(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Option name contains
Expand All @@ -175,6 +183,7 @@ def test_0008_specialcharacter(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_domain_name')
def test_0009_sectionname(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in
Expand All @@ -194,6 +203,7 @@ def test_0009_sectionname(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__special_character_section_name')
def test_0010_splcharacters(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos
Expand All @@ -213,6 +223,7 @@ def test_0010_splcharacters(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__special_character_domain_name')
def test_0011_splcharacters(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos (special
Expand All @@ -232,6 +243,7 @@ def test_0011_splcharacters(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__forward_slash_missing')
def test_0012_forwardslash(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Forward slash is not
Expand All @@ -250,6 +262,7 @@ def test_0012_forwardslash(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__sssd_section_name_typo')
def test_0013_sectiontypos(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation:
Expand All @@ -267,6 +280,7 @@ def test_0013_sectiontypos(self, multihost, backupsssdconf):
assert log_1.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__pam_section_name_typo')
def test_0014_pamsection(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Typos in pam section
Expand All @@ -283,6 +297,7 @@ def test_0014_pamsection(self, multihost, backupsssdconf):
assert log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__nss_section_name_typo')
def test_0015_nsssection(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Typos in nss section
Expand All @@ -299,6 +314,7 @@ def test_0015_nsssection(self, multihost, backupsssdconf):
assert log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__verify_permission')
def test_0016_verifypermission(self, multihost):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify the permission
Expand All @@ -317,6 +333,7 @@ def test_0016_verifypermission(self, multihost):
multihost.client[0].run_command(restore_mod, raiseonerr=False)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__verify_ownership')
def test_0017_verifyownership(self, multihost):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify the ownership
Expand Down Expand Up @@ -344,6 +361,7 @@ def test_0017_verifyownership(self, multihost):
multihost.client[0].run_command(restore_chown, raiseonerr=False)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__verify_missing_closing_bracket')
def test_0018_closingbrackets(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify the closing
Expand All @@ -361,6 +379,7 @@ def test_0018_closingbrackets(self, multihost, backupsssdconf):
assert log_1.search(cmd.stderr_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__verify_missing_opening_bracket')
def test_0019_openingbracket(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Check starting square
Expand All @@ -378,6 +397,7 @@ def test_0019_openingbracket(self, multihost, backupsssdconf):
log_1 = re.compile(r'.Equal\ssign\sis\smissing.*')
assert log_1.search(cmd.stderr_text)

# Useless?
@pytest.mark.tier1
def test_0020_fatalerror(self, multihost, backupsssdconf):
"""
Expand All @@ -401,6 +421,7 @@ def test_0020_fatalerror(self, multihost, backupsssdconf):
assert log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__verify_typo_in_config_with_two_domains')
def test_0021_twodomain(self, multihost, multidomain_sssd):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typo in option
Expand All @@ -422,6 +443,7 @@ def test_0021_twodomain(self, multihost, multidomain_sssd):
multihost.client[0].run_command(restore)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__config_does_not_exist')
def test_0022_fatalerror(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: No sssctl commands can
Expand All @@ -436,6 +458,7 @@ def test_0022_fatalerror(self, multihost, backupsssdconf):
assert cmd.returncode == 1 and log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_ldap_host_object_class_in_domain')
def test_0023_checkldaphostobjectdomain(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Check
Expand All @@ -452,6 +475,7 @@ def test_0023_checkldaphostobjectdomain(self, multihost, backupsssdconf):
assert cmd.returncode == 0

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_ldap_host_object_class_in_sssd')
def test_0024_checkldaphostobjectsssd(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Check
Expand All @@ -471,6 +495,7 @@ def test_0024_checkldaphostobjectsssd(self, multihost, backupsssdconf):
assert log.search(cmd.stdout_text)

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__enabling_2FA')
def test_0025_check2FA(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Check false
Expand All @@ -496,6 +521,7 @@ def test_0025_check2FA(self, multihost, backupsssdconf):
assert cmd.returncode == 0

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__auto_private_groups_in_child_domain')
def test_0026_checkchilddomain(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: sssctl config-check
Expand All @@ -517,6 +543,7 @@ def test_0026_checkchilddomain(self, multihost, backupsssdconf):
assert cmd.returncode == 0

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_default_config_location_snippet_directory')
def test_0027_bz1723273(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration merging: sssctl config-check
Expand All @@ -537,6 +564,8 @@ def test_0027_bz1723273(self, multihost, backupsssdconf):
sssctl_check.returncode == 1

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_default_config_location_permission')
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_default_config_location_ownership')
def test_0028_bz1723273(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration merging: sssctl config-check
Expand All @@ -559,6 +588,7 @@ def test_0028_bz1723273(self, multihost, backupsssdconf):
sssctl_check.returncode == 1

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_default_config_location_option_name_typo')
def test_0029_bz1723273(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Verify typos in option
Expand All @@ -585,6 +615,7 @@ def test_0029_bz1723273(self, multihost, backupsssdconf):
and sssctl_check.returncode == 1

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_default_config_location_snippet_is_present')
def test_0030_bz1723273(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: Does not complain
Expand All @@ -610,6 +641,7 @@ def test_0030_bz1723273(self, multihost, backupsssdconf):
and sssctl_check.returncode == 1

@pytest.mark.tier1
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__non_existing_snippet')
def test_0031_bz1723273(self, multihost, backupsssdconf):
"""
:title: IDM-SSSD-TC: Configuration validation: complains about non
Expand Down
2 changes: 1 addition & 1 deletion src/tests/multihost/basic/test_sssctl_config_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TestSssctlConfigCheck(object):
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__typo_option_name')
@pytest.mark.converted('test_sssctl.py', 'test_sssctl__check_typo_option_name')
def test_verify_typo_option_name(self, multihost):
"""
:title: sssctl: Verify typos in option name (not value)
Expand Down
Loading

0 comments on commit d3a2bd0

Please sign in to comment.