7 if [ -c /dev/${class}/${name} ]; then
18 test_md=$(mdconfig -a "$@") || exit
19 echo $test_md >> $TEST_MDS_FILE || exit
27 if [ -f "$TEST_MDS_FILE" ]; then
28 while read test_md; do
29 # The "#" tells the TAP parser this is a comment
30 echo "# Removing test memory disk: $test_md"
31 mdconfig -d -u $test_md
34 rm -f "$TEST_MDS_FILE"
37 if [ $(id -u) -ne 0 ]; then
38 echo '1..0 # SKIP tests must be run as root'
41 # If the geom class isn't already loaded, try loading it.
42 if ! kldstat -q -m g_${class}; then
43 if ! geom ${class} load; then
44 echo "1..0 # SKIP could not load module for geom class=${class}"
49 # Need to keep track of the test md devices to avoid the scenario where a test
50 # failing will cause the other tests to bomb out, or a test failing will leave
51 # a large number of md(4) devices lingering around
54 if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then
55 echo 'Failed to create temporary file for tracking the test md(4) devices'