mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: Invoke class install methods properly with respect to pytest-multihost
Multihost object was is not passed to the install method in the super construction. This fixes setup errors in AD Trust, Forced client reenrollment, CALess and Sudo tests. https://fedorahosted.org/freeipa/ticket/4809 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
parent
c5c9d49706
commit
3507bcd3df
@ -68,7 +68,7 @@ def assert_error(result, stderr_text, returncode=None):
|
|||||||
class CALessBase(IntegrationTest):
|
class CALessBase(IntegrationTest):
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls, mh):
|
def install(cls, mh):
|
||||||
super(CALessBase, cls).install()
|
super(CALessBase, cls).install(mh)
|
||||||
cls.cert_dir = tempfile.mkdtemp(prefix="ipatest-")
|
cls.cert_dir = tempfile.mkdtemp(prefix="ipatest-")
|
||||||
cls.pem_filename = os.path.join(cls.cert_dir, 'root.pem')
|
cls.pem_filename = os.path.join(cls.cert_dir, 'root.pem')
|
||||||
scriptfile = os.path.join(os.path.dirname(__file__),
|
scriptfile = os.path.join(os.path.dirname(__file__),
|
||||||
@ -1145,8 +1145,8 @@ class TestClientInstall(CALessBase):
|
|||||||
|
|
||||||
class TestIPACommands(CALessBase):
|
class TestIPACommands(CALessBase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls):
|
def install(cls, mh):
|
||||||
super(TestIPACommands, cls).install()
|
super(TestIPACommands, cls).install(mh)
|
||||||
|
|
||||||
cls.export_pkcs12('ca1/server')
|
cls.export_pkcs12('ca1/server')
|
||||||
with open(cls.pem_filename, 'w') as f:
|
with open(cls.pem_filename, 'w') as f:
|
||||||
|
@ -36,7 +36,7 @@ class TestForcedClientReenrollment(IntegrationTest):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls, mh):
|
def install(cls, mh):
|
||||||
super(TestForcedClientReenrollment, cls).install()
|
super(TestForcedClientReenrollment, cls).install(mh)
|
||||||
tasks.install_master(cls.master)
|
tasks.install_master(cls.master)
|
||||||
tasks.install_replica(cls.master, cls.replicas[0], setup_ca=False)
|
tasks.install_replica(cls.master, cls.replicas[0], setup_ca=False)
|
||||||
cls.BACKUP_KEYTAB = os.path.join(
|
cls.BACKUP_KEYTAB = os.path.join(
|
||||||
|
@ -320,8 +320,8 @@ class BaseTestLegacyClient(object):
|
|||||||
assert result.returncode != 0
|
assert result.returncode != 0
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls):
|
def install(cls, mh):
|
||||||
super(BaseTestLegacyClient, cls).install()
|
super(BaseTestLegacyClient, cls).install(mh)
|
||||||
|
|
||||||
tasks.kinit_admin(cls.master)
|
tasks.kinit_admin(cls.master)
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ class BaseTestLegacyClient(object):
|
|||||||
tasks.backup_file(cls.legacy_client, f)
|
tasks.backup_file(cls.legacy_client, f)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def uninstall(cls):
|
def uninstall(cls, mh):
|
||||||
cls.master.run_command(['ipa', 'user-del', 'disabledipauser'],
|
cls.master.run_command(['ipa', 'user-del', 'disabledipauser'],
|
||||||
raiseonerr=False)
|
raiseonerr=False)
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ class BaseTestLegacyClient(object):
|
|||||||
if hasattr(cls, 'legacy_client'):
|
if hasattr(cls, 'legacy_client'):
|
||||||
tasks.unapply_fixes(cls.legacy_client)
|
tasks.unapply_fixes(cls.legacy_client)
|
||||||
|
|
||||||
super(BaseTestLegacyClient, cls).uninstall()
|
super(BaseTestLegacyClient, cls).uninstall(mh)
|
||||||
|
|
||||||
|
|
||||||
# Base classes with attributes that are specific for each legacy client test
|
# Base classes with attributes that are specific for each legacy client test
|
||||||
|
@ -30,8 +30,8 @@ class TestSudo(IntegrationTest):
|
|||||||
topology = 'line'
|
topology = 'line'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls):
|
def install(cls, mh):
|
||||||
super(TestSudo, cls).install()
|
super(TestSudo, cls).install(mh)
|
||||||
|
|
||||||
cls.client = cls.clients[0]
|
cls.client = cls.clients[0]
|
||||||
|
|
||||||
@ -70,10 +70,10 @@ class TestSudo(IntegrationTest):
|
|||||||
'localuser'])
|
'localuser'])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def uninstall(cls):
|
def uninstall(cls, mh):
|
||||||
cls.client.run_command(['groupdel', 'localgroup'], raiseonerr=False)
|
cls.client.run_command(['groupdel', 'localgroup'], raiseonerr=False)
|
||||||
cls.client.run_command(['userdel', 'localuser'], raiseonerr=False)
|
cls.client.run_command(['userdel', 'localuser'], raiseonerr=False)
|
||||||
super(TestSudo, cls).uninstall()
|
super(TestSudo, cls).uninstall(mh)
|
||||||
|
|
||||||
def list_sudo_commands(self, user, raiseonerr=False, verbose=False):
|
def list_sudo_commands(self, user, raiseonerr=False, verbose=False):
|
||||||
clear_sssd_cache(self.client)
|
clear_sssd_cache(self.client)
|
||||||
|
@ -34,7 +34,7 @@ class ADTrustBase(IntegrationTest):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def install(cls, mh):
|
def install(cls, mh):
|
||||||
super(ADTrustBase, cls).install()
|
super(ADTrustBase, cls).install(mh)
|
||||||
cls.ad = cls.ad_domains[0].ads[0]
|
cls.ad = cls.ad_domains[0].ads[0]
|
||||||
cls.install_adtrust()
|
cls.install_adtrust()
|
||||||
cls.check_sid_generation()
|
cls.check_sid_generation()
|
||||||
|
Loading…
Reference in New Issue
Block a user