summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/tasks.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-10-16 13:54:26 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-31 16:52:12 +0100
commitb1bffb5ecad0fdaa2f560efd2b75c76bedc4423c (patch)
tree791e5708660c6b873e497f345b9c6639af108852 /ipatests/test_integration/tasks.py
parent44998feace93a01b3dfda8fce6ff7aa35fffbabf (diff)
downloadfreeipa-b1bffb5ecad0fdaa2f560efd2b75c76bedc4423c.tar.gz
freeipa-b1bffb5ecad0fdaa2f560efd2b75c76bedc4423c.tar.xz
freeipa-b1bffb5ecad0fdaa2f560efd2b75c76bedc4423c.zip
ipatests: Add support for extra roles referenced by a keyword
Adds support for host definition by a environment variables of the following form: ROLE_<keyword>_envX, where X is the number of the environment for which host referenced by a role <keyword> should be defined. Adds a required_extra_roles attribute to the IntegrationTest class, which can test developer use to specify the extra roles that this particular test requires. If not all required extra roles are available, the test will be skipped. All extra (and static) roles are accessible to the IntegrationTests via the host_by_role method, which returns a host of given role. Part of: https://fedorahosted.org/freeipa/ticket/3833
Diffstat (limited to 'ipatests/test_integration/tasks.py')
-rw-r--r--ipatests/test_integration/tasks.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 3fa328799..6c36d3451 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -34,15 +34,17 @@ from ipapython.dn import DN
from ipapython.ipa_log_manager import log_mgr
from ipatests.test_integration import util
from ipatests.test_integration.config import env_to_script
+from ipatests.test_integration.host import Host
log = log_mgr.get_logger(__name__)
def prepare_host(host):
- env_filename = os.path.join(host.config.test_dir, 'env.sh')
- host.collect_log(env_filename)
- host.transport.mkdir_recursive(host.config.test_dir)
- host.put_file_contents(env_filename, env_to_script(host.to_env()))
+ if isinstance(host, Host):
+ env_filename = os.path.join(host.config.test_dir, 'env.sh')
+ host.collect_log(env_filename)
+ host.transport.mkdir_recursive(host.config.test_dir)
+ host.put_file_contents(env_filename, env_to_script(host.to_env()))
def apply_common_fixes(host):