Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 2016 09:14:27 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293821 - in head: etc/mtree tests/sys tests/sys/geom tests/sys/geom/class tests/sys/geom/class/concat tests/sys/geom/class/eli tests/sys/geom/class/gate tests/sys/geom/class/mirror tes...
Message-ID:  <201601130914.u0D9ERvE093343@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jan 13 09:14:27 2016
New Revision: 293821
URL: https://svnweb.freebsd.org/changeset/base/293821

Log:
  Integrate
  tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
  in to the FreeBSD test suite as
  tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
  
  The tools/regression/geom and tools/regression/geom_part testcases are being
  left alone because both test sets are both currently broken.
  
  The majority of this work was done on ^/user/ngie/more-tests2 . The differences
  are as follows:
  - tests/sys/geom/class/Makefile.inc is not present; it was
    inlined into the class's Makefiles for explicitness.
  - The testcases officially require root via kyua
  - The geom_gate(4) tests don't use the pidfile changes proposed in
    https://reviews.freebsd.org/D4836 .
  
  MFC after: 1 month
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/tests/sys/geom/
  head/tests/sys/geom/Makefile
     - copied unchanged from r293818, user/ngie/more-tests2/tests/sys/geom/Makefile
  head/tests/sys/geom/class/
  head/tests/sys/geom/class/Makefile
     - copied unchanged from r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile
  head/tests/sys/geom/class/concat/
     - copied from r293820, head/tools/regression/geom_concat/
  head/tests/sys/geom/class/concat/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_concat/test-1.t
  head/tests/sys/geom/class/concat/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_concat/test-2.t
  head/tests/sys/geom/class/concat/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile
  head/tests/sys/geom/class/eli/
     - copied from r293820, head/tools/regression/geom_eli/
  head/tests/sys/geom/class/eli/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile
  head/tests/sys/geom/class/eli/attach_d_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/attach-d.t
  head/tests/sys/geom/class/eli/configure_b_B_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/configure-b-B.t
  head/tests/sys/geom/class/eli/delkey_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/delkey.t
  head/tests/sys/geom/class/eli/detach_l_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/detach-l.t
  head/tests/sys/geom/class/eli/init_B_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/init-B.t
  head/tests/sys/geom/class/eli/init_J_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/init-J.t
  head/tests/sys/geom/class/eli/init_a_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/init-a.t
  head/tests/sys/geom/class/eli/init_i_P_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/init-i-P.t
  head/tests/sys/geom/class/eli/init_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/init.t
  head/tests/sys/geom/class/eli/integrity_copy_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-copy.t
  head/tests/sys/geom/class/eli/integrity_data_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-data.t
  head/tests/sys/geom/class/eli/integrity_hmac_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/integrity-hmac.t
  head/tests/sys/geom/class/eli/kill_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/kill.t
  head/tests/sys/geom/class/eli/nokey_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/nokey.t
  head/tests/sys/geom/class/eli/onetime_a_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/onetime-a.t
  head/tests/sys/geom/class/eli/onetime_d_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/onetime-d.t
  head/tests/sys/geom/class/eli/onetime_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/onetime.t
  head/tests/sys/geom/class/eli/readonly_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/readonly.t
  head/tests/sys/geom/class/eli/resize_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/resize.t
  head/tests/sys/geom/class/eli/setkey_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_eli/setkey.t
  head/tests/sys/geom/class/gate/
     - copied from r293820, head/tools/regression/geom_gate/
  head/tests/sys/geom/class/gate/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_gate/test-1.t
  head/tests/sys/geom/class/gate/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_gate/test-2.t
  head/tests/sys/geom/class/gate/3_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_gate/test-3.t
  head/tests/sys/geom/class/gate/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/gate/Makefile
  head/tests/sys/geom/class/geom_subr.sh
     - copied unchanged from r293820, head/tools/regression/geom_subr.sh
  head/tests/sys/geom/class/mirror/
     - copied from r293820, head/tools/regression/geom_mirror/
  head/tests/sys/geom/class/mirror/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-1.t
  head/tests/sys/geom/class/mirror/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-2.t
  head/tests/sys/geom/class/mirror/3_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-3.t
  head/tests/sys/geom/class/mirror/4_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-4.t
  head/tests/sys/geom/class/mirror/5_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-5.t
  head/tests/sys/geom/class/mirror/6_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-6.t
  head/tests/sys/geom/class/mirror/7_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_mirror/test-7.t
  head/tests/sys/geom/class/mirror/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/mirror/Makefile
  head/tests/sys/geom/class/nop/
     - copied from r293820, head/tools/regression/geom_nop/
  head/tests/sys/geom/class/nop/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_nop/test-1.t
  head/tests/sys/geom/class/nop/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_nop/test-2.t
  head/tests/sys/geom/class/nop/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/nop/Makefile
  head/tests/sys/geom/class/raid3/
     - copied from r293820, head/tools/regression/geom_raid3/
  head/tests/sys/geom/class/raid3/10_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-10.t
  head/tests/sys/geom/class/raid3/11_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-11.t
  head/tests/sys/geom/class/raid3/12_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-12.t
  head/tests/sys/geom/class/raid3/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-1.t
  head/tests/sys/geom/class/raid3/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-2.t
  head/tests/sys/geom/class/raid3/3_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-3.t
  head/tests/sys/geom/class/raid3/4_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-4.t
  head/tests/sys/geom/class/raid3/5_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-5.t
  head/tests/sys/geom/class/raid3/6_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-6.t
  head/tests/sys/geom/class/raid3/7_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-7.t
  head/tests/sys/geom/class/raid3/8_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-8.t
  head/tests/sys/geom/class/raid3/9_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_raid3/test-9.t
  head/tests/sys/geom/class/raid3/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/raid3/Makefile
  head/tests/sys/geom/class/shsec/
     - copied from r293820, head/tools/regression/geom_shsec/
  head/tests/sys/geom/class/shsec/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_shsec/test-1.t
  head/tests/sys/geom/class/shsec/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_shsec/test-2.t
  head/tests/sys/geom/class/shsec/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/shsec/Makefile
  head/tests/sys/geom/class/stripe/
     - copied from r293820, head/tools/regression/geom_stripe/
  head/tests/sys/geom/class/stripe/1_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_stripe/test-1.t
  head/tests/sys/geom/class/stripe/2_test.sh
     - copied unchanged from r293817, head/tools/regression/geom_stripe/test-2.t
  head/tests/sys/geom/class/stripe/Makefile
     - copied, changed from r293818, user/ngie/more-tests2/tests/sys/geom/class/stripe/Makefile
  head/tests/sys/geom/class/uzip/
     - copied from r293820, head/tools/regression/geom_uzip/
  head/tests/sys/geom/class/uzip/1_test.sh
     - copied, changed from r293817, head/tools/regression/geom_uzip/test-1.t
Deleted:
  head/tests/sys/geom/class/concat/test-1.t
  head/tests/sys/geom/class/concat/test-2.t
  head/tests/sys/geom/class/eli/attach-d.t
  head/tests/sys/geom/class/eli/configure-b-B.t
  head/tests/sys/geom/class/eli/delkey.t
  head/tests/sys/geom/class/eli/detach-l.t
  head/tests/sys/geom/class/eli/init-B.t
  head/tests/sys/geom/class/eli/init-J.t
  head/tests/sys/geom/class/eli/init-a.t
  head/tests/sys/geom/class/eli/init-i-P.t
  head/tests/sys/geom/class/eli/init.t
  head/tests/sys/geom/class/eli/integrity-copy.t
  head/tests/sys/geom/class/eli/integrity-data.t
  head/tests/sys/geom/class/eli/integrity-hmac.t
  head/tests/sys/geom/class/eli/kill.t
  head/tests/sys/geom/class/eli/nokey.t
  head/tests/sys/geom/class/eli/onetime-a.t
  head/tests/sys/geom/class/eli/onetime-d.t
  head/tests/sys/geom/class/eli/onetime.t
  head/tests/sys/geom/class/eli/readonly.t
  head/tests/sys/geom/class/eli/resize.t
  head/tests/sys/geom/class/eli/setkey.t
  head/tests/sys/geom/class/gate/test-1.t
  head/tests/sys/geom/class/gate/test-2.t
  head/tests/sys/geom/class/gate/test-3.t
  head/tests/sys/geom/class/mirror/test-1.t
  head/tests/sys/geom/class/mirror/test-2.t
  head/tests/sys/geom/class/mirror/test-3.t
  head/tests/sys/geom/class/mirror/test-4.t
  head/tests/sys/geom/class/mirror/test-5.t
  head/tests/sys/geom/class/mirror/test-6.t
  head/tests/sys/geom/class/mirror/test-7.t
  head/tests/sys/geom/class/nop/test-1.t
  head/tests/sys/geom/class/nop/test-2.t
  head/tests/sys/geom/class/raid3/test-1.t
  head/tests/sys/geom/class/raid3/test-10.t
  head/tests/sys/geom/class/raid3/test-11.t
  head/tests/sys/geom/class/raid3/test-12.t
  head/tests/sys/geom/class/raid3/test-2.t
  head/tests/sys/geom/class/raid3/test-3.t
  head/tests/sys/geom/class/raid3/test-4.t
  head/tests/sys/geom/class/raid3/test-5.t
  head/tests/sys/geom/class/raid3/test-6.t
  head/tests/sys/geom/class/raid3/test-7.t
  head/tests/sys/geom/class/raid3/test-8.t
  head/tests/sys/geom/class/raid3/test-9.t
  head/tests/sys/geom/class/shsec/test-1.t
  head/tests/sys/geom/class/shsec/test-2.t
  head/tests/sys/geom/class/stripe/test-1.t
  head/tests/sys/geom/class/stripe/test-2.t
  head/tests/sys/geom/class/uzip/test-1.t
  head/tools/regression/geom_concat/
  head/tools/regression/geom_eli/
  head/tools/regression/geom_gate/
  head/tools/regression/geom_mirror/
  head/tools/regression/geom_nop/
  head/tools/regression/geom_raid3/
  head/tools/regression/geom_shsec/
  head/tools/regression/geom_stripe/
  head/tools/regression/geom_subr.sh
  head/tools/regression/geom_uzip/
Modified:
  head/etc/mtree/BSD.tests.dist
  head/tests/sys/Makefile
  head/tests/sys/geom/class/uzip/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==============================================================================
--- head/etc/mtree/BSD.tests.dist	Wed Jan 13 08:22:53 2016	(r293820)
+++ head/etc/mtree/BSD.tests.dist	Wed Jan 13 09:14:27 2016	(r293821)
@@ -376,6 +376,32 @@
         ..
         file
         ..
+        geom
+            class
+                concat
+                ..
+                eli
+                ..
+                gate
+                ..
+                gpt
+                ..
+                mirror
+                ..
+                nop
+                ..
+                raid3
+                ..
+                shsec
+                ..
+                stripe
+                ..
+                uzip
+                    etalon
+                    ..
+                ..
+            ..
+        ..
         kern
             acct
             ..

Modified: head/tests/sys/Makefile
==============================================================================
--- head/tests/sys/Makefile	Wed Jan 13 08:22:53 2016	(r293820)
+++ head/tests/sys/Makefile	Wed Jan 13 09:14:27 2016	(r293821)
@@ -8,6 +8,7 @@ TESTS_SUBDIRS+=		acl
 TESTS_SUBDIRS+=		aio
 TESTS_SUBDIRS+=		fifo
 TESTS_SUBDIRS+=		file
+TESTS_SUBDIRS+=		geom
 TESTS_SUBDIRS+=		kern
 TESTS_SUBDIRS+=		kqueue
 TESTS_SUBDIRS+=		mac

Copied: head/tests/sys/geom/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/Makefile	Wed Jan 13 09:14:27 2016	(r293821, copy of r293818, user/ngie/more-tests2/tests/sys/geom/Makefile)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+TESTSDIR=	${TESTSBASE}/sys/geom
+
+TESTS_SUBDIRS+=	class
+
+.include <bsd.test.mk>

Copied: head/tests/sys/geom/class/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/Makefile	Wed Jan 13 09:14:27 2016	(r293821, copy of r293818, user/ngie/more-tests2/tests/sys/geom/class/Makefile)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+TESTSDIR=	${TESTSBASE}/sys/geom/class
+
+TESTS_SUBDIRS+=	concat
+TESTS_SUBDIRS+=	eli
+TESTS_SUBDIRS+=	gate
+# XXX: might not work due to geom(4) changes; more investigation's needed
+#TESTS_SUBDIRS+=	gpt
+TESTS_SUBDIRS+=	mirror
+TESTS_SUBDIRS+=	nop
+TESTS_SUBDIRS+=	raid3
+TESTS_SUBDIRS+=	shsec
+TESTS_SUBDIRS+=	stripe
+TESTS_SUBDIRS+=	uzip
+
+BINDIR=		${TESTSDIR}
+
+FILES+=		geom_subr.sh
+
+.include <bsd.test.mk>

Copied: head/tests/sys/geom/class/concat/1_test.sh (from r293817, head/tools/regression/geom_concat/test-1.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/concat/1_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_concat/test-1.t)
@@ -0,0 +1,23 @@
+#!/bin/sh
+# $FreeBSD$
+
+. `dirname $0`/conf.sh
+
+echo '1..1'
+
+us0=$(attach_md -t malloc -s 1M) || exit 1
+us1=$(attach_md -t malloc -s 2M) || exit 1
+us2=$(attach_md -t malloc -s 3M) || exit 1
+
+gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1
+devwait
+
+# Size of created device should be 1MB + 2MB + 3MB.
+
+size=`diskinfo /dev/concat/${name} | awk '{print $3}'`
+
+if [ $size -eq 6291456 ]; then
+	echo "ok - Size is 6291456"
+else
+	echo "not ok - Size is 6291456"
+fi

Copied: head/tests/sys/geom/class/concat/2_test.sh (from r293817, head/tools/regression/geom_concat/test-2.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/concat/2_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_concat/test-2.t)
@@ -0,0 +1,30 @@
+#!/bin/sh
+# $FreeBSD$
+
+. `dirname $0`/conf.sh
+
+echo '1..1'
+
+tsize=6
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
+
+us0=$(attach_md -t malloc -s 1M) || exit 1
+us1=$(attach_md -t malloc -s 2M) || exit 1
+us2=$(attach_md -t malloc -s 3M) || exit 1
+
+dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1
+
+gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1
+devwait
+
+dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1
+dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1
+
+if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
+	echo "not ok - md5 checksum comparison"
+else
+	echo "ok - md5 checksum comparison"
+fi
+
+rm -f ${src} ${dst}

Copied and modified: head/tests/sys/geom/class/concat/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile)
==============================================================================
--- user/ngie/more-tests2/tests/sys/geom/class/concat/Makefile	Wed Jan 13 07:55:47 2016	(r293818, copy source)
+++ head/tests/sys/geom/class/concat/Makefile	Wed Jan 13 09:14:27 2016	(r293821)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+TESTSDIR=	${TESTSBASE}/sys/geom/class/${.CURDIR:T}
+
 TAP_TESTS_SH+=	1_test
 TAP_TESTS_SH+=	2_test
 
@@ -7,4 +9,8 @@ FILES+=		conf.sh
 FILESNAME_conf.sh=	conf.sh
 FILESDIR=	${TESTSDIR}
 
+.for t in ${TAP_TESTS_SH}
+TEST_METADATA.$t+=	required_user="root"
+.endfor
+
 .include <bsd.test.mk>

Copied and modified: head/tests/sys/geom/class/eli/Makefile (from r293818, user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile)
==============================================================================
--- user/ngie/more-tests2/tests/sys/geom/class/eli/Makefile	Wed Jan 13 07:55:47 2016	(r293818, copy source)
+++ head/tests/sys/geom/class/eli/Makefile	Wed Jan 13 09:14:27 2016	(r293821)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+TESTSDIR=	${TESTSBASE}/sys/geom/class/${.CURDIR:T}
+
 TAP_TESTS_SH+= attach_d_test
 TAP_TESTS_SH+= configure_b_B_test
 TAP_TESTS_SH+= delkey_test
@@ -33,4 +35,8 @@ FILES+=		conf.sh
 FILESNAME_conf.sh=	conf.sh
 FILESDIR=	${TESTSDIR}
 
+.for t in ${TAP_TESTS_SH}
+TEST_METADATA.$t+=	required_user="root"
+.endfor
+
 .include <bsd.test.mk>

Copied: head/tests/sys/geom/class/eli/attach_d_test.sh (from r293817, head/tools/regression/geom_eli/attach-d.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/attach_d_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/attach-d.t)
@@ -0,0 +1,38 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..3"
+
+dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+geli init -B none -P -K $keyfile md${no}
+geli attach -d -p -k $keyfile md${no}
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 1"
+else
+	echo "not ok 1"
+fi
+# Be sure it doesn't detach on read.
+dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null
+sleep 1
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 2"
+else
+	echo "not ok 2"
+fi
+true > /dev/md${no}.eli
+sleep 1
+if [ ! -c /dev/md${no}.eli ]; then
+	echo "ok 3"
+else
+	echo "not ok 3"
+fi
+
+rm -f $keyfile

Copied: head/tests/sys/geom/class/eli/configure_b_B_test.sh (from r293817, head/tools/regression/geom_eli/configure-b-B.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/configure_b_B_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/configure-b-B.t)
@@ -0,0 +1,129 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..17"
+
+geli init -B none -P -K /dev/null md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 1"
+else
+	echo "not ok 1"
+fi
+
+geli dump md${no} | egrep 'flags: 0x0$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 2"
+else
+	echo "not ok 2"
+fi
+
+geli init -B none -b -P -K /dev/null md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 3"
+else
+	echo "not ok 3"
+fi
+
+geli dump md${no} | egrep 'flags: 0x2$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 4"
+else
+	echo "not ok 4"
+fi
+
+geli configure -B md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 5"
+else
+	echo "not ok 5"
+fi
+
+geli dump md${no} | egrep 'flags: 0x0$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 6"
+else
+	echo "not ok 6"
+fi
+
+geli configure -b md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 7"
+else
+	echo "not ok 7"
+fi
+
+geli dump md${no} | egrep 'flags: 0x2$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 8"
+else
+	echo "not ok 8"
+fi
+
+geli attach -p -k /dev/null md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 9"
+else
+	echo "not ok 9"
+fi
+
+geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 10"
+else
+	echo "not ok 10"
+fi
+
+geli configure -B md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 11"
+else
+	echo "not ok 11"
+fi
+
+geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 12"
+else
+	echo "not ok 12"
+fi
+
+geli dump md${no} | egrep 'flags: 0x0$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 13"
+else
+	echo "not ok 13"
+fi
+
+geli configure -b md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 14"
+else
+	echo "not ok 14"
+fi
+
+geli list md${no}.eli | egrep '^Flags: .*BOOT' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 15"
+else
+	echo "not ok 15"
+fi
+
+geli dump md${no} | egrep 'flags: 0x2$' >/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 16"
+else
+	echo "not ok 16"
+fi
+
+geli detach md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 17"
+else
+	echo "not ok 17"
+fi

Copied: head/tests/sys/geom/class/eli/delkey_test.sh (from r293817, head/tools/regression/geom_eli/delkey.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/delkey_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/delkey.t)
@@ -0,0 +1,140 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile1=`mktemp $base.XXXXXX` || exit 1
+keyfile2=`mktemp $base.XXXXXX` || exit 1
+keyfile3=`mktemp $base.XXXXXX` || exit 1
+keyfile4=`mktemp $base.XXXXXX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..14"
+
+dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1
+
+geli init -B none -P -K $keyfile1 md${no}
+geli attach -p -k $keyfile1 md${no}
+geli setkey -n 1 -P -K $keyfile2 md${no}
+
+# Remove key 0 for attached provider.
+geli delkey -n 0 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 1"
+else
+	echo "not ok 1"
+fi
+geli detach md${no}
+
+# We cannot use keyfile1 anymore.
+geli attach -p -k $keyfile1 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 2"
+else
+	echo "not ok 2"
+fi
+
+# Attach with key 1.
+geli attach -p -k $keyfile2 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 3"
+else
+	echo "not ok 3"
+fi
+
+# We cannot remove last key without -f option (for attached provider).
+geli delkey -n 1 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 4"
+else
+	echo "not ok 4"
+fi
+
+# Remove last key for attached provider.
+geli delkey -f -n 1 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 5"
+else
+	echo "not ok 5"
+fi
+
+# If there are no valid keys, but provider is attached, we can save situation.
+geli setkey -n 0 -P -K $keyfile3 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 6"
+else
+	echo "not ok 6"
+fi
+geli detach md${no}
+
+# We cannot use keyfile2 anymore.
+geli attach -p -k $keyfile2 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 7"
+else
+	echo "not ok 7"
+fi
+
+# Attach with key 0.
+geli attach -p -k $keyfile3 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 8"
+else
+	echo "not ok 8"
+fi
+
+# Setup key 1.
+geli setkey -n 1 -P -K $keyfile4 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 9"
+else
+	echo "not ok 9"
+fi
+geli detach md${no}
+
+# Remove key 1 for detached provider.
+geli delkey -n 1 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 10"
+else
+	echo "not ok 10"
+fi
+
+# We cannot use keyfile4 anymore.
+geli attach -p -k $keyfile4 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 11"
+else
+	echo "not ok 11"
+fi
+
+# We cannot remove last key without -f option (for detached provider).
+geli delkey -n 0 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 12"
+else
+	echo "not ok 12"
+fi
+
+# Remove last key for detached provider.
+geli delkey -f -n 0 md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 13"
+else
+	echo "not ok 13"
+fi
+
+# We cannot use keyfile3 anymore.
+geli attach -p -k $keyfile3 md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 14"
+else
+	echo "not ok 14"
+fi
+
+rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4

Copied: head/tests/sys/geom/class/eli/detach_l_test.sh (from r293817, head/tools/regression/geom_eli/detach-l.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/detach_l_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/detach-l.t)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..4"
+
+dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+geli init -B none -P -K $keyfile md${no}
+geli attach -p -k $keyfile md${no}
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 1"
+else
+	echo "not ok 1"
+fi
+# Be sure it doesn't detach before 'detach -l'.
+dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null
+sleep 1
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 2"
+else
+	echo "not ok 2"
+fi
+geli detach -l md${no}
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 3"
+else
+	echo "not ok 3"
+fi
+dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null
+sleep 1
+if [ ! -c /dev/md${no}.eli ]; then
+	echo "ok 4"
+else
+	echo "not ok 4"
+fi
+
+rm -f $keyfile

Copied: head/tests/sys/geom/class/eli/init_B_test.sh (from r293817, head/tools/regression/geom_eli/init-B.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/init_B_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/init-B.t)
@@ -0,0 +1,104 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+backupfile=`mktemp $base.XXXXXX` || exit 1
+
+echo "1..13"
+
+dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+mdconfig -a -t malloc -s $sectors -u $no || exit 1
+
+# -B none
+rm -f /var/backups/md${no}.eli
+geli init -B none -P -K $keyfile md${no} 2>/dev/null
+if [ ! -f /var/backups/md${no}.eli ]; then
+	echo "ok 1 - -B none"
+else
+	echo "not ok 1 - -B none"
+fi
+
+# no -B
+rm -f /var/backups/md${no}.eli
+geli init -P -K $keyfile md${no} >/dev/null 2>&1
+if [ -f /var/backups/md${no}.eli ]; then
+	echo "ok 2 - no -B"
+else
+	echo "not ok 2 - no -B"
+fi
+geli clear md${no}
+geli attach -p -k $keyfile md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 3 - no -B"
+else
+	echo "not ok 3 - no -B"
+fi
+if [ ! -c /dev/md${no}.eli ]; then
+	echo "ok 4 - no -B"
+else
+	echo "not ok 4 - no -B"
+fi
+geli restore /var/backups/md${no}.eli md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 5 - no -B"
+else
+	echo "not ok 5 - no -B"
+fi
+geli attach -p -k $keyfile md${no} 2>/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 6 - no -B"
+else
+	echo "not ok 6 - no -B"
+fi
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 7 - no -B"
+else
+	echo "not ok 7 - no -B"
+fi
+geli detach md${no}
+rm -f /var/backups/md${no}.eli
+
+# -B file
+rm -f $backupfile
+geli init -B $backupfile -P -K $keyfile md${no} >/dev/null 2>&1
+if [ -f $backupfile ]; then
+	echo "ok 8 - -B file"
+else
+	echo "not ok 8 - -B file"
+fi
+geli clear md${no}
+geli attach -p -k $keyfile md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 9 - -B file"
+else
+	echo "not ok 9 - -B file"
+fi
+if [ ! -c /dev/md${no}.eli ]; then
+	echo "ok 10 - -B file"
+else
+	echo "not ok 10 - -B file"
+fi
+geli restore $backupfile md${no}
+if [ $? -eq 0 ]; then
+	echo "ok 11 - -B file"
+else
+	echo "not ok 11 - -B file"
+fi
+geli attach -p -k $keyfile md${no} 2>/dev/null
+if [ $? -eq 0 ]; then
+	echo "ok 12 - -B file"
+else
+	echo "not ok 12 - -B file"
+fi
+if [ -c /dev/md${no}.eli ]; then
+	echo "ok 13 - -B file"
+else
+	echo "not ok 13 - -B file"
+fi
+
+rm -f $backupfile $keyfile

Copied: head/tests/sys/geom/class/eli/init_J_test.sh (from r293817, head/tools/regression/geom_eli/init-J.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/init_J_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/init-J.t)
@@ -0,0 +1,126 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile0=`mktemp $base.XXXXXX` || exit 1
+keyfile1=`mktemp $base.XXXXXX` || exit 1
+passfile0=`mktemp $base.XXXXXX` || exit 1
+passfile1=`mktemp $base.XXXXXX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..150"
+
+dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1
+dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0}
+dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1}
+
+i=1
+for iter in -1 0 64; do
+	geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+
+	geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+	geli detach md${no} || echo -n "not "
+	echo "ok ${i}"; i=$((i+1))
+done
+
+rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1}

Copied: head/tests/sys/geom/class/eli/init_a_test.sh (from r293817, head/tools/regression/geom_eli/init-a.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/init_a_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/init-a.t)
@@ -0,0 +1,60 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+
+echo "1..1380"
+
+i=1
+for cipher in aes:0 aes:128 aes:256 \
+    aes-xts:0 aes-xts:128 aes-xts:256 \
+    aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
+    3des:0 3des:192 \
+    3des-cbc:0 3des-cbc:192 \
+    blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
+    blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
+    blowfish:416 blowfish:448 \
+    blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \
+    blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \
+    blowfish-cbc:416 blowfish-cbc:448 \
+    camellia:0 camellia:128 camellia:192 camellia:256 \
+    camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
+	ealgo=${cipher%%:*}
+	keylen=${cipher##*:}
+	for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
+		for secsize in 512 1024 2048 4096 8192; do
+			rnd=`mktemp $base.XXXXXX` || exit 1
+			mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1
+
+			dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+			geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null
+			geli attach -p -k $keyfile md${no}
+
+			secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'`
+
+			dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1
+			dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null
+
+			md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5`
+			md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5`
+
+			if [ ${md_rnd} = ${md_ddev} ]; then
+				echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			else
+				echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			fi
+			i=$((i+1))
+
+			geli detach md${no}
+			rm -f $rnd
+			mdconfig -d -u $no
+		done
+	done
+done
+
+rm -f $keyfile

Copied: head/tests/sys/geom/class/eli/init_i_P_test.sh (from r293817, head/tools/regression/geom_eli/init-i-P.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/init_i_P_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/init-i-P.t)
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
+
+echo "1..1"
+
+dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+geli init -B none -i 64 -P -K ${keyfile} md${no} 2>/dev/null
+if [ $? -ne 0 ]; then
+	echo "ok 1"
+else
+	echo "not ok 1"
+fi
+
+rm -f $keyfile

Copied: head/tests/sys/geom/class/eli/init_test.sh (from r293817, head/tools/regression/geom_eli/init.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/init_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/init.t)
@@ -0,0 +1,65 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+
+echo "1..460"
+
+i=1
+for cipher in aes:0 aes:128 aes:256 \
+    aes-xts:0 aes-xts:128 aes-xts:256 \
+    aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
+    3des:0 3des:192 \
+    3des-cbc:0 3des-cbc:192 \
+    blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
+    blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
+    blowfish:416 blowfish:448 \
+    blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \
+    blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \
+    blowfish-cbc:416 blowfish-cbc:448 \
+    camellia:0 camellia:128 camellia:192 camellia:256 \
+    camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
+	ealgo=${cipher%%:*}
+	keylen=${cipher##*:}
+	for secsize in 512 1024 2048 4096 8192; do
+		rnd=`mktemp $base.XXXXXX` || exit 1
+		mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1
+
+		dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+		geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null
+		geli attach -p -k $keyfile md${no}
+
+		secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'`
+
+		dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1
+		dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null
+
+		md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5`
+		md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5`
+		md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5`
+
+		if [ ${md_rnd} = ${md_ddev} ]; then
+			echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+		else
+			echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+		fi
+		i=$((i+1))
+		if [ ${md_rnd} != ${md_edev} ]; then
+			echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+		else
+			echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+		fi
+		i=$((i+1))
+
+		geli detach md${no}
+		rm -f $rnd
+		mdconfig -d -u $no
+	done
+done
+
+rm -f $keyfile

Copied: head/tests/sys/geom/class/eli/integrity_copy_test.sh (from r293817, head/tools/regression/geom_eli/integrity-copy.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/geom/class/eli/integrity_copy_test.sh	Wed Jan 13 09:14:27 2016	(r293821, copy of r293817, head/tools/regression/geom_eli/integrity-copy.t)
@@ -0,0 +1,99 @@
+#!/bin/sh
+# $FreeBSD$
+
+. $(dirname $0)/conf.sh
+
+base=`basename $0`
+sectors=100
+keyfile=`mktemp $base.XXXXXX` || exit 1
+sector=`mktemp $base.XXXXXX` || exit 1
+
+echo "1..5520"
+
+i=1
+for cipher in aes:0 aes:128 aes:256 \
+    aes-xts:0 aes-xts:128 aes-xts:256 \
+    aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \
+    3des:0 3des:192 \
+    3des-cbc:0 3des-cbc:192 \
+    blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
+    blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
+    blowfish:416 blowfish:448 \
+    blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \
+    blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \
+    blowfish-cbc:416 blowfish-cbc:448 \
+    camellia:0 camellia:128 camellia:192 camellia:256 \
+    camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do
+	ealgo=${cipher%%:*}
+	keylen=${cipher##*:}
+	for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
+		for secsize in 512 1024 2048 4096 8192; do
+			#mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1
+			mdconfig -a -t malloc -s $sectors -u $no || exit 1
+
+			dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
+
+			geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null
+			geli attach -p -k $keyfile md${no}
+
+			dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1
+
+			dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1
+			if [ $? -eq 0 ]; then
+				echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			else
+				echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			fi
+			i=$((i+1))
+
+			geli detach md${no}
+			# Copy first small sector to the second small sector.
+			# This should be detected as corruption.
+			dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1
+			dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1
+			geli attach -p -k $keyfile md${no}
+
+			dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1
+			if [ $? -ne 0 ]; then
+				echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			else
+				echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}"
+			fi
+			i=$((i+1))
+
+			ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'`
+			ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'`
+			usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc`

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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