Deleted Added
full compact
geom_subr.sh (293821) geom_subr.sh (297183)
1#!/bin/sh
1#!/bin/sh
2# $FreeBSD: head/tests/sys/geom/class/geom_subr.sh 293821 2016-01-13 09:14:27Z ngie $
2# $FreeBSD: head/tests/sys/geom/class/geom_subr.sh 297183 2016-03-22 08:12:45Z ngie $
3
4devwait()
5{
6 while :; do
7 if [ -c /dev/${class}/${name} ]; then
8 return
9 fi
10 sleep 0.2

--- 19 unchanged lines hidden (view full) ---

30 echo "# Removing test memory disk: $test_md"
31 mdconfig -d -u $test_md
32 done < $TEST_MDS_FILE
33 fi
34 rm -f "$TEST_MDS_FILE"
35}
36
37if [ $(id -u) -ne 0 ]; then
3
4devwait()
5{
6 while :; do
7 if [ -c /dev/${class}/${name} ]; then
8 return
9 fi
10 sleep 0.2

--- 19 unchanged lines hidden (view full) ---

30 echo "# Removing test memory disk: $test_md"
31 mdconfig -d -u $test_md
32 done < $TEST_MDS_FILE
33 fi
34 rm -f "$TEST_MDS_FILE"
35}
36
37if [ $(id -u) -ne 0 ]; then
38 echo 'Tests must be run as root'
39 echo 'Bail out!'
40 exit 1
38 echo '1..0 # SKIP tests must be run as root'
39 exit 0
41fi
42# If the geom class isn't already loaded, try loading it.
43if ! kldstat -q -m g_${class}; then
44 if ! geom ${class} load; then
40fi
41# If the geom class isn't already loaded, try loading it.
42if ! kldstat -q -m g_${class}; then
43 if ! geom ${class} load; then
45 echo "Could not load module for geom class=${class}"
46 echo 'Bail out!'
47 exit 1
44 echo "1..0 # SKIP could not load module for geom class=${class}"
45 exit 0
48 fi
49fi
50
51# Need to keep track of the test md devices to avoid the scenario where a test
52# failing will cause the other tests to bomb out, or a test failing will leave
53# a large number of md(4) devices lingering around
54: ${TMPDIR=/tmp}
55export TMPDIR
56if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then
57 echo 'Failed to create temporary file for tracking the test md(4) devices'
58 echo 'Bail out!'
59 exit 1
60fi
46 fi
47fi
48
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
52: ${TMPDIR=/tmp}
53export TMPDIR
54if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then
55 echo 'Failed to create temporary file for tracking the test md(4) devices'
56 echo 'Bail out!'
57 exit 1
58fi