attach_d_test.sh revision 293821
1#!/bin/sh 2# $FreeBSD: head/tests/sys/geom/class/eli/attach_d_test.sh 293821 2016-01-13 09:14:27Z ngie $ 3 4. $(dirname $0)/conf.sh 5 6base=`basename $0` 7sectors=100 8keyfile=`mktemp $base.XXXXXX` || exit 1 9mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 10 11echo "1..3" 12 13dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 14 15geli init -B none -P -K $keyfile md${no} 16geli attach -d -p -k $keyfile md${no} 17if [ -c /dev/md${no}.eli ]; then 18 echo "ok 1" 19else 20 echo "not ok 1" 21fi 22# Be sure it doesn't detach on read. 23dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null 24sleep 1 25if [ -c /dev/md${no}.eli ]; then 26 echo "ok 2" 27else 28 echo "not ok 2" 29fi 30true > /dev/md${no}.eli 31sleep 1 32if [ ! -c /dev/md${no}.eli ]; then 33 echo "ok 3" 34else 35 echo "not ok 3" 36fi 37 38rm -f $keyfile 39