xref: /freebsd/tests/sys/geom/class/shsec/1_test.sh (revision 96950419f15510287080c557174e0d8409f06956)
109d98641SEnji Cooper#!/bin/sh
209d98641SEnji Cooper
309d98641SEnji Cooper. `dirname $0`/conf.sh
409d98641SEnji Cooper
509d98641SEnji Cooperecho "1..2"
609d98641SEnji Cooper
7*96950419SGleb Smirnoffattach_md us0 -t malloc -s 1M || exit 1
8*96950419SGleb Smirnoffattach_md us1 -t malloc -s 2M || exit 1
9*96950419SGleb Smirnoffattach_md us2 -t malloc -s 3M || exit 1
1009d98641SEnji Cooper
1109d98641SEnji Coopergshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1
1209d98641SEnji Cooperdevwait
1309d98641SEnji Cooper
1409d98641SEnji Cooper# Size of created device should be 1MB - 512B.
1509d98641SEnji Cooper
1609d98641SEnji Coopermediasize=`diskinfo /dev/shsec/${name} | awk '{print $3}'`
1709d98641SEnji Cooperif [ $mediasize -eq 1048064 ]; then
1809d98641SEnji Cooper	echo "ok 1"
1909d98641SEnji Cooperelse
2009d98641SEnji Cooper	echo "not ok 1"
2109d98641SEnji Cooperfi
2209d98641SEnji Coopersectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'`
2309d98641SEnji Cooperif [ $sectorsize -eq 512 ]; then
2409d98641SEnji Cooper	echo "ok 2"
2509d98641SEnji Cooperelse
2609d98641SEnji Cooper	echo "not ok 2"
2709d98641SEnji Cooperfi
28