From: Karel Zak Date: Tue, 20 Jan 2009 22:43:56 +0000 (+0100) Subject: tests: add libblkid regression tests (images from e2fsprogs) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8df5195f1a190e5ce63af261937eafe5efeca2d5;p=util-linux 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 --- diff --git a/tests/commands.sh.in b/tests/commands.sh.in index 4e95d685..9c8104a0 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 00000000..09ad018c --- /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 00000000..fa70cf4f --- /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 00000000..43aeeeda --- /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 00000000..3aecdb45 --- /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 00000000..1179490c --- /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 00000000..6c6217d0 --- /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 00000000..08f9c1e6 --- /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 00000000..9627799a --- /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 00000000..0ee2bdd0 --- /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 00000000..8247ac54 --- /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 00000000..83a285cd --- /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 00000000..a33b6f3d --- /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 00000000..2315c4d5 --- /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 00000000..bbd94951 --- /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 00000000..537f754d --- /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 00000000..392eac4f --- /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 00000000..9dbaf445 --- /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 00000000..e69de29b diff --git a/tests/ts/blkid/images/cramfs.img.bz2 b/tests/ts/blkid/images/cramfs.img.bz2 new file mode 100644 index 00000000..d6381168 Binary files /dev/null and b/tests/ts/blkid/images/cramfs.img.bz2 differ diff --git a/tests/ts/blkid/images/ext2.img.bz2 b/tests/ts/blkid/images/ext2.img.bz2 new file mode 100644 index 00000000..d1811ce3 Binary files /dev/null and b/tests/ts/blkid/images/ext2.img.bz2 differ diff --git a/tests/ts/blkid/images/ext3.img.bz2 b/tests/ts/blkid/images/ext3.img.bz2 new file mode 100644 index 00000000..53945986 Binary files /dev/null and b/tests/ts/blkid/images/ext3.img.bz2 differ diff --git a/tests/ts/blkid/images/fat.img.bz2 b/tests/ts/blkid/images/fat.img.bz2 new file mode 100644 index 00000000..1fa7f2d9 Binary files /dev/null and b/tests/ts/blkid/images/fat.img.bz2 differ diff --git a/tests/ts/blkid/images/fat32_label_64MB.img.bz2 b/tests/ts/blkid/images/fat32_label_64MB.img.bz2 new file mode 100644 index 00000000..ca762938 Binary files /dev/null and b/tests/ts/blkid/images/fat32_label_64MB.img.bz2 differ diff --git a/tests/ts/blkid/images/jbd.img.bz2 b/tests/ts/blkid/images/jbd.img.bz2 new file mode 100644 index 00000000..f0d7f918 Binary files /dev/null and b/tests/ts/blkid/images/jbd.img.bz2 differ diff --git a/tests/ts/blkid/images/jfs.img.bz2 b/tests/ts/blkid/images/jfs.img.bz2 new file mode 100644 index 00000000..1d4d249e Binary files /dev/null and b/tests/ts/blkid/images/jfs.img.bz2 differ diff --git a/tests/ts/blkid/images/minix.img.bz2 b/tests/ts/blkid/images/minix.img.bz2 new file mode 100644 index 00000000..d11f3a88 Binary files /dev/null and b/tests/ts/blkid/images/minix.img.bz2 differ diff --git a/tests/ts/blkid/images/ocfs2.img.bz2 b/tests/ts/blkid/images/ocfs2.img.bz2 new file mode 100644 index 00000000..0bad915f Binary files /dev/null and b/tests/ts/blkid/images/ocfs2.img.bz2 differ diff --git a/tests/ts/blkid/images/reiser3.img.bz2 b/tests/ts/blkid/images/reiser3.img.bz2 new file mode 100644 index 00000000..1802bc21 Binary files /dev/null and b/tests/ts/blkid/images/reiser3.img.bz2 differ diff --git a/tests/ts/blkid/images/reiser4.img.bz2 b/tests/ts/blkid/images/reiser4.img.bz2 new file mode 100644 index 00000000..b50d12e4 Binary files /dev/null and b/tests/ts/blkid/images/reiser4.img.bz2 differ diff --git a/tests/ts/blkid/images/romfs.img.bz2 b/tests/ts/blkid/images/romfs.img.bz2 new file mode 100644 index 00000000..b5e31099 Binary files /dev/null and b/tests/ts/blkid/images/romfs.img.bz2 differ diff --git a/tests/ts/blkid/images/small-fat32.img.bz2 b/tests/ts/blkid/images/small-fat32.img.bz2 new file mode 100644 index 00000000..8b90f9c3 Binary files /dev/null and b/tests/ts/blkid/images/small-fat32.img.bz2 differ diff --git a/tests/ts/blkid/images/swap0.img.bz2 b/tests/ts/blkid/images/swap0.img.bz2 new file mode 100644 index 00000000..e61e375b Binary files /dev/null and b/tests/ts/blkid/images/swap0.img.bz2 differ diff --git a/tests/ts/blkid/images/swap1.img.bz2 b/tests/ts/blkid/images/swap1.img.bz2 new file mode 100644 index 00000000..fbab9edb Binary files /dev/null and b/tests/ts/blkid/images/swap1.img.bz2 differ diff --git a/tests/ts/blkid/images/udf.img.bz2 b/tests/ts/blkid/images/udf.img.bz2 new file mode 100644 index 00000000..bd2deb0a Binary files /dev/null and b/tests/ts/blkid/images/udf.img.bz2 differ diff --git a/tests/ts/blkid/images/xfs.img.bz2 b/tests/ts/blkid/images/xfs.img.bz2 new file mode 100644 index 00000000..cf6982b4 Binary files /dev/null and b/tests/ts/blkid/images/xfs.img.bz2 differ diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe new file mode 100755 index 00000000..cea84fdf --- /dev/null +++ b/tests/ts/blkid/low-probe @@ -0,0 +1,40 @@ +#!/bin/bash + +# +# Copyright (C) 2009 Karel Zak +# +# 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 +