From owner-svn-src-all@freebsd.org Fri Jan 8 21:38:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5952A68DE6; Fri, 8 Jan 2016 21:38:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9761531; Fri, 8 Jan 2016 21:38:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08LcQeO092767; Fri, 8 Jan 2016 21:38:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08LcQAf092764; Fri, 8 Jan 2016 21:38:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601082138.u08LcQAf092764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 21:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293443 - head/tools/regression/geom_uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:38:27 -0000 Author: ngie Date: Fri Jan 8 21:38:26 2016 New Revision: 293443 URL: https://svnweb.freebsd.org/changeset/base/293443 Log: - 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 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Added: head/tools/regression/geom_uzip/conf.sh (contents, props changed) head/tools/regression/geom_uzip/test-1.t - copied, changed from r293442, head/tools/regression/geom_uzip/test-1.sh Deleted: head/tools/regression/geom_uzip/runtests.sh head/tools/regression/geom_uzip/test-1.sh head/tools/regression/geom_uzip/test-2.sh Modified: head/tools/regression/geom_uzip/Makefile Modified: head/tools/regression/geom_uzip/Makefile ============================================================================== --- head/tools/regression/geom_uzip/Makefile Fri Jan 8 21:28:09 2016 (r293442) +++ head/tools/regression/geom_uzip/Makefile Fri Jan 8 21:38:26 2016 (r293443) @@ -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 Added: head/tools/regression/geom_uzip/conf.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_uzip/conf.sh Fri Jan 8 21:38:26 2016 (r293443) @@ -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 and modified: head/tools/regression/geom_uzip/test-1.t (from r293442, head/tools/regression/geom_uzip/test-1.sh) ============================================================================== --- head/tools/regression/geom_uzip/test-1.sh Fri Jan 8 21:28:09 2016 (r293442, copy source) +++ head/tools/regression/geom_uzip/test-1.t Fri Jan 8 21:38:26 2016 (r293443) @@ -1,36 +1,22 @@ #!/bin/sh -# # $FreeBSD$ -# -mntpoint="/mnt/test-1" +testsdir=$(dirname $0) +. $testsdir/conf.sh -# -# prepare -kldload geom_uzip -uudecode test-1.img.uzip.uue -num=`mdconfig -an -f test-1.img.uzip` || exit 1 +echo "1..1" + +UUE=$testsdir/test-1.img.uzip.uue +uudecode $UUE +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