109d98641SEnji Cooper#!/bin/sh 209d98641SEnji Cooper 309d98641SEnji Cooper. `dirname $0`/conf.sh 409d98641SEnji Cooper 509d98641SEnji Cooperecho "1..4" 609d98641SEnji Cooper 709d98641SEnji Coopernblocks1=1024 809d98641SEnji Coopernblocks2=`expr $nblocks1 + 1` 909d98641SEnji Coopersrc=`mktemp $base.XXXXXX` || exit 1 1009d98641SEnji Cooperdst=`mktemp $base.XXXXXX` || exit 1 1109d98641SEnji Cooper 1209d98641SEnji Cooperdd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 1309d98641SEnji Cooper 14*96950419SGleb Smirnoffattach_md us0 -t malloc -s $nblocks2 || exit 1 15*96950419SGleb Smirnoffattach_md us1 -t malloc -s $nblocks2 || exit 1 16*96950419SGleb Smirnoffattach_md us2 -t malloc -s $nblocks2 || exit 1 1709d98641SEnji Cooper 1809d98641SEnji Coopergshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 1909d98641SEnji Cooperdevwait 2009d98641SEnji Cooper 2109d98641SEnji Cooperdd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 2209d98641SEnji Cooper 2309d98641SEnji Cooperdd if=/dev/shsec/${name} of=${dst} count=$nblocks1 >/dev/null 2>&1 2409d98641SEnji Cooperif [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then 2509d98641SEnji Cooper echo "not ok 1" 2609d98641SEnji Cooperelse 2709d98641SEnji Cooper echo "ok 1" 2809d98641SEnji Cooperfi 2909d98641SEnji Cooper 3009d98641SEnji Cooperdd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 3109d98641SEnji Cooperif [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then 3209d98641SEnji Cooper echo "not ok 2" 3309d98641SEnji Cooperelse 3409d98641SEnji Cooper echo "ok 2" 3509d98641SEnji Cooperfi 3609d98641SEnji Cooper 3709d98641SEnji Cooperdd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 3809d98641SEnji Cooperif [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then 3909d98641SEnji Cooper echo "not ok 3" 4009d98641SEnji Cooperelse 4109d98641SEnji Cooper echo "ok 3" 4209d98641SEnji Cooperfi 4309d98641SEnji Cooper 4409d98641SEnji Cooperdd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 4509d98641SEnji Cooperif [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then 4609d98641SEnji Cooper echo "not ok 4" 4709d98641SEnji Cooperelse 4809d98641SEnji Cooper echo "ok 4" 4909d98641SEnji Cooperfi 5009d98641SEnji Cooper 5109d98641SEnji Cooperrm -f ${src} ${dst} 52