From ee91bec14fe7c2652033386845ab78817f1dca13 Mon Sep 17 00:00:00 2001 From: Max Khon Date: Fri, 13 Aug 2004 09:53:52 +0000 Subject: [PATCH] Regression test for geom_uzip. --- tools/regression/geom_uzip/.cvsignore | 2 + tools/regression/geom_uzip/Makefile | 21 ++++++ tools/regression/geom_uzip/etalon/etalon.txt | 43 ++++++++++++ tools/regression/geom_uzip/runtests.sh | 10 +++ tools/regression/geom_uzip/test-1.img.gz.uue | 72 ++++++++++++++++++++ tools/regression/geom_uzip/test-1.sh | 35 ++++++++++ tools/regression/geom_uzip/test-2.sh | 15 ++++ 7 files changed, 198 insertions(+) create mode 100644 tools/regression/geom_uzip/.cvsignore create mode 100644 tools/regression/geom_uzip/Makefile create mode 100644 tools/regression/geom_uzip/etalon/etalon.txt create mode 100644 tools/regression/geom_uzip/runtests.sh create mode 100644 tools/regression/geom_uzip/test-1.img.gz.uue create mode 100644 tools/regression/geom_uzip/test-1.sh create mode 100644 tools/regression/geom_uzip/test-2.sh diff --git a/tools/regression/geom_uzip/.cvsignore b/tools/regression/geom_uzip/.cvsignore new file mode 100644 index 000000000000..1e4f1642f869 --- /dev/null +++ b/tools/regression/geom_uzip/.cvsignore @@ -0,0 +1,2 @@ +test-1.img +test-1.img.gz diff --git a/tools/regression/geom_uzip/Makefile b/tools/regression/geom_uzip/Makefile new file mode 100644 index 000000000000..bab058e19ce6 --- /dev/null +++ b/tools/regression/geom_uzip/Makefile @@ -0,0 +1,21 @@ +# +# $FreeBSD$ +# +# Regression test for geom_ugz. +# + +IMAGE= test-1.img +ZIMAGE= ${IMAGE}.gz +UZIMAGE= ${ZIMAGE}.uue + +test: + @sh runtests.sh + +image: + makefs -s 1048576 ${IMAGE} etalon + printf "#\n# $$" >${UZIMAGE} + printf "FreeBSD$$\n#\n\n" >> ${UZIMAGE} + create_compressed_fs ${IMAGE} 65536 | uuencode ${ZIMAGE} >>${UZIMAGE} + +clean: + rm -f ${IMAGE} ${ZIMAGE} diff --git a/tools/regression/geom_uzip/etalon/etalon.txt b/tools/regression/geom_uzip/etalon/etalon.txt new file mode 100644 index 000000000000..cb8acf31f650 --- /dev/null +++ b/tools/regression/geom_uzip/etalon/etalon.txt @@ -0,0 +1,43 @@ +# +# $FreeBSD$ +# + +JABBERWOCKY + +Lewis Carroll +(from Through the Looking-Glass and What Alice Found There, 1872) + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe: +All mimsy were the borogoves, +And the mome raths outgrabe. + +"Beware the Jabberwock, my son! +The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun +The frumious Bandersnatch!" + +He took his vorpal sword in hand: +Long time the manxome foe he sought -- +So rested he by the Tumtum tree, +And stood awhile in thought. + +And, as in uffish thought he stood, +The Jabberwock, with eyes of flame, +Came whiffling through the tulgey wood, +And burbled as it came! + +One, two! One, two! And through and through +The vorpal blade went snicker-snack! +He left it dead, and with its head +He went galumphing back. + +"And, has thou slain the Jabberwock? +Come to my arms, my beamish boy! +O frabjous day! Callooh! Callay!' +He chortled in his joy. + +`Twas brillig, and the slithy toves +Did gyre and gimble in the wabe; +All mimsy were the borogoves, +And the mome raths outgrabe. diff --git a/tools/regression/geom_uzip/runtests.sh b/tools/regression/geom_uzip/runtests.sh new file mode 100644 index 000000000000..60e78b540746 --- /dev/null +++ b/tools/regression/geom_uzip/runtests.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +dir=`dirname $0` + +for ts in `dirname $0`/test-*.sh; do + sh $ts +done diff --git a/tools/regression/geom_uzip/test-1.img.gz.uue b/tools/regression/geom_uzip/test-1.img.gz.uue new file mode 100644 index 000000000000..cc5eb32a0186 --- /dev/null +++ b/tools/regression/geom_uzip/test-1.img.gz.uue @@ -0,0 +1,72 @@ +# +# $FreeBSD$ +# + +begin 664 test-1.img.gz +M(R$O8FEN+W-H"B-6,BXP($9O&ET("0_ +M"@```````````````````````````````````````````````````0`````` +M$0````````$8````````!A8````````&:@````````:^````````!Q(````` +M```'9@````````>Z````````"`X````````(8@````````BV````````"0H` +M```````)7@````````FR````````"@8````````*6@````````JN```````` +M"PD````````+77C:[=U-;]Q$&,!Q;Q+H8H'4`X[O5`N7%#%&?$%."!."''@P('OP(4#1SX$:'G& +MZ^VF44NIPE((_Y\TZ[=Y\S.VY5W'BN:3.][K[^&4T\GX;C9Z06=\;;WO:ZY__=+?JPT*=)N7K?"ZMU=M='3PSUAN]MS=>^O/^/[4M)7DKZ6]*VD +MJ.%YKTAZ3]+-0_5T=.?20_/GO71/_7YXH!(``````````````.`P?E^O7^"M +M7XR>_!W$P>F90[8S>>_ZU_EQFK8_=]?V>[?NG"[-J/UO/AZ_HWRB?I_[\[K] +M@],7#MG^PGW:?Z9>CNOVMF[=.5V>\?X_5R]_9FE2K/"@B +MJTQ9]',INN+[)S?T(*@+70S"4.<#T]E=4NE069.U?.FNV@D&5C+(CH1Q(7UW +M>3O)[96=H.A$+7]_166X4X:2.^^.]\E&9595U]/VW +MI*0$3T42WVLFWPL290=F_8E2N;:&[;G4XK#)OEVE1IJJ081W'PTI;714,HG@2RZJ\Q$.V2I>M6UGV +M>K&-)MNJ5ERQI6I']L=J((.E]%!+8'NJEP2IM+(IGTKJ[_62V/5[WT%2E$E? +MRUA5=;G>A&4N8]JMFG7A3'7+][YCH=2 +MUATF55RBP%;AD.,SJ(_`:1S>\#?=@!3&'3M!GMKJ(`IUD+HHAF;8\K=D_(-P +MQXU_-QBVY$1*$F.B\8RL>-[UH!.9O'#A<",O1\..&:[\+2?*:X\;&A(F`#C:;-YIR[>\Q+9SW92/>:X]_\N-"`!Q)[>F/^NT7V]TR38?5CTZV"-*]=ML_Q[D/```` +M````````````````````````````S,P?@'&3'7C:[<$!`0```("0_J_N"`H` +M```````````````````````````````````````````````````````````` +M``````````````````````!J``\``7C:[<$!`0```("0_J_N"`H````````` +M```````````````````````````````````````````````````````````` +M``````````````!J``\``7C:[<$!`0```("0_J_N"`H````````````````` +M```````````````````````````````````````````````````````````` +M``````!J``\``7C:[<$!`0```("0_J_N"`H````````````````````````` +M``````````````````````````````````````````````````````````!J +M``\``7C:[<$!`0```("0_J_N"`H````````````````````````````````` +M``````````````````````````````````````````````````!J``\``7C: +M[<$!`0```("0_J_N"`H````````````````````````````````````````` +M``````````````````````````````````````````!J``\``7C:[<$!`0`` +M`("0_J_N"`H````````````````````````````````````````````````` +M``````````````````````````````````!J``\``7C:[<$!`0```("0_J_N +M"`H````````````````````````````````````````````````````````` +M``````````````````````````!J``\``7C:[<$!`0```("0_J_N"`H````` +M```````````````````````````````````````````````````````````` +M``````````````````!J``\``7C:[<$!`0```("0_J_N"`H````````````` +M```````````````````````````````````````````````````````````` +M``````````!J``\``7C:[<$!`0```("0_J_N"`H````````````````````` +M```````````````````````````````````````````````````````````` +M``!J``\``7C:[<$!`0```("0_J_N"`H````````````````````````````` +M``````````````````````````````````````````````````````!J``\` +M`7C:[<$!`0```("0_J_N"`H````````````````````````````````````` +M``````````````````````````````````````````````!J``\``7C:[<$! +M`0```("0_J_N"`H````````````````````````````````````````````` +M``````````````````````````````````````!J``\``7C:[=!!$0``#`(@ +MHQO="GOO(`()```````````````````````````````````````````````` +M``````````````````````````````````#`6U5P-Y:/`(%XVNW!`0$```"` +MD/ZO[@@*```````````````````````````````````````````````````` +>````````````````````````````````:@`/``$` +` +end diff --git a/tools/regression/geom_uzip/test-1.sh b/tools/regression/geom_uzip/test-1.sh new file mode 100644 index 000000000000..6e9144930510 --- /dev/null +++ b/tools/regression/geom_uzip/test-1.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +mntpoint="/mnt/test-1" + +# +# prepare +kldload geom_uzip +uudecode test-1.img.gz.uue +num=`mdconfig -an -f test-1.img.gz` || exit 1 +sleep 1 + +# +# mount +mkdir -p "${mntpoint}" +mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 + +# +# compare +#cat "${mntpoint}/etalon.txt" +diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +if [ $? -eq 0 ]; then + echo "PASS" +else + echo "FAIL" +fi + +# +# cleanup +umount "${mntpoint}" +rmdir "${mntpoint}" +mdconfig -d -u ${num} +kldunload geom_uzip diff --git a/tools/regression/geom_uzip/test-2.sh b/tools/regression/geom_uzip/test-2.sh new file mode 100644 index 000000000000..0a9b684b9159 --- /dev/null +++ b/tools/regression/geom_uzip/test-2.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# prepare +kldload geom_uzip +uudecode test-1.img.gz.uue +num=`mdconfig -an -f test-1.img.gz` || exit 1 +sleep 1 + +# +# destroy +kldunload geom_uzip