summaryrefslogtreecommitdiffstats
path: root/tests/ts/minix
diff options
context:
space:
mode:
authorKarel Zak2015-08-03 12:31:40 +0200
committerKarel Zak2015-08-03 12:31:40 +0200
commit39c795d8b793c7dba0a2eb962c714ab7953cd677 (patch)
tree8ddbac18f59f90649f94768eaa647199e096c476 /tests/ts/minix
parenttests: add fsck.minix checks (diff)
downloadkernel-qcow2-util-linux-39c795d8b793c7dba0a2eb962c714ab7953cd677.tar.gz
kernel-qcow2-util-linux-39c795d8b793c7dba0a2eb962c714ab7953cd677.tar.xz
kernel-qcow2-util-linux-39c795d8b793c7dba0a2eb962c714ab7953cd677.zip
tests: fix minix test
- run the test with UID=0 only. The minix FS inode contains UID and GID, so the final image checksum depends on user... - always use subtest name for the images Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/minix')
-rwxr-xr-xtests/ts/minix/fsck-images14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/ts/minix/fsck-images b/tests/ts/minix/fsck-images
index afd2f9b48..e0b42344b 100755
--- a/tests/ts/minix/fsck-images
+++ b/tests/ts/minix/fsck-images
@@ -18,6 +18,9 @@ TS_DESC="fsck images"
. $TS_TOPDIR/functions.sh
ts_init "$*"
+# inode contains UID and GID, use always UID=0 to get the same checksum
+ts_skip_nonroot
+
ts_check_test_command "$TS_CMD_FSCKMINIX"
ts_check_test_command "$TS_HELPER_MKFS_MINIX"
@@ -25,13 +28,14 @@ export MKFS_MINIX_TEST_SECOND_SINCE_EPOCH='1438460212'
check_minix_fs_type() {
ts_init_subtest $1
- dd if=/dev/zero bs=1024 count=16 of=$TS_OUTDIR/$1 >/dev/null 2>&1
- $TS_HELPER_MKFS_MINIX $2 $TS_OUTDIR/$1 >> $TS_OUTPUT 2>&1
+ img=${TS_OUTPUT}.img
+ dd if=/dev/zero bs=1024 count=16 of=$img >/dev/null 2>&1
+ $TS_HELPER_MKFS_MINIX $2 $img >> $TS_OUTPUT 2>&1
echo "mkfs return value: $?" >> $TS_OUTPUT
- $TS_CMD_FSCKMINIX $TS_OUTDIR/$1 >> $TS_OUTPUT 2>&1
+ $TS_CMD_FSCKMINIX $img >> $TS_OUTPUT 2>&1
echo "fsck return value: $?" >> $TS_OUTPUT
- md5sum $TS_OUTDIR/$1 | awk '{print $1}' >> $TS_OUTPUT 2>&1
- rm -f $TS_OUTDIR/$1
+ md5sum $img | awk '{print $1}' >> $TS_OUTPUT 2>&1
+ rm -f $img
ts_finalize_subtest
}