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