Author: ngie
Date: Sun Mar 13 02:09:01 2016
New Revision: 296796
URL: https://svnweb.freebsd.org/changeset/base/296796

Log:
  MFstable/10 r296787:
  
  MFC r293443:
  
  - Make test-1.sh into a TAP testable testcase
  - Delete test-2.sh as it was an incomplete testcase, and the contents were
    basically a subset of test-1.sh
  - Add a conf.sh file for executing common functions with geom_uzip
  - Use attach_md for attaching md(4) devices
  - Don't hardcode /tmp for temporary files, which violates the kyua sandbox

Added:
  stable/9/tools/regression/geom_uzip/conf.sh
     - copied unchanged from r296787, 
stable/10/tools/regression/geom_uzip/conf.sh
  stable/9/tools/regression/geom_uzip/test-1.t
     - copied unchanged from r296787, 
stable/10/tools/regression/geom_uzip/test-1.t
Deleted:
  stable/9/tools/regression/geom_uzip/runtests.sh
  stable/9/tools/regression/geom_uzip/test-1.sh
  stable/9/tools/regression/geom_uzip/test-2.sh
Modified:
  stable/9/tools/regression/geom_uzip/Makefile
Directory Properties:
  stable/9/   (props changed)
  stable/9/tools/   (props changed)
  stable/9/tools/regression/   (props changed)

Modified: stable/9/tools/regression/geom_uzip/Makefile
==============================================================================
--- stable/9/tools/regression/geom_uzip/Makefile        Sun Mar 13 02:08:23 
2016        (r296795)
+++ stable/9/tools/regression/geom_uzip/Makefile        Sun Mar 13 02:09:01 
2016        (r296796)
@@ -9,7 +9,7 @@ ZIMAGE=         ${IMAGE}.uzip
 UZIMAGE=       ${ZIMAGE}.uue
 
 test:
-       @sh runtests.sh
+       prove -rv ./test-1.t
 
 image:
        makefs -s 1048576 ${IMAGE} etalon

Copied: stable/9/tools/regression/geom_uzip/conf.sh (from r296787, 
stable/10/tools/regression/geom_uzip/conf.sh)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/geom_uzip/conf.sh Sun Mar 13 02:09:01 2016        
(r296796, copy of r296787, stable/10/tools/regression/geom_uzip/conf.sh)
@@ -0,0 +1,20 @@
+#!/bin/sh
+# $FreeBSD$
+
+class="uzip"
+base=`basename $0`
+
+uzip_test_cleanup()
+{
+       if [ -n "$mntpoint" ]; then
+               umount $mntpoint
+               rmdir $mntpoint
+       fi
+       geom_test_cleanup
+}
+trap uzip_test_cleanup ABRT EXIT INT TERM
+
+. `dirname $0`/../geom_subr.sh
+
+# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc]
+mntpoint=$(mktemp -d tmp.XXXXXX) || exit

Copied: stable/9/tools/regression/geom_uzip/test-1.t (from r296787, 
stable/10/tools/regression/geom_uzip/test-1.t)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/geom_uzip/test-1.t        Sun Mar 13 02:09:01 
2016        (r296796, copy of r296787, 
stable/10/tools/regression/geom_uzip/test-1.t)
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $FreeBSD$
+
+testsdir=$(dirname $0)
+. $testsdir/conf.sh
+
+echo "1..1"
+
+UUE=$testsdir/test-1.img.uzip.uue
+uudecode $UUE
+us0=$(attach_md -f $(basename $UUE .uue)) || exit 1
+sleep 1
+
+mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1
+
+#cat "${mntpoint}/etalon.txt"
+diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt"
+if [ $? -eq 0 ]; then
+       echo "ok 1"
+else
+       echo "not ok 1"
+fi
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to