URL: https://github.com/freeipa/freeipa/pull/2272 Author: Tiboris Title: #2272: [Backport][ipa-4-6] test: client uninstall fails when installed using non-existing hostname Action: opened
PR body: """ This PR was opened automatically because PR #2247 was pushed to master and backport to ipa-4-6 is required. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/2272/head:pr2272 git checkout pr2272
From 845db5877833d623a2be26cf0ff50b48f1ebecf7 Mon Sep 17 00:00:00 2001 From: Michal Reznik <mrez...@redhat.com> Date: Mon, 13 Aug 2018 17:09:15 +0200 Subject: [PATCH] test: client uninstall fails when installed using non-existing hostname https://pagure.io/freeipa/issue/7620 --- .../test_integration/test_uninstallation.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ipatests/test_integration/test_uninstallation.py b/ipatests/test_integration/test_uninstallation.py index ccdf5b3c8a..0d4b013830 100644 --- a/ipatests/test_integration/test_uninstallation.py +++ b/ipatests/test_integration/test_uninstallation.py @@ -12,6 +12,8 @@ from __future__ import absolute_import +import os + from ipatests.test_integration.base import IntegrationTest from ipatests.pytest_ipa.integration import tasks from ipaplatform.paths import paths @@ -21,10 +23,32 @@ class TestUninstallBase(IntegrationTest): + num_replicas = 1 + @classmethod def install(cls, mh): tasks.install_master(cls.master, setup_dns=False) + def test_uninstall_client_invalid_hostname(self): + + # using replica as client just for convenience + client = self.replicas[0] + client_inv_hostname = '{}.nonexistent'.format(client.hostname) + tasks.install_client(self.master, client, + extra_args=['--hostname', client_inv_hostname]) + + client.run_command(['ipa-client-install', '--uninstall', '-U']) + client_uninstall_log = client.get_file_contents( + paths.IPACLIENT_UNINSTALL_LOG, encoding='utf-8' + ) + assert "exception: ScriptError:" not in client_uninstall_log + + restore_state_path = os.path.join(paths.IPA_CLIENT_SYSRESTORE, + 'sysrestore.state') + result = client.run_command( + ['ls', restore_state_path], raiseonerr=False) + assert 'No such file or directory' in result.stderr_text + def test_failed_uninstall(self): self.master.run_command(['ipactl', 'stop'])
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/IACVBGQCTKMR6U3K4EFDJFDFR63UG3NR/