xref: /freebsd/tests/sys/geom/class/concat/2_test.sh (revision 3f0efe05432b1633991114ca4ca330102a561959)
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
11attach_md us0 -t malloc -s 1M || exit 1
12attach_md us1 -t malloc -s 2M || exit 1
13attach_md us2 -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