From 5777ba99a3b3d24ab20412828de5726c1b9daaeb Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 11 Sep 2009 13:15:18 +0200 Subject: [PATCH] tests: add partitions probing test Signed-off-by: Karel Zak --- tests/commands.sh.in | 3 ++ tests/expected/blkid/lowprobe-pt-bsd | 4 ++ tests/expected/blkid/lowprobe-pt-dos+bsd | 6 +++ tests/expected/blkid/lowprobe-pt-gpt | 7 ++++ tests/expected/blkid/lowprobe-pt-sgi | 4 ++ tests/expected/blkid/lowprobe-pt-sun | 4 ++ tests/ts/blkid/images-pt/bsd.img.bz2 | Bin 0 -> 122 bytes tests/ts/blkid/images-pt/dos+bsd.img.bz2 | Bin 0 -> 1728 bytes tests/ts/blkid/images-pt/gpt.img.bz2 | Bin 0 -> 494 bytes tests/ts/blkid/images-pt/sgi.img.bz2 | Bin 0 -> 144 bytes tests/ts/blkid/images-pt/sun.img.bz2 | Bin 0 -> 170 bytes tests/ts/blkid/low-probe | 5 +-- tests/ts/blkid/lowprobe-pt | 45 +++++++++++++++++++++++ 13 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 tests/expected/blkid/lowprobe-pt-bsd create mode 100644 tests/expected/blkid/lowprobe-pt-dos+bsd create mode 100644 tests/expected/blkid/lowprobe-pt-gpt create mode 100644 tests/expected/blkid/lowprobe-pt-sgi create mode 100644 tests/expected/blkid/lowprobe-pt-sun create mode 100644 tests/ts/blkid/images-pt/bsd.img.bz2 create mode 100644 tests/ts/blkid/images-pt/dos+bsd.img.bz2 create mode 100644 tests/ts/blkid/images-pt/gpt.img.bz2 create mode 100644 tests/ts/blkid/images-pt/sgi.img.bz2 create mode 100644 tests/ts/blkid/images-pt/sun.img.bz2 create mode 100755 tests/ts/blkid/lowprobe-pt diff --git a/tests/commands.sh.in b/tests/commands.sh.in index f9eeec14..55585e7b 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -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 index 00000000..40e52a2d --- /dev/null +++ b/tests/expected/blkid/lowprobe-pt-bsd @@ -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 index 00000000..65856862 --- /dev/null +++ b/tests/expected/blkid/lowprobe-pt-dos+bsd @@ -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 index 00000000..e9be134e --- /dev/null +++ b/tests/expected/blkid/lowprobe-pt-gpt @@ -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 index 00000000..22bc7b49 --- /dev/null +++ b/tests/expected/blkid/lowprobe-pt-sgi @@ -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 index 00000000..54cb5617 --- /dev/null +++ b/tests/expected/blkid/lowprobe-pt-sun @@ -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 index 0000000000000000000000000000000000000000..c4b05e43276b6a2a61725d59ad880e64eecad7a6 GIT binary patch literal 122 zcmV-=0EPcTT4*^jL0KkKS!UY75C9@4en9o%NP*CRAOKPX0f-O)000Y-jiE@7(jf@9(?k`!0#eakg_0HuDb- zLvY9dtWTNyFASoShG=g9#xyzc4exs%xFL840DwtU;`2awKfP{QD*SwMF`6>V2ta2g zz4OXEQE-NWMUlxq^PC*8Yioe23cFbO$w1QQddj>O9KBC56z`LSP8k=SP-?*owOgC^+20dOaL#cZT%2!c*T~caZqFm}bmigc ztxaz~%H0%8nv^ps(ND)d#yEHAznq$#>wL8x1A+DA16?Wd_m2YfGT63^7DBq@0>{cL zIfSVY2zYP+;O2k|&^$N~c{GZtkQ(|#F|z?30CNDT2aE*3q{SA3dxFiuM4jiN0MWM1 z9g+U5un>Rv2cifmfSx)gEG-66yw8;T#{g&$5mi|{@KmLN zhz27r{ylXR`P908xOt$Qyw>@6NIZpgVIC@|>t{}zx{?pf zr8LT)be--RemBjX!xi<7P0k#dBa!6cx}9pwk8xp`^Rh@L?LJPD54-(R zaV}%5T!k_a=A}{_Ezlp zky(pg^{Y!>b@*?z{${J0fvDZL0vX=RX0w|fOHHr&4VWD`UD!qf>{eZPblOos}`h1WHSTe|}oxX(`>D8rj@<^XJU(c>DQ?o4l_FYl9r# z=-y5Mms0uo!rI*!(hJ0%AOl)v79JJ@f4^b`75_+K3D^>cuyxyE%E98oJRiYQ=$Nr1nDR&q2`=O|pTNopGqJiskMwo^DjZ3&&%X2rJMbbR36O zL-39p<|eHx1XvdJRcq#6VBJk^7dm3lV1MloI2dawn558c4K^tIQPrsi2nSTVi>@|w u(n3SG5cL*u_2|(o=h7TFq*|6upG1PBT+eSyKC3xv{X8qK7~g>E&iE4~gMCc^ literal 0 HcmV?d00001 diff --git a/tests/ts/blkid/images-pt/gpt.img.bz2 b/tests/ts/blkid/images-pt/gpt.img.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..df4de7c57f9ffbdebc23a1794f59f5e04bf4dd96 GIT binary patch literal 494 zcmVF?)) z-~*xw{W-t^yZ{I=0000000000m;e9(2*3bL03g5s000000007D0000Z00A%ng8%>k z00000011Eq004{t1i%1Pq*U^0N9trX9!(PgG-xz$QavH20K}e&wA5t4Pbr3@+Kncj zlheuvqcHQRNU^s=!oH5rWMh1HYJ&}%FKm=d_ z0uTTQAOLb1L>{0306k3}pj4EBkN^yT4PLIk+&?6cfQ>hC&RJWlrz-&v5w4=zi4g%8 y(n263Z8UG;iI2a$BLOUVR(~=tuvj4QIjd%CnaD{b0ssJy#oUoj6eK?HTK|BDmNN_h literal 0 HcmV?d00001 diff --git a/tests/ts/blkid/images-pt/sun.img.bz2 b/tests/ts/blkid/images-pt/sun.img.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..adf4f02e8713f297a1a1b93d0378997e1ada4bf9 GIT binary patch literal 170 zcmV;b09F4&T4*^jL0KkKSuObZ69GYHfBX7E0zgCnI{*L#1_1754qzAn01yBW5D5Sg zKmh;=pa7DJCO`lH88m5;rkVmNDWEho00003)ayDZu{x(XML_@)-No|=A|L`&qDrVB z0#oK!Z%R-#K!AtOV literal 0 HcmV?d00001 diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe index 1dfcbed4..ff21b3b7 100755 --- a/tests/ts/blkid/low-probe +++ b/tests/ts/blkid/low-probe @@ -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 index 00000000..311def67 --- /dev/null +++ b/tests/ts/blkid/lowprobe-pt @@ -0,0 +1,45 @@ +#!/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="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 + -- 2.39.5