xref: /freebsd/tests/sys/geom/class/concat/2_test.sh (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1#!/bin/sh
2
3. `dirname $0`/conf.sh
4
5echo '1..1'
6
7tsize=6
8src=`mktemp $base.XXXXXX` || exit 1
9dst=`mktemp $base.XXXXXX` || exit 1
10
11us0=$(attach_md -t malloc -s 1M) || exit 1
12us1=$(attach_md -t malloc -s 2M) || exit 1
13us2=$(attach_md -t malloc -s 3M) || exit 1
14
15dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1
16
17gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1
18devwait
19
20dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1
21dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1
22
23if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
24	echo "not ok - md5 checksum comparison"
25else
26	echo "ok - md5 checksum comparison"
27fi
28
29rm -f ${src} ${dst}
30