Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/geom/class/eli/conf.sh
#!/bin/sh | #!/bin/sh | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
class="eli" | class="eli" | ||||
base=`basename $0` | base=`basename $0` | ||||
# We need to use linear probing in order to detect the first available md(4) | |||||
# device instead of using mdconfig -a -t, because geli(8) attachs md(4) devices | |||||
no=0 | |||||
while [ -c /dev/md$no ]; do | |||||
: $(( no += 1 )) | |||||
done | |||||
# Execute `func` for each combination of cipher, sectorsize, and hmac algo | # Execute `func` for each combination of cipher, sectorsize, and hmac algo | ||||
# `func` usage should be: | # `func` usage should be: | ||||
# func <cipher> <aalgo> <secsize> | # func <cipher> <aalgo> <secsize> | ||||
for_each_geli_config() { | for_each_geli_config() { | ||||
func=$1 | func=$1 | ||||
for cipher in aes-xts:128 aes-xts:256 \ | for cipher in aes-xts:128 aes-xts:256 \ | ||||
aes-cbc:128 aes-cbc:192 aes-cbc:256 \ | aes-cbc:128 aes-cbc:192 aes-cbc:256 \ | ||||
Show All 34 Lines | for secsize in 512 1024 2048 4096 8192; do | ||||
${func} $cipher $aalgo $secsize | ${func} $cipher $aalgo $secsize | ||||
done | done | ||||
done | done | ||||
} | } | ||||
geli_test_cleanup() | geli_test_cleanup() | ||||
{ | { | ||||
[ -c /dev/md${no}.eli ] && geli detach md${no}.eli | if [ -f "$TEST_MDS_FILE" ]; then | ||||
mdconfig -d -u $no | while read md; do | ||||
[ -c /dev/${md}.eli ] && \ | |||||
geli detach $md.eli 2>/dev/null | |||||
mdconfig -d -u $md 2>/dev/null | |||||
done < $TEST_MDS_FILE | |||||
fi | |||||
rm -f "$TEST_MDS_FILE" | |||||
} | } | ||||
trap geli_test_cleanup ABRT EXIT INT TERM | trap geli_test_cleanup ABRT EXIT INT TERM | ||||
. `dirname $0`/../geom_subr.sh | . `dirname $0`/../geom_subr.sh |