xref: /freebsd/tools/regression/geom/RunTest.sh (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1#!/bin/sh
2
3MD=34
4TMP=/tmp/$$
5
6set -e
7
8r=0
9
10(cd MdLoad && make) > /dev/null 2>&1
11
12for f in Data/disk.*.xml
13do
14	b=`basename $f`
15	mdconfig -d -u $MD > /dev/null 2>&1 || true
16	if [ -c /dev/md$MD ] ; then
17		sleep 1
18	fi
19	if [ -c /dev/md$MD ] ; then
20		sleep 1
21	fi
22	if [ -c /dev/md$MD ] ; then
23		echo "/dev/md$MD is busy" 1>&2
24		exit 1
25	fi
26	MdLoad/MdLoad md${MD} $f
27	if [ -f Ref/$b ] ; then
28		if diskinfo /dev/md${MD}* |
29		   diff -I '$FreeBSD' -u Ref/$b - > $TMP; then
30			echo "PASSED: $b"
31		else
32			echo "FAILED: $b"
33			sed 's/^/	/' $TMP
34			r=2;
35		fi
36	else
37		diskinfo /dev/md${MD}* > Ref/`basename $f`
38	fi
39done
40
41mdconfig -d -u $MD > /dev/null 2>&1 || true
42rm -f $TMP
43exit $r
44