xref: /freebsd/tools/regression/geom/RunTest.t (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
1#!/bin/sh
2
3MD=34
4TMP=/tmp/$$
5
6set -e
7
8# Start from the right directory so we can find all our data files.
9cd `dirname $0`
10
11(cd MdLoad && make) > /dev/null 2>&1
12
13# Print the test header
14echo -n '1..'
15echo `ls -1 Data/disk.*.xml | wc -l`
16
17for f in Data/disk.*.xml
18do
19	b=`basename $f`
20	mdconfig -d -u $MD > /dev/null 2>&1 || true
21	if [ -c /dev/md$MD ] ; then
22		sleep 1
23	fi
24	if [ -c /dev/md$MD ] ; then
25		sleep 1
26	fi
27	if [ -c /dev/md$MD ] ; then
28		echo "Bail out!"
29		echo "/dev/md$MD is busy"
30		exit 1
31	fi
32	MdLoad/MdLoad md${MD} $f
33	if [ -f Ref/$b ] ; then
34		if diskinfo /dev/md${MD}* |
35		   diff -I '\$FreeBSD' -u Ref/$b - > $TMP; then
36			echo "ok - $b"
37		else
38			echo "not ok - $b"
39			sed 's/^/# /' $TMP
40		fi
41	else
42		diskinfo /dev/md${MD}* > Ref/`basename $f`
43	fi
44done
45
46mdconfig -d -u $MD > /dev/null 2>&1 || true
47rm -f $TMP
48
49exit 0
50