mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: Test client install/uninstall with automount enabled
The automount installation was failing. Confirm that it is fixed. The uninstall was not restoring all files/configuration. Verify that the index and state files are gone which means that all state and files were restored. Fixes: https://pagure.io/freeipa/issue/9487 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
committed by
Florence Blanc-Renaud
parent
e4420624ff
commit
ce811db6be
@@ -8,12 +8,14 @@ Module provides tests for various options of ipa-client-install.
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from ipaplatform.paths import paths
|
from ipaplatform.paths import paths
|
||||||
|
from ipalib.sysrestore import SYSRESTORE_STATEFILE, SYSRESTORE_INDEXFILE
|
||||||
from ipatests.test_integration.base import IntegrationTest
|
from ipatests.test_integration.base import IntegrationTest
|
||||||
from ipatests.pytest_ipa.integration import tasks
|
from ipatests.pytest_ipa.integration import tasks
|
||||||
from ipatests.pytest_ipa.integration.firewall import Firewall
|
from ipatests.pytest_ipa.integration.firewall import Firewall
|
||||||
@@ -90,6 +92,29 @@ class TestInstallClient(IntegrationTest):
|
|||||||
assert 'includedir {dir}'.format(
|
assert 'includedir {dir}'.format(
|
||||||
dir=paths.SSSD_PUBCONF_KRB5_INCLUDE_D_DIR
|
dir=paths.SSSD_PUBCONF_KRB5_INCLUDE_D_DIR
|
||||||
).encode() not in krb5_cfg
|
).encode() not in krb5_cfg
|
||||||
|
tasks.uninstall_client(self.clients[0])
|
||||||
|
|
||||||
|
def test_install_with_automount(self):
|
||||||
|
"""Test that installation with automount is successful"""
|
||||||
|
tasks.install_client(self.master, self.clients[0],
|
||||||
|
extra_args=['--automount-location', 'default'])
|
||||||
|
|
||||||
|
def test_uninstall_with_automount(self):
|
||||||
|
"""Test that uninstall with automount is successful and complete"""
|
||||||
|
tasks.uninstall_client(self.clients[0])
|
||||||
|
index = os.path.join(
|
||||||
|
paths.IPA_CLIENT_SYSRESTORE, SYSRESTORE_INDEXFILE
|
||||||
|
)
|
||||||
|
state = os.path.join(
|
||||||
|
paths.IPA_CLIENT_SYSRESTORE, SYSRESTORE_STATEFILE
|
||||||
|
)
|
||||||
|
for filepath in (index, state):
|
||||||
|
try:
|
||||||
|
self.clients[0].get_file_contents(filepath)
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
pytest.fail("The client file %s was not removed" % filepath)
|
||||||
|
|
||||||
|
|
||||||
class TestClientInstallBind(IntegrationTest):
|
class TestClientInstallBind(IntegrationTest):
|
||||||
|
|||||||
Reference in New Issue
Block a user