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