Test that ccaches are cleaned up during installation

Create a random file and directory in the ccaches directory
prior to installation then confirm that they were removed.

https://pagure.io/freeipa/issue/8248

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Rob Crittenden
2020-09-23 14:48:29 +02:00
committed by Christian Heimes
parent cc5d9a8c9d
commit 9f9dcfe88a
@@ -239,8 +239,23 @@ class TestInstallCA(IntegrationTest):
@classmethod
def install(cls, mh):
cls.master.put_file_contents(
os.path.join(paths.IPA_CCACHES, 'foo'),
'somerandomstring'
)
cls.master.run_command(
['mkdir', os.path.join(paths.IPA_CCACHES, 'bar')]
)
tasks.install_master(cls.master, setup_dns=False)
def test_ccaches_cleanup(self):
"""
The IPA ccaches directory is cleaned up on install. Verify
that the file we created is now gone.
"""
assert os.path.exists(os.path.join(paths.IPA_CCACHES, 'foo')) is False
assert os.path.exists(os.path.join(paths.IPA_CCACHES, 'bar')) is False
def test_replica_ca_install_with_no_host_dns(self):
"""
Test for ipa-ca-install --no-host-dns on a replica