diff options
author | ngie <ngie@FreeBSD.org> | 2015-11-25 01:15:25 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-11-25 01:15:25 +0000 |
commit | ab8d38b2870101690f78b0a0760a093de9aa4f75 (patch) | |
tree | bd4e2210d5f497a95225c8af0f2db87ad37b2839 | |
parent | cfb3e257cd18a318cb4b2cc6b07b8c3dac1ee37c (diff) | |
download | FreeBSD-src-ab8d38b2870101690f78b0a0760a093de9aa4f75.zip FreeBSD-src-ab8d38b2870101690f78b0a0760a093de9aa4f75.tar.gz |
- Convert 1_test into a TAP testcase
- Use conf.sh
- Simplify the setup/cleanup steps
-rwxr-xr-x | sbin/geom/class/tests/uzip/1_test.sh | 35 | ||||
-rw-r--r-- | sbin/geom/class/tests/uzip/Makefile | 5 |
2 files changed, 14 insertions, 26 deletions
diff --git a/sbin/geom/class/tests/uzip/1_test.sh b/sbin/geom/class/tests/uzip/1_test.sh index af3e889..222b6c9 100755 --- a/sbin/geom/class/tests/uzip/1_test.sh +++ b/sbin/geom/class/tests/uzip/1_test.sh @@ -1,37 +1,22 @@ #!/bin/sh -# # $FreeBSD$ -# -mntpoint="/mnt/test-1" +testsdir=$(dirname $0) +. $testsdir/conf.sh -# -# prepare -kldload geom_uzip -UUE=$(dirname $0)/1.img.uzip.uue +echo "1..1" + +UUE=$testsdir/1.img.uzip.uue uudecode $UUE -num=`mdconfig -an -f $(basename $UUE .uue)` || exit 1 +us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 sleep 1 -# -# mount -mkdir -p "${mntpoint}" -mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 +mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 -# -# compare #cat "${mntpoint}/etalon.txt" -diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" if [ $? -eq 0 ]; then - echo "PASS" + echo "ok 1" else - echo "FAIL" + echo "not ok 1" fi - -# -# cleanup -umount "${mntpoint}" -rmdir "${mntpoint}" -mdconfig -d -u ${num} -sleep 1 -kldunload geom_uzip diff --git a/sbin/geom/class/tests/uzip/Makefile b/sbin/geom/class/tests/uzip/Makefile index ad437c7..b4e1d7d 100644 --- a/sbin/geom/class/tests/uzip/Makefile +++ b/sbin/geom/class/tests/uzip/Makefile @@ -21,6 +21,9 @@ ${UZIMAGE}: ${IMAGE} ${ZIMAGE} printf "FreeBSD$$\n#\n\n" >> ${.TARGET} uuencode ${ZIMAGE} ${ZIMAGE} >>${.TARGET} +FILES+= conf.sh +FILESNAME_conf.sh= conf.sh + FILES+= ${UZIMAGE} FILESDIR= ${TESTSDIR} @@ -28,6 +31,6 @@ FILESGROUPS= FILES etalon etalon+= etalon/etalon.txt etalonDIR= ${TESTSDIR}/etalon -PLAIN_TESTS_SH+= 1_test +TAP_TESTS_SH+= 1_test .include <bsd.test.mk> |