mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: test_ipahealthcheck: fix units
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 <fcami@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
8021a2066d
commit
6ebfbda203
@@ -1957,8 +1957,10 @@ class TestIpaHealthCheckFilesystemSpace(IntegrationTest):
|
|||||||
|
|
||||||
path = os.path.join('/tmp', str(uuid.uuid4()))
|
path = os.path.join('/tmp', str(uuid.uuid4()))
|
||||||
# CI has a single big disk so we may end up allocating most of it.
|
# CI has a single big disk so we may end up allocating most of it.
|
||||||
result = self.master.run_command(['df', '--output=avail', '/tmp'])
|
result = self.master.run_command(
|
||||||
free = (int(result.stdout_text.split('\n')[1]) // 1000) - 50
|
['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])
|
self.master.run_command(['fallocate', '-l', '%dMiB' % free, path])
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|||||||
Reference in New Issue
Block a user