]> err.no Git - util-linux/commitdiff
tests: add libblkid regression tests (images from e2fsprogs)
authorKarel Zak <kzak@redhat.com>
Tue, 20 Jan 2009 22:43:56 +0000 (23:43 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:35:22 +0000 (23:35 +0100)
- adds basic infrastructure for blkid regression tests
- imports test images from e2fsprogs (all tests PASS!:-)

Signed-off-by: Karel Zak <kzak@redhat.com>
37 files changed:
tests/commands.sh.in
tests/expected/blkid/low-probe-cramfs [new file with mode: 0644]
tests/expected/blkid/low-probe-ext2 [new file with mode: 0644]
tests/expected/blkid/low-probe-ext3 [new file with mode: 0644]
tests/expected/blkid/low-probe-fat [new file with mode: 0644]
tests/expected/blkid/low-probe-fat32_label_64MB [new file with mode: 0644]
tests/expected/blkid/low-probe-jbd [new file with mode: 0644]
tests/expected/blkid/low-probe-jfs [new file with mode: 0644]
tests/expected/blkid/low-probe-minix [new file with mode: 0644]
tests/expected/blkid/low-probe-ocfs2 [new file with mode: 0644]
tests/expected/blkid/low-probe-reiser3 [new file with mode: 0644]
tests/expected/blkid/low-probe-reiser4 [new file with mode: 0644]
tests/expected/blkid/low-probe-romfs [new file with mode: 0644]
tests/expected/blkid/low-probe-small-fat32 [new file with mode: 0644]
tests/expected/blkid/low-probe-swap0 [new file with mode: 0644]
tests/expected/blkid/low-probe-swap1 [new file with mode: 0644]
tests/expected/blkid/low-probe-udf [new file with mode: 0644]
tests/expected/blkid/low-probe-xfs [new file with mode: 0644]
tests/expected/blkid/low-probe-zfs [new file with mode: 0644]
tests/ts/blkid/images/cramfs.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/ext2.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/ext3.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/fat.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/fat32_label_64MB.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/jbd.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/jfs.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/minix.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/ocfs2.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/reiser3.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/reiser4.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/romfs.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/small-fat32.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/swap0.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/swap1.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/udf.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images/xfs.img.bz2 [new file with mode: 0644]
tests/ts/blkid/low-probe [new file with mode: 0755]

index 4e95d68509ca22c189c96108a228d3b2468e7240..9c8104a091ee4b3d27858da606c12b65096f3e34 100644 (file)
@@ -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 (file)
index 0000000..09ad018
--- /dev/null
@@ -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 (file)
index 0000000..fa70cf4
--- /dev/null
@@ -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 (file)
index 0000000..43aeeed
--- /dev/null
@@ -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 (file)
index 0000000..3aecdb4
--- /dev/null
@@ -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 (file)
index 0000000..1179490
--- /dev/null
@@ -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 (file)
index 0000000..6c6217d
--- /dev/null
@@ -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 (file)
index 0000000..08f9c1e
--- /dev/null
@@ -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 (file)
index 0000000..9627799
--- /dev/null
@@ -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 (file)
index 0000000..0ee2bdd
--- /dev/null
@@ -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 (file)
index 0000000..8247ac5
--- /dev/null
@@ -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 (file)
index 0000000..83a285c
--- /dev/null
@@ -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 (file)
index 0000000..a33b6f3
--- /dev/null
@@ -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 (file)
index 0000000..2315c4d
--- /dev/null
@@ -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 (file)
index 0000000..bbd9495
--- /dev/null
@@ -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 (file)
index 0000000..537f754
--- /dev/null
@@ -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 (file)
index 0000000..392eac4
--- /dev/null
@@ -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 (file)
index 0000000..9dbaf44
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/tests/ts/blkid/images/cramfs.img.bz2 b/tests/ts/blkid/images/cramfs.img.bz2
new file mode 100644 (file)
index 0000000..d638116
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 (file)
index 0000000..d1811ce
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 (file)
index 0000000..5394598
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 (file)
index 0000000..1fa7f2d
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 (file)
index 0000000..ca76293
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 (file)
index 0000000..f0d7f91
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 (file)
index 0000000..1d4d249
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 (file)
index 0000000..d11f3a8
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 (file)
index 0000000..0bad915
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 (file)
index 0000000..1802bc2
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 (file)
index 0000000..b50d12e
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 (file)
index 0000000..b5e3109
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 (file)
index 0000000..8b90f9c
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 (file)
index 0000000..e61e375
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 (file)
index 0000000..fbab9ed
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 (file)
index 0000000..bd2deb0
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 (file)
index 0000000..cf6982b
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 (executable)
index 0000000..cea84fd
--- /dev/null
@@ -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
+