From 6ebfbda203e22973ca3be16ba03df64502bc4894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Tue, 19 Jan 2021 15:25:44 +0100 Subject: [PATCH] ipatests: test_ipahealthcheck: fix units MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit df uses 1024 bytes as its default display value, but this can be tweaked by environment variables or a CLI knob. Force the output unit to 1024 bytes using the CLI and parse it accordingly. Fixes: https://pagure.io/freeipa/issue/8674 Signed-off-by: François Cami Reviewed-By: Florence Blanc-Renaud --- ipatests/test_integration/test_ipahealthcheck.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py index cc9c909ad..6870071cd 100644 --- a/ipatests/test_integration/test_ipahealthcheck.py +++ b/ipatests/test_integration/test_ipahealthcheck.py @@ -1957,8 +1957,10 @@ class TestIpaHealthCheckFilesystemSpace(IntegrationTest): path = os.path.join('/tmp', str(uuid.uuid4())) # CI has a single big disk so we may end up allocating most of it. - result = self.master.run_command(['df', '--output=avail', '/tmp']) - free = (int(result.stdout_text.split('\n')[1]) // 1000) - 50 + result = self.master.run_command( + ['df', '--block-size=1024', '--output=avail', '/tmp'] + ) + free = (int(result.stdout_text.split('\n')[1]) // 1024) - 50 self.master.run_command(['fallocate', '-l', '%dMiB' % free, path]) yield