Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Mar 2016 01:17:53 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r296787 - stable/10/tools/regression/geom_uzip
Message-ID:  <201603130117.u2D1HrhG088388@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Mar 13 01:17:53 2016
New Revision: 296787
URL: https://svnweb.freebsd.org/changeset/base/296787

Log:
  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/10/tools/regression/geom_uzip/conf.sh
     - copied unchanged from r293443, head/tools/regression/geom_uzip/conf.sh
  stable/10/tools/regression/geom_uzip/test-1.t
     - copied unchanged from r293443, head/tools/regression/geom_uzip/test-1.t
Deleted:
  stable/10/tools/regression/geom_uzip/runtests.sh
  stable/10/tools/regression/geom_uzip/test-1.sh
  stable/10/tools/regression/geom_uzip/test-2.sh
Modified:
  stable/10/tools/regression/geom_uzip/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/regression/geom_uzip/Makefile
==============================================================================
--- stable/10/tools/regression/geom_uzip/Makefile	Sun Mar 13 01:16:50 2016	(r296786)
+++ stable/10/tools/regression/geom_uzip/Makefile	Sun Mar 13 01:17:53 2016	(r296787)
@@ -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/10/tools/regression/geom_uzip/conf.sh (from r293443, head/tools/regression/geom_uzip/conf.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/tools/regression/geom_uzip/conf.sh	Sun Mar 13 01:17:53 2016	(r296787, copy of r293443, head/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/10/tools/regression/geom_uzip/test-1.t (from r293443, head/tools/regression/geom_uzip/test-1.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/tools/regression/geom_uzip/test-1.t	Sun Mar 13 01:17:53 2016	(r296787, copy of r293443, head/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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603130117.u2D1HrhG088388>