ggate_test.sh (313753) | ggate_test.sh (323300) |
---|---|
1# $FreeBSD: stable/11/tests/sys/geom/class/gate/ggate_test.sh 313753 2017-02-15 00:15:24Z asomers $ | 1# $FreeBSD: stable/11/tests/sys/geom/class/gate/ggate_test.sh 323300 2017-09-08 04:39:59Z ngie $ |
2 3PIDFILE=ggated.pid 4PLAINFILES=plainfiles 5PORT=33080 6CONF=gg.exports 7 8atf_test_case ggated cleanup 9ggated_head() 10{ 11 atf_set "descr" "ggated can proxy geoms" 12 atf_set "require.progs" "ggatec ggated" 13 atf_set "require.user" "root" 14 atf_set "timeout" 60 15} 16 17ggated_body() 18{ | 2 3PIDFILE=ggated.pid 4PLAINFILES=plainfiles 5PORT=33080 6CONF=gg.exports 7 8atf_test_case ggated cleanup 9ggated_head() 10{ 11 atf_set "descr" "ggated can proxy geoms" 12 atf_set "require.progs" "ggatec ggated" 13 atf_set "require.user" "root" 14 atf_set "timeout" 60 15} 16 17ggated_body() 18{ |
19 load_ggate 20 |
|
19 us=$(alloc_ggate_dev) 20 work=$(alloc_md) 21 src=$(alloc_md) 22 23 atf_check -e ignore -o ignore \ 24 dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc 25 atf_check -e ignore -o ignore \ 26 dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc --- 25 unchanged lines hidden (view full) --- 52 atf_set "descr" "ggatel can proxy files" 53 atf_set "require.progs" "ggatel" 54 atf_set "require.user" "root" 55 atf_set "timeout" 15 56} 57 58ggatel_file_body() 59{ | 21 us=$(alloc_ggate_dev) 22 work=$(alloc_md) 23 src=$(alloc_md) 24 25 atf_check -e ignore -o ignore \ 26 dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc 27 atf_check -e ignore -o ignore \ 28 dd if=/dev/random of=/dev/$src bs=1m count=1 conv=notrunc --- 25 unchanged lines hidden (view full) --- 54 atf_set "descr" "ggatel can proxy files" 55 atf_set "require.progs" "ggatel" 56 atf_set "require.user" "root" 57 atf_set "timeout" 15 58} 59 60ggatel_file_body() 61{ |
62 load_ggate 63 |
|
60 us=$(alloc_ggate_dev) 61 62 echo src work >> ${PLAINFILES} 63 dd if=/dev/random of=work bs=1m count=1 64 dd if=/dev/random of=src bs=1m count=1 65 66 atf_check ggatel create -u $us work 67 --- 18 unchanged lines hidden (view full) --- 86 atf_set "descr" "ggatel can proxy files" 87 atf_set "require.progs" "ggatel" 88 atf_set "require.user" "root" 89 atf_set "timeout" 15 90} 91 92ggatel_md_body() 93{ | 64 us=$(alloc_ggate_dev) 65 66 echo src work >> ${PLAINFILES} 67 dd if=/dev/random of=work bs=1m count=1 68 dd if=/dev/random of=src bs=1m count=1 69 70 atf_check ggatel create -u $us work 71 --- 18 unchanged lines hidden (view full) --- 90 atf_set "descr" "ggatel can proxy files" 91 atf_set "require.progs" "ggatel" 92 atf_set "require.user" "root" 93 atf_set "timeout" 15 94} 95 96ggatel_md_body() 97{ |
98 load_ggate 99 |
|
94 us=$(alloc_ggate_dev) 95 work=$(alloc_md) 96 src=$(alloc_md) 97 98 atf_check -e ignore -o ignore \ 99 dd if=/dev/random of=$work bs=1m count=1 conv=notrunc 100 atf_check -e ignore -o ignore \ 101 dd if=/dev/random of=$src bs=1m count=1 conv=notrunc --- 88 unchanged lines hidden (view full) --- 190 while read test_md; do 191 mdconfig -d -u $test_md 2>/dev/null 192 done < md.devs 193 rm md.devs 194 fi 195 true 196} 197 | 100 us=$(alloc_ggate_dev) 101 work=$(alloc_md) 102 src=$(alloc_md) 103 104 atf_check -e ignore -o ignore \ 105 dd if=/dev/random of=$work bs=1m count=1 conv=notrunc 106 atf_check -e ignore -o ignore \ 107 dd if=/dev/random of=$src bs=1m count=1 conv=notrunc --- 88 unchanged lines hidden (view full) --- 196 while read test_md; do 197 mdconfig -d -u $test_md 2>/dev/null 198 done < md.devs 199 rm md.devs 200 fi 201 true 202} 203 |
204load_ggate() 205{ 206 local class=gate 207 208 # If the geom class isn't already loaded, try loading it. 209 if ! kldstat -q -m g_${class}; then 210 if ! geom ${class} load; then 211 atf_skip "could not load module for geom class=${class}" 212 fi 213 fi 214} 215 |
|
198# Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` 199# isn't called with `-v`. 200wait_for_ggate_device() 201{ 202 ggate_device=$1 203 204 while [ ! -c $ggate_device ]; do 205 sleep 0.5 206 done 207} | 216# Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` 217# isn't called with `-v`. 218wait_for_ggate_device() 219{ 220 ggate_device=$1 221 222 while [ ! -c $ggate_device ]; do 223 sleep 0.5 224 done 225} |