Skip to content

Commit 3efa47f

Browse files
mvo5achilleas-k
authored andcommitted
test: run df with --all
When df runs it will hide duplicated mountpoints. This can mean that /sysroot is not available in the df output because the underlying disk is also mounted in multiple places. So pass `df --all` to ensure all mountpoints are available for the test to inspect.
1 parent deb1d35 commit 3efa47f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_build_disk.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,16 @@ def assert_fs_customizations(image_type, test_vm):
685685
"""
686686
# check the minsize specified in the build configuration for each mountpoint against the sizes in the image
687687
# TODO: replace 'df' call with 'parted --json' and find the partition size for each mountpoint
688-
exit_status, output = test_vm.run("df --output=target,size", user="root",
688+
exit_status, output = test_vm.run("df --all --output=target,size", user="root",
689689
keyfile=image_type.ssh_keyfile_private_path)
690690
assert exit_status == 0
691691
# parse the output of 'df' to a mountpoint -> size dict for convenience
692692
mountpoint_sizes = {}
693693
for line in output.splitlines()[1:]:
694694
fields = line.split()
695+
# some filesystems to not report a size with --all
696+
if fields[1] == "-":
697+
continue
695698
# Note that df output is in 1k blocks, not bytes
696699
mountpoint_sizes[fields[0]] = int(fields[1]) * 2 ** 10 # in bytes
697700

0 commit comments

Comments
 (0)