summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/test_legacy_clients.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-10-29 16:42:49 +0100
committerTomas Babej <tbabej@redhat.com>2014-11-21 12:14:44 +0100
commitd42c26c542cfa02c6ba3465ce529ef0cc8f37eda (patch)
treee7da3347299d368da0c220dd2a442ff34410b535 /ipatests/test_integration/test_legacy_clients.py
parent29c28786e35ee8e7fced740e62e0b5ddaa9bb381 (diff)
downloadfreeipa-d42c26c542cfa02c6ba3465ce529ef0cc8f37eda.tar.gz
freeipa-d42c26c542cfa02c6ba3465ce529ef0cc8f37eda.tar.xz
freeipa-d42c26c542cfa02c6ba3465ce529ef0cc8f37eda.zip
test_integration: Adjust tests for pytest
- Customize install() instead of setup_class() - Use pytest parametrization instead of test generators Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests/test_integration/test_legacy_clients.py')
-rw-r--r--ipatests/test_integration/test_legacy_clients.py37
1 files changed, 17 insertions, 20 deletions
diff --git a/ipatests/test_integration/test_legacy_clients.py b/ipatests/test_integration/test_legacy_clients.py
index 513664e50..49ad28019 100644
--- a/ipatests/test_integration/test_legacy_clients.py
+++ b/ipatests/test_integration/test_legacy_clients.py
@@ -55,26 +55,6 @@ class BaseTestLegacyClient(object):
# To allow custom validation dependent on the trust type
posix_trust = False
- @classmethod
- def setup_class(cls):
- super(BaseTestLegacyClient, cls).setup_class()
- cls.ad = cls.ad_domains[0].ads[0]
-
- cls.legacy_client = cls.host_by_role(cls.required_extra_roles[0])
-
- # Determine whether the subdomain AD is available
- try:
- child_ad = cls.host_by_role(cls.optional_extra_roles[0])
- cls.ad_subdomain = '.'.join(
- child_ad.hostname.split('.')[1:])
- except LookupError:
- cls.ad_subdomain = None
-
- tasks.apply_common_fixes(cls.legacy_client)
-
- for f in cls.backup_files:
- tasks.backup_file(cls.legacy_client, f)
-
def test_apply_advice(self):
# Obtain the advice from the server
tasks.kinit_admin(self.master)
@@ -359,6 +339,23 @@ class BaseTestLegacyClient(object):
cls.master.run_command(['ipa', 'user-disable', 'disabledipauser'])
+ cls.ad = cls.ad_domains[0].ads[0]
+
+ cls.legacy_client = cls.host_by_role(cls.required_extra_roles[0])
+
+ # Determine whether the subdomain AD is available
+ try:
+ child_ad = cls.host_by_role(cls.optional_extra_roles[0])
+ cls.ad_subdomain = '.'.join(
+ child_ad.hostname.split('.')[1:])
+ except LookupError:
+ cls.ad_subdomain = None
+
+ tasks.apply_common_fixes(cls.legacy_client)
+
+ for f in cls.backup_files:
+ tasks.backup_file(cls.legacy_client, f)
+
@classmethod
def uninstall(cls):
cls.master.run_command(['ipa', 'user-del', 'disabledipauser'],