diff options
author | Michal Polovka <mpolovka@redhat.com> | 2019-08-02 10:48:19 +0200 |
---|---|---|
committer | François Cami <fcami@redhat.com> | 2019-08-27 12:04:45 +0200 |
commit | a71c59c7c881ffcc76ba9b02d02ddd31a0f829b6 (patch) | |
tree | c8fdea291d04b9c12d290bb2c0ddeb0deb2c4732 | |
parent | 24c6ce27b215ce6584ef3d38bcb8cfd68af20ce6 (diff) | |
download | freeipa-a71c59c7c881ffcc76ba9b02d02ddd31a0f829b6.tar.gz freeipa-a71c59c7c881ffcc76ba9b02d02ddd31a0f829b6.tar.xz freeipa-a71c59c7c881ffcc76ba9b02d02ddd31a0f829b6.zip |
ipatests: Test for ipa-backup with ipa not configured
Added test class for executing tests without ipa server being
configured. This is achieved by not providing topology attribute in the
test class. Subsequently implemented test for PG6843 - ipa-backup does not create
log file at /var/log/ - by invoking ipa-backup command with ipa server
not configured and checking for expected error code presence of /var/log
in the error message.
https://pagure.io/freeipa/issue/6843
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Tibor Dudlák <tdudlak@redhat.com>
Reviewed-By: François Cami <fcami@redhat.com>
-rw-r--r-- | ipatests/prci_definitions/nightly_f29.yaml | 12 | ||||
-rw-r--r-- | ipatests/prci_definitions/nightly_master.yaml | 12 | ||||
-rw-r--r-- | ipatests/prci_definitions/nightly_rawhide.yaml | 12 | ||||
-rw-r--r-- | ipatests/test_integration/test_cli_ipa_not_configured.py | 24 |
4 files changed, 60 insertions, 0 deletions
diff --git a/ipatests/prci_definitions/nightly_f29.yaml b/ipatests/prci_definitions/nightly_f29.yaml index ee133661b..79c0b0e98 100644 --- a/ipatests/prci_definitions/nightly_f29.yaml +++ b/ipatests/prci_definitions/nightly_f29.yaml @@ -1280,3 +1280,15 @@ jobs: template: *ci-master-f29 timeout: 3600 topology: *master_1repl + + fedora-29/test_integration_TestIPANotConfigured: + requires: [fedora-29/build] + priority: 50 + job: + class: RunPytest + args: + build_url: '{fedora-29/build_url}' + test_suite: test_integration/test_cli_ipa_not_configured.py::TestIPANotConfigured + template: *ci-master-f29 + timeout: 10800 + topology: *ipaserver diff --git a/ipatests/prci_definitions/nightly_master.yaml b/ipatests/prci_definitions/nightly_master.yaml index 24b236bea..ddc31a680 100644 --- a/ipatests/prci_definitions/nightly_master.yaml +++ b/ipatests/prci_definitions/nightly_master.yaml @@ -1292,3 +1292,15 @@ jobs: template: *ci-master-f30 timeout: 3600 topology: *master_1repl + + fedora-30/test_integration_TestIPANotConfigured: + requires: [fedora-30/build] + priority: 50 + job: + class: RunPytest + args: + build_url: '{fedora-30/build_url}' + test_suite: test_integration/test_cli_ipa_not_configured.py::TestIPANotConfigured + template: *ci-master-f30 + timeout: 10800 + topology: *ipaserver diff --git a/ipatests/prci_definitions/nightly_rawhide.yaml b/ipatests/prci_definitions/nightly_rawhide.yaml index 6a06cf550..fde6b8122 100644 --- a/ipatests/prci_definitions/nightly_rawhide.yaml +++ b/ipatests/prci_definitions/nightly_rawhide.yaml @@ -1292,3 +1292,15 @@ jobs: template: *ci-master-frawhide timeout: 3600 topology: *master_1repl + + fedora-rawhide/test_integration_TestIPANotConfigured: + requires: [fedora-rawhide/build] + priority: 50 + job: + class: RunPytest + args: + build_url: '{fedora-rawhide/build_url}' + test_suite: test_integration/test_cli_ipa_not_configured.py::TestIPANotConfigured + template: *ci-master-frawhide + timeout: 10800 + topology: *ipaserver diff --git a/ipatests/test_integration/test_cli_ipa_not_configured.py b/ipatests/test_integration/test_cli_ipa_not_configured.py new file mode 100644 index 000000000..1bf36d8ee --- /dev/null +++ b/ipatests/test_integration/test_cli_ipa_not_configured.py @@ -0,0 +1,24 @@ +from ipapython.admintool import SERVER_NOT_CONFIGURED +from ipatests.test_integration.base import IntegrationTest + + +class TestIPANotConfigured(IntegrationTest): + """ + Test class for CLI commands with ipa server not configured. + Topology parameter is omitted in order to prevent IPA from configuring. + """ + + def test_var_log_message_with_ipa_backup(self): + """ + Test for PG6843: ipa-backup does not create log file at /var/log + Launches ipa backup command on system with ipa server not configured. + As the server is not configured yet, command should fail and stderr + should not contain link to /var/log, as no such log is created. + Issue URl: https://pagure.io/freeipa/issue/6843 + """ + exp_str = "not configured on this system" + unexp_str = "/var/log" + cmd = self.master.run_command(["ipa-backup"], raiseonerr=False) + assert (exp_str in cmd.stderr_text and + cmd.returncode == SERVER_NOT_CONFIGURED and + unexp_str not in cmd.stderr_text) |