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