]> err.no Git - util-linux/commitdiff
tests: add partitions probing test
authorKarel Zak <kzak@redhat.com>
Fri, 11 Sep 2009 11:15:18 +0000 (13:15 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Sep 2009 19:54:10 +0000 (21:54 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
13 files changed:
tests/commands.sh.in
tests/expected/blkid/lowprobe-pt-bsd [new file with mode: 0644]
tests/expected/blkid/lowprobe-pt-dos+bsd [new file with mode: 0644]
tests/expected/blkid/lowprobe-pt-gpt [new file with mode: 0644]
tests/expected/blkid/lowprobe-pt-sgi [new file with mode: 0644]
tests/expected/blkid/lowprobe-pt-sun [new file with mode: 0644]
tests/ts/blkid/images-pt/bsd.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images-pt/dos+bsd.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images-pt/gpt.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images-pt/sgi.img.bz2 [new file with mode: 0644]
tests/ts/blkid/images-pt/sun.img.bz2 [new file with mode: 0644]
tests/ts/blkid/low-probe
tests/ts/blkid/lowprobe-pt [new file with mode: 0755]

index f9eeec144a1af19d866188568948419d43245f80..55585e7b6d047c81ca0968628e12171948b9e64a 100644 (file)
@@ -11,6 +11,9 @@ TS_HELPER_MD5="$TS_TOPDIR/helpers/test_md5"
 
 TS_HELPER_ISMOUNTED="$TOPDIR/lib/test_ismounted"
 
+# TODO: use partx
+TS_HELPER_PARTITIONS="$TOPDIR/shlibs/blkid/samples/partitions"
+
 # external commands
 TS_ECMD_BLKID="@BLKID@"
 TS_ECMD_VOLID="@VOLID@"
diff --git a/tests/expected/blkid/lowprobe-pt-bsd b/tests/expected/blkid/lowprobe-pt-bsd
new file mode 100644 (file)
index 0000000..40e52a2
--- /dev/null
@@ -0,0 +1,4 @@
+size: 4456448, sector size: 512, PT: bsd, offset: 512
+---
+#1:       7936       4864  0x7
+#2:      12544       3584  0x7
diff --git a/tests/expected/blkid/lowprobe-pt-dos+bsd b/tests/expected/blkid/lowprobe-pt-dos+bsd
new file mode 100644 (file)
index 0000000..6585686
--- /dev/null
@@ -0,0 +1,6 @@
+size: 8388608, sector size: 512, PT: dos, offset: 446
+---
+#1:         32       7648  0x83
+#2:       7680       8704  0xa5
+#5:       7936       4864  0x7 (freebsd)
+#6:      12544       3584  0x7 (freebsd)
diff --git a/tests/expected/blkid/lowprobe-pt-gpt b/tests/expected/blkid/lowprobe-pt-gpt
new file mode 100644 (file)
index 0000000..e9be134
--- /dev/null
@@ -0,0 +1,7 @@
+size: 10485760, sector size: 512, PT: gpt, offset: 512
+---
+#1:         34       2013  0x0 name='ThisIsName' uuid='bc10cf1d-7e63-524c-8203-087ae10a820b'
+#2:       2048       2047  0x0 name='ThisIsOtherName' uuid='963ad0a1-3872-c646-bbb3-789cbe173ec7'
+#3:       4096       2047  0x0 name='primary' uuid='6c1b10a7-8c46-df47-aff6-cd444d12af61'
+#4:       6144       2047  0x0 name='primary' uuid='0a95c4af-f1f0-dd4a-802c-5957133486d1'
+#5:       8192       2047  0x0 name='primary' uuid='87a7b00d-6bc1-8648-af3a-fbb97299677c'
diff --git a/tests/expected/blkid/lowprobe-pt-sgi b/tests/expected/blkid/lowprobe-pt-sgi
new file mode 100644 (file)
index 0000000..22bc7b4
--- /dev/null
@@ -0,0 +1,4 @@
+size: 10485760, sector size: 512, PT: sgi, offset: 0
+---
+#1:         63    1606437  0x83
+#2:    1606500   30523500  0x83
diff --git a/tests/expected/blkid/lowprobe-pt-sun b/tests/expected/blkid/lowprobe-pt-sun
new file mode 100644 (file)
index 0000000..54cb561
--- /dev/null
@@ -0,0 +1,4 @@
+size: 10485760, sector size: 512, PT: sun, offset: 0
+---
+#1:          0      87380  0x83
+#2:      87380      43690  0x82
diff --git a/tests/ts/blkid/images-pt/bsd.img.bz2 b/tests/ts/blkid/images-pt/bsd.img.bz2
new file mode 100644 (file)
index 0000000..c4b05e4
Binary files /dev/null and b/tests/ts/blkid/images-pt/bsd.img.bz2 differ
diff --git a/tests/ts/blkid/images-pt/dos+bsd.img.bz2 b/tests/ts/blkid/images-pt/dos+bsd.img.bz2
new file mode 100644 (file)
index 0000000..cccdd8a
Binary files /dev/null and b/tests/ts/blkid/images-pt/dos+bsd.img.bz2 differ
diff --git a/tests/ts/blkid/images-pt/gpt.img.bz2 b/tests/ts/blkid/images-pt/gpt.img.bz2
new file mode 100644 (file)
index 0000000..df4de7c
Binary files /dev/null and b/tests/ts/blkid/images-pt/gpt.img.bz2 differ
diff --git a/tests/ts/blkid/images-pt/sgi.img.bz2 b/tests/ts/blkid/images-pt/sgi.img.bz2
new file mode 100644 (file)
index 0000000..3b1c313
Binary files /dev/null and b/tests/ts/blkid/images-pt/sgi.img.bz2 differ
diff --git a/tests/ts/blkid/images-pt/sun.img.bz2 b/tests/ts/blkid/images-pt/sun.img.bz2
new file mode 100644 (file)
index 0000000..adf4f02
Binary files /dev/null and b/tests/ts/blkid/images-pt/sun.img.bz2 differ
index 1dfcbed4f430058139007975e71965868c9ee8d8..ff21b3b7522d4503b6fc7b5166005f384424f0c8 100755 (executable)
@@ -17,7 +17,7 @@
 #
 
 TS_TOPDIR="$(dirname $0)/../.."
-TS_DESC="low-level probing"
+TS_DESC="low-level superblocks probing"
 
 . $TS_TOPDIR/functions.sh
 
@@ -27,9 +27,6 @@ if [ ! -x "$TS_CMD_BLKID" ]; then
        ts_skip "blkid disabled"
 fi
 
-#
-# Superblocks
-#
 mkdir -p $TS_OUTDIR/images-fs
 
 for img in $(ls $TS_SELF/images-fs/*.img.bz2 | sort); do
diff --git a/tests/ts/blkid/lowprobe-pt b/tests/ts/blkid/lowprobe-pt
new file mode 100755 (executable)
index 0000000..311def6
--- /dev/null
@@ -0,0 +1,45 @@
+#!/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="partitions probing"
+
+. $TS_TOPDIR/functions.sh
+
+ts_init "$*"
+
+if [ ! -x "$TS_HELPER_PARTITIONS" ]; then
+       ts_skip "blkid disabled"
+fi
+
+mkdir -p $TS_OUTDIR/images-pt
+
+for img in $(ls $TS_SELF/images-pt/*.img.bz2 | sort); do
+       name=$(basename $img .img.bz2)
+       outimg=$TS_OUTDIR/images-pt/${name}.img
+
+       ts_init_subtest $name
+
+       bunzip2 < $img > $outimg
+
+       $TS_HELPER_PARTITIONS $outimg &> $TS_OUTPUT
+       ts_finalize_subtest
+done
+
+ts_finalize
+