summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration
diff options
context:
space:
mode:
authorOleg Fayans <ofayans@redhat.com>2016-01-07 08:50:53 +0100
committerMartin Basti <mbasti@redhat.com>2016-01-07 18:27:57 +0100
commit3b39d8b6de3e9e3551c2c413db1fe8260979c593 (patch)
tree1ba09a3fac6c6eab61d39942289e4bc3357cfeb5 /ipatests/test_integration
parent8f09499ee02d4bb3ae924a7606ed38458cc1b5b4 (diff)
downloadfreeipa-3b39d8b6de3e9e3551c2c413db1fe8260979c593.tar.gz
freeipa-3b39d8b6de3e9e3551c2c413db1fe8260979c593.tar.xz
freeipa-3b39d8b6de3e9e3551c2c413db1fe8260979c593.zip
Fixed install_ca and install_kra under domain level 0
Also added ipa_backup, ipa_restore and replica_uninstall functions Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests/test_integration')
-rw-r--r--ipatests/test_integration/tasks.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index a09157f6a..e7984f35f 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -934,9 +934,22 @@ def resolve_record(nameserver, query, rtype="SOA", retry=True, timeout=100):
time.sleep(1)
+def ipa_backup(master):
+ result = master.run_command(["ipa-backup"])
+ path_re = re.compile("^Backed up to (?P<backup>.*)$", re.MULTILINE)
+ matched = path_re.search(result.stdout_text + result.stderr_text)
+ return matched.group("backup")
+
+
+def ipa_restore(master, backup_path):
+ master.run_command(["ipa-restore", "-U",
+ "-p", master.config.dirman_password,
+ backup_path])
+
+
def install_kra(host, domain_level=None, first_instance=False, raiseonerr=True):
- if not domain_level:
- domain_level = domainlevel(host)
+ if domain_level is None:
+ domain_level = domainlevel(host)
command = ["ipa-kra-install", "-U"]
if domain_level == DOMAIN_LEVEL_0 and not first_instance:
replica_file = get_replica_filename(host)
@@ -945,8 +958,8 @@ def install_kra(host, domain_level=None, first_instance=False, raiseonerr=True):
def install_ca(host, domain_level=None, first_instance=False, raiseonerr=True):
- if not domain_level:
- domain_level = domainlevel(host)
+ if domain_level is None:
+ domain_level = domainlevel(host)
command = ["ipa-ca-install", "-U", "-p", host.config.dirman_password,
"-P", 'admin', "-w", host.config.admin_password]
if domain_level == DOMAIN_LEVEL_0 and not first_instance:
@@ -962,3 +975,10 @@ def install_dns(host, raiseonerr=True):
"-U",
]
return host.run_command(args, raiseonerr=raiseonerr)
+
+
+def uninstall_replica(master, replica):
+ master.run_command(["ipa-replica-manage", "del", "--force",
+ "-p", master.config.dirman_password,
+ replica.hostname], raiseonerr=False)
+ uninstall_master(replica)