ngie 659556353b - Add a geom_shsec specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-01-08 21:25:27 +00:00

16 lines
256 B
Bash

#!/bin/sh
# $FreeBSD$
name="$(mktemp -u shsec.XXXXXX)"
class="shsec"
base=`basename $0`
shsec_test_cleanup()
{
[ -c /dev/$class/$name ] && gshsec stop $name
geom_test_cleanup
}
trap shsec_test_cleanup ABRT EXIT INT TERM
. `dirname $0`/../geom_subr.sh