URL: https://github.com/freeipa/freeipa/pull/4000 Author: mrizwan93 Title: #4000: ipatests: Test if ipa-backup throws error if /var/lib/ipa/ runs out of space Action: opened
PR body: """ ipa-backup throws error when /var/lib/ipa runs out of space. Earlier the error was not so clear. Fix mentions about insufficient space. related : https://pagure.io/freeipa/issue/7647 """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/4000/head:pr4000 git checkout pr4000
From c61e7996daa2158b2878ef2e04d7976b20d3e0d1 Mon Sep 17 00:00:00 2001 From: Mohammad Rizwan Yusuf <myu...@redhat.com> Date: Mon, 9 Dec 2019 16:59:41 +0530 Subject: [PATCH] Test if ipa-backup throws error if /var/lib/ipa/ runs out of space ipa-backup throws error when /var/lib/ipa runs out of space. Earlier the error was not so clear. Fix mentions about insufficient space. related : https://pagure.io/freeipa/issue/7647 --- .../test_backup_and_restore.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py index a43f8f9e84..202f073800 100644 --- a/ipatests/test_integration/test_backup_and_restore.py +++ b/ipatests/test_integration/test_backup_and_restore.py @@ -282,6 +282,34 @@ def test_full_backup_and_restore_with_selinux_booleans_off(self): assert 'httpd_can_network_connect --> on' in result.stdout_text assert 'httpd_manage_ipa --> on' in result.stdout_text + def test_enough_space_for_backup(self): + """Test if ipa-backup throws error if /var/lib/ipa/ runs out of space + + ipa-backup throws error when /var/lib/ipa runs out of space. Earlier + the error was not so clear. Fix mentions about insufficient space. + related : https://pagure.io/freeipa/issue/7647 + """ + free_space = '' + result = self.master.run_command(['df', '-Ph', '/var/lib/ipa/backup']) + for line in result.stdout_text.split('\n'): + if 'dev' in line: + free_space = line.split(' ')[3] + break + + self.master.run_command(['fallocate', '-l', + free_space, '/var/lib/ipa/backup/temp.img']) + dashed_domain = self.master.domain.realm.replace(".", '-') + ldif_dir = paths.SLAPD_INSTANCE_LDIF_DIR_TEMPLATE % dashed_domain + err_msg = (f"Check if destination directory {ldif_dir}" + " has enough space") + + result = self.master.run_command(['ipa-backup'], raiseonerr=False) + assert result.returncode != 0 + assert err_msg in result.stdout_text + + # cleanup + self.master.run_command(['rm', '-f', '/var/lib/ipa/backup/temp.img']) + class BaseBackupAndRestoreWithDNS(IntegrationTest): """
_______________________________________________ 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://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org