diff options
author | Karel Zak | 2009-01-20 23:43:56 +0100 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:35:22 +0100 |
commit | 8df5195f1a190e5ce63af261937eafe5efeca2d5 (patch) | |
tree | 3a97bf2c44b68d64966ba99e24dec8ea9dc23ed7 /tests | |
parent | tests: fix the final message for subtests (diff) | |
download | kernel-qcow2-util-linux-8df5195f1a190e5ce63af261937eafe5efeca2d5.tar.gz kernel-qcow2-util-linux-8df5195f1a190e5ce63af261937eafe5efeca2d5.tar.xz kernel-qcow2-util-linux-8df5195f1a190e5ce63af261937eafe5efeca2d5.zip |
tests: add libblkid regression tests (images from e2fsprogs)
- adds basic infrastructure for blkid regression tests
- imports test images from e2fsprogs (all tests PASS!:-)
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
37 files changed, 138 insertions, 0 deletions
diff --git a/tests/commands.sh.in b/tests/commands.sh.in index 4e95d6850..9c8104a09 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -43,5 +43,6 @@ TS_CMD_ISLOCAL=${TS_CMD_ISLOCAL-"$TOPDIR/login-utils/islocal_test"} TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$TOPDIR/hwclock/hwclock"} TS_CMD_LSCPU=${TS_CMD_LSCPU-"$TOPDIR/sys-utils/lscpu"} +TS_CMD_BLKID=${TS_CMD_BLKID-"$TOPDIR/libs/blkid/bin/blkid.sh"} diff --git a/tests/expected/blkid/low-probe-cramfs b/tests/expected/blkid/low-probe-cramfs new file mode 100644 index 000000000..09ad018c0 --- /dev/null +++ b/tests/expected/blkid/low-probe-cramfs @@ -0,0 +1,4 @@ +ID_FS_LABEL_ENC=test-cram +ID_FS_LABEL=test-cram +ID_FS_TYPE=cramfs +ID_FS_USAGE=filesystem diff --git a/tests/expected/blkid/low-probe-ext2 b/tests/expected/blkid/low-probe-ext2 new file mode 100644 index 000000000..fa70cf4f0 --- /dev/null +++ b/tests/expected/blkid/low-probe-ext2 @@ -0,0 +1,7 @@ +ID_FS_LABEL_ENC=test-ext2 +ID_FS_LABEL=test-ext2 +ID_FS_TYPE=ext2 +ID_FS_USAGE=filesystem +ID_FS_UUID=22f0eac3-5c89-4ec1-9076-60799119aaea +ID_FS_UUID_ENC=22f0eac3-5c89-4ec1-9076-60799119aaea +ID_FS_VERSION=1.0 diff --git a/tests/expected/blkid/low-probe-ext3 b/tests/expected/blkid/low-probe-ext3 new file mode 100644 index 000000000..43aeeedaa --- /dev/null +++ b/tests/expected/blkid/low-probe-ext3 @@ -0,0 +1,8 @@ +ID_FS_LABEL_ENC=test-ext3 +ID_FS_LABEL=test-ext3 +ID_FS_SEC_TYPE=ext2 +ID_FS_TYPE=ext3 +ID_FS_USAGE=filesystem +ID_FS_UUID=35f66dab-477e-4090-a872-95ee0e493ad6 +ID_FS_UUID_ENC=35f66dab-477e-4090-a872-95ee0e493ad6 +ID_FS_VERSION=1.0 diff --git a/tests/expected/blkid/low-probe-fat b/tests/expected/blkid/low-probe-fat new file mode 100644 index 000000000..3aecdb45e --- /dev/null +++ b/tests/expected/blkid/low-probe-fat @@ -0,0 +1,8 @@ +ID_FS_LABEL_ENC=TEST-FAT +ID_FS_LABEL=TEST-FAT +ID_FS_SEC_TYPE=msdos +ID_FS_TYPE=vfat +ID_FS_USAGE=filesystem +ID_FS_UUID=DEAD-BEEF +ID_FS_UUID_ENC=DEAD-BEEF +ID_FS_VERSION=FAT12 diff --git a/tests/expected/blkid/low-probe-fat32_label_64MB b/tests/expected/blkid/low-probe-fat32_label_64MB new file mode 100644 index 000000000..1179490cf --- /dev/null +++ b/tests/expected/blkid/low-probe-fat32_label_64MB @@ -0,0 +1,7 @@ +ID_FS_LABEL=BINGO +ID_FS_LABEL_ENC=BINGO +ID_FS_TYPE=vfat +ID_FS_USAGE=filesystem +ID_FS_UUID=8CB5-BA49 +ID_FS_UUID_ENC=8CB5-BA49 +ID_FS_VERSION=FAT32 diff --git a/tests/expected/blkid/low-probe-jbd b/tests/expected/blkid/low-probe-jbd new file mode 100644 index 000000000..6c6217d03 --- /dev/null +++ b/tests/expected/blkid/low-probe-jbd @@ -0,0 +1,5 @@ +ID_FS_TYPE=jbd +ID_FS_USAGE=other +ID_FS_UUID=0d7a07df-7b06-4829-bce7-3b9c3ece570c +ID_FS_UUID_ENC=0d7a07df-7b06-4829-bce7-3b9c3ece570c +ID_FS_VERSION=1.0 diff --git a/tests/expected/blkid/low-probe-jfs b/tests/expected/blkid/low-probe-jfs new file mode 100644 index 000000000..08f9c1e6c --- /dev/null +++ b/tests/expected/blkid/low-probe-jfs @@ -0,0 +1,6 @@ +ID_FS_LABEL_ENC=test-jfs +ID_FS_LABEL=test-jfs +ID_FS_TYPE=jfs +ID_FS_USAGE=filesystem +ID_FS_UUID=9bf7b82e-7583-4c74-99a4-189a691f27b5 +ID_FS_UUID_ENC=9bf7b82e-7583-4c74-99a4-189a691f27b5 diff --git a/tests/expected/blkid/low-probe-minix b/tests/expected/blkid/low-probe-minix new file mode 100644 index 000000000..9627799a3 --- /dev/null +++ b/tests/expected/blkid/low-probe-minix @@ -0,0 +1,3 @@ +ID_FS_TYPE=minix +ID_FS_USAGE=filesystem +ID_FS_VERSION=1 diff --git a/tests/expected/blkid/low-probe-ocfs2 b/tests/expected/blkid/low-probe-ocfs2 new file mode 100644 index 000000000..0ee2bdd0e --- /dev/null +++ b/tests/expected/blkid/low-probe-ocfs2 @@ -0,0 +1,6 @@ +ID_FS_LABEL_ENC=test-ocfs2 +ID_FS_LABEL=test-ocfs2 +ID_FS_TYPE=ocfs2 +ID_FS_USAGE=filesystem +ID_FS_UUID=6b6bfbea-3a79-4f0c-b166-a20776102445 +ID_FS_UUID_ENC=6b6bfbea-3a79-4f0c-b166-a20776102445 diff --git a/tests/expected/blkid/low-probe-reiser3 b/tests/expected/blkid/low-probe-reiser3 new file mode 100644 index 000000000..8247ac541 --- /dev/null +++ b/tests/expected/blkid/low-probe-reiser3 @@ -0,0 +1,6 @@ +ID_FS_LABEL_ENC=TESTREISER +ID_FS_LABEL=TESTREISER +ID_FS_TYPE=reiser +ID_FS_USAGE=filesystem +ID_FS_UUID=9efe7863-b124-46dc-ad68-8ecd04230a7b +ID_FS_UUID_ENC=9efe7863-b124-46dc-ad68-8ecd04230a7b diff --git a/tests/expected/blkid/low-probe-reiser4 b/tests/expected/blkid/low-probe-reiser4 new file mode 100644 index 000000000..83a285cd2 --- /dev/null +++ b/tests/expected/blkid/low-probe-reiser4 @@ -0,0 +1,6 @@ +ID_FS_LABEL_ENC=TESTR4 +ID_FS_LABEL=TESTR4 +ID_FS_TYPE=reiser4 +ID_FS_USAGE=filesystem +ID_FS_UUID=9722633c-d69a-4881-b1c8-bedecbbf39d2 +ID_FS_UUID_ENC=9722633c-d69a-4881-b1c8-bedecbbf39d2 diff --git a/tests/expected/blkid/low-probe-romfs b/tests/expected/blkid/low-probe-romfs new file mode 100644 index 000000000..a33b6f3d3 --- /dev/null +++ b/tests/expected/blkid/low-probe-romfs @@ -0,0 +1,4 @@ +ID_FS_LABEL_ENC=test-romfs +ID_FS_LABEL=test-romfs +ID_FS_TYPE=romfs +ID_FS_USAGE=filesystem diff --git a/tests/expected/blkid/low-probe-small-fat32 b/tests/expected/blkid/low-probe-small-fat32 new file mode 100644 index 000000000..2315c4d54 --- /dev/null +++ b/tests/expected/blkid/low-probe-small-fat32 @@ -0,0 +1,7 @@ +ID_FS_LABEL_ENC=TESTVFAT +ID_FS_LABEL=TESTVFAT +ID_FS_TYPE=vfat +ID_FS_USAGE=filesystem +ID_FS_UUID=1423-AAE1 +ID_FS_UUID_ENC=1423-AAE1 +ID_FS_VERSION=FAT32 diff --git a/tests/expected/blkid/low-probe-swap0 b/tests/expected/blkid/low-probe-swap0 new file mode 100644 index 000000000..bbd949517 --- /dev/null +++ b/tests/expected/blkid/low-probe-swap0 @@ -0,0 +1,3 @@ +ID_FS_TYPE=swap +ID_FS_USAGE=other +ID_FS_VERSION=1 diff --git a/tests/expected/blkid/low-probe-swap1 b/tests/expected/blkid/low-probe-swap1 new file mode 100644 index 000000000..537f754d7 --- /dev/null +++ b/tests/expected/blkid/low-probe-swap1 @@ -0,0 +1,7 @@ +ID_FS_LABEL_ENC=SWAP-TEST +ID_FS_LABEL=SWAP-TEST +ID_FS_TYPE=swap +ID_FS_USAGE=other +ID_FS_UUID=8ff8e77f-8553-485e-8656-58be67a81666 +ID_FS_UUID_ENC=8ff8e77f-8553-485e-8656-58be67a81666 +ID_FS_VERSION=2 diff --git a/tests/expected/blkid/low-probe-udf b/tests/expected/blkid/low-probe-udf new file mode 100644 index 000000000..392eac4f2 --- /dev/null +++ b/tests/expected/blkid/low-probe-udf @@ -0,0 +1,4 @@ +ID_FS_LABEL_ENC=test-udf +ID_FS_LABEL=test-udf +ID_FS_TYPE=udf +ID_FS_USAGE=filesystem diff --git a/tests/expected/blkid/low-probe-xfs b/tests/expected/blkid/low-probe-xfs new file mode 100644 index 000000000..9dbaf445f --- /dev/null +++ b/tests/expected/blkid/low-probe-xfs @@ -0,0 +1,6 @@ +ID_FS_LABEL_ENC=test-xfs +ID_FS_LABEL=test-xfs +ID_FS_TYPE=xfs +ID_FS_USAGE=filesystem +ID_FS_UUID=8c8a0a5a-9f57-492e-9610-45a61f38f58a +ID_FS_UUID_ENC=8c8a0a5a-9f57-492e-9610-45a61f38f58a diff --git a/tests/expected/blkid/low-probe-zfs b/tests/expected/blkid/low-probe-zfs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/expected/blkid/low-probe-zfs diff --git a/tests/ts/blkid/images/cramfs.img.bz2 b/tests/ts/blkid/images/cramfs.img.bz2 Binary files differnew file mode 100644 index 000000000..d6381168f --- /dev/null +++ b/tests/ts/blkid/images/cramfs.img.bz2 diff --git a/tests/ts/blkid/images/ext2.img.bz2 b/tests/ts/blkid/images/ext2.img.bz2 Binary files differnew file mode 100644 index 000000000..d1811ce3d --- /dev/null +++ b/tests/ts/blkid/images/ext2.img.bz2 diff --git a/tests/ts/blkid/images/ext3.img.bz2 b/tests/ts/blkid/images/ext3.img.bz2 Binary files differnew file mode 100644 index 000000000..539459869 --- /dev/null +++ b/tests/ts/blkid/images/ext3.img.bz2 diff --git a/tests/ts/blkid/images/fat.img.bz2 b/tests/ts/blkid/images/fat.img.bz2 Binary files differnew file mode 100644 index 000000000..1fa7f2d9f --- /dev/null +++ b/tests/ts/blkid/images/fat.img.bz2 diff --git a/tests/ts/blkid/images/fat32_label_64MB.img.bz2 b/tests/ts/blkid/images/fat32_label_64MB.img.bz2 Binary files differnew file mode 100644 index 000000000..ca7629380 --- /dev/null +++ b/tests/ts/blkid/images/fat32_label_64MB.img.bz2 diff --git a/tests/ts/blkid/images/jbd.img.bz2 b/tests/ts/blkid/images/jbd.img.bz2 Binary files differnew file mode 100644 index 000000000..f0d7f9188 --- /dev/null +++ b/tests/ts/blkid/images/jbd.img.bz2 diff --git a/tests/ts/blkid/images/jfs.img.bz2 b/tests/ts/blkid/images/jfs.img.bz2 Binary files differnew file mode 100644 index 000000000..1d4d249eb --- /dev/null +++ b/tests/ts/blkid/images/jfs.img.bz2 diff --git a/tests/ts/blkid/images/minix.img.bz2 b/tests/ts/blkid/images/minix.img.bz2 Binary files differnew file mode 100644 index 000000000..d11f3a88b --- /dev/null +++ b/tests/ts/blkid/images/minix.img.bz2 diff --git a/tests/ts/blkid/images/ocfs2.img.bz2 b/tests/ts/blkid/images/ocfs2.img.bz2 Binary files differnew file mode 100644 index 000000000..0bad915f6 --- /dev/null +++ b/tests/ts/blkid/images/ocfs2.img.bz2 diff --git a/tests/ts/blkid/images/reiser3.img.bz2 b/tests/ts/blkid/images/reiser3.img.bz2 Binary files differnew file mode 100644 index 000000000..1802bc213 --- /dev/null +++ b/tests/ts/blkid/images/reiser3.img.bz2 diff --git a/tests/ts/blkid/images/reiser4.img.bz2 b/tests/ts/blkid/images/reiser4.img.bz2 Binary files differnew file mode 100644 index 000000000..b50d12e45 --- /dev/null +++ b/tests/ts/blkid/images/reiser4.img.bz2 diff --git a/tests/ts/blkid/images/romfs.img.bz2 b/tests/ts/blkid/images/romfs.img.bz2 Binary files differnew file mode 100644 index 000000000..b5e310998 --- /dev/null +++ b/tests/ts/blkid/images/romfs.img.bz2 diff --git a/tests/ts/blkid/images/small-fat32.img.bz2 b/tests/ts/blkid/images/small-fat32.img.bz2 Binary files differnew file mode 100644 index 000000000..8b90f9c3c --- /dev/null +++ b/tests/ts/blkid/images/small-fat32.img.bz2 diff --git a/tests/ts/blkid/images/swap0.img.bz2 b/tests/ts/blkid/images/swap0.img.bz2 Binary files differnew file mode 100644 index 000000000..e61e375b9 --- /dev/null +++ b/tests/ts/blkid/images/swap0.img.bz2 diff --git a/tests/ts/blkid/images/swap1.img.bz2 b/tests/ts/blkid/images/swap1.img.bz2 Binary files differnew file mode 100644 index 000000000..fbab9edb2 --- /dev/null +++ b/tests/ts/blkid/images/swap1.img.bz2 diff --git a/tests/ts/blkid/images/udf.img.bz2 b/tests/ts/blkid/images/udf.img.bz2 Binary files differnew file mode 100644 index 000000000..bd2deb0af --- /dev/null +++ b/tests/ts/blkid/images/udf.img.bz2 diff --git a/tests/ts/blkid/images/xfs.img.bz2 b/tests/ts/blkid/images/xfs.img.bz2 Binary files differnew file mode 100644 index 000000000..cf6982b4a --- /dev/null +++ b/tests/ts/blkid/images/xfs.img.bz2 diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe new file mode 100755 index 000000000..cea84fdf0 --- /dev/null +++ b/tests/ts/blkid/low-probe @@ -0,0 +1,40 @@ +#!/bin/bash + +# +# Copyright (C) 2009 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux-ng. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="low-probe" + +. $TS_TOPDIR/functions.sh + +ts_init "$*" +mkdir -p $TS_OUTDIR/images + +for img in $(ls $TS_SELF/images/*.img.bz2 | sort); do + name=$(basename $img .img.bz2) + outimg=$TS_OUTDIR/images/${name}.img + + ts_init_subtest $name + + bunzip2 < $img > $outimg + + $TS_CMD_BLKID -p -o udev $outimg | sort > $TS_OUTPUT 2>&1 + ts_finalize_subtest +done + +ts_finalize + |