1#!/bin/sh 2# $FreeBSD: releng/11.0/tests/sys/geom/class/eli/nokey_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..8" 12 13geli init -B none -P md${no} 2>/dev/null 14if [ $? -ne 0 ]; then 15 echo "ok 1" 16else 17 echo "not ok 1" 18fi 19 20dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 21 22geli init -B none -P -K ${keyfile} md${no} 2>/dev/null 23if [ $? -eq 0 ]; then 24 echo "ok 2" 25else 26 echo "not ok 2" 27fi 28geli attach -p md${no} 2>/dev/null 29if [ $? -ne 0 ]; then 30 echo "ok 3" 31else 32 echo "not ok 3" 33fi 34geli attach -p -k ${keyfile} md${no} 2>/dev/null 35if [ $? -eq 0 ]; then 36 echo "ok 4" 37else 38 echo "not ok 4" 39fi 40geli setkey -n 0 -P md${no} 2>/dev/null 41if [ $? -ne 0 ]; then 42 echo "ok 5" 43else 44 echo "not ok 5" 45fi 46geli detach md${no} 2>/dev/null 47if [ $? -eq 0 ]; then 48 echo "ok 6" 49else 50 echo "not ok 6" 51fi 52geli setkey -n 0 -p -P -K ${keyfile} md${no} 2>/dev/null 53if [ $? -ne 0 ]; then 54 echo "ok 7" 55else 56 echo "not ok 7" 57fi 58geli setkey -n 0 -p -k ${keyfile} -P md${no} 2>/dev/null 59if [ $? -ne 0 ]; then 60 echo "ok 8" 61else 62 echo "not ok 8" 63fi 64 65rm -f $keyfile 66