|
|
@@ -43,7 +43,7 @@ ggatessh_body() |
|
|
|
|
|
|
|
wait_for_ggate_device ${ggate_dev} |
|
|
|
|
|
|
|
# make sure it has correct size and sector sizekj |
|
|
|
# make sure it has correct size and sector size |
|
|
|
read _dev _secsize _size _nsecs _stripesize _stripeoff <<EOF |
|
|
|
$(diskinfo /dev/ggate$us) |
|
|
|
EOF |
|
|
@@ -109,7 +109,7 @@ ggatessh_resize_body() |
|
|
|
|
|
|
|
wait_for_ggate_device ${ggate_dev} |
|
|
|
|
|
|
|
# make sure it has correct size and sector sizekj |
|
|
|
# make sure it has correct size and sector size |
|
|
|
read _dev _secsize _size _nsecs _stripesize _stripeoff <<EOF |
|
|
|
$(diskinfo /dev/ggate$us) |
|
|
|
EOF |
|
|
@@ -153,6 +153,85 @@ ggatessh_resize_cleanup() |
|
|
|
common_cleanup |
|
|
|
} |
|
|
|
|
|
|
|
atf_test_case ggatessh_multises cleanup |
|
|
|
ggatessh_multises_head() |
|
|
|
{ |
|
|
|
atf_set "descr" "ggatessh will handle multiple sessions w/o looping" |
|
|
|
atf_set "require.progs" "ggatessh" |
|
|
|
atf_set "require.user" "root" |
|
|
|
atf_set "timeout" 20 |
|
|
|
} |
|
|
|
|
|
|
|
ggatessh_multises_body() |
|
|
|
{ |
|
|
|
|
|
|
|
n1mchunks=1 |
|
|
|
secsize=4096 |
|
|
|
us=$(alloc_ggate_dev) |
|
|
|
|
|
|
|
startup_sshd |
|
|
|
|
|
|
|
set -x |
|
|
|
truncate -s ${n1mchunks}m "$TESTIMG" |
|
|
|
# sshd authenticates and switches to USER |
|
|
|
chown "$USER" "$TESTIMG" |
|
|
|
|
|
|
|
echo 'WARNING: ggatessh error messages goes to syslog' \ |
|
|
|
'(aka /var/log/messages)' |
|
|
|
|
|
|
|
ggatessh create -i "$(pwd)/id_rsa" -p "$PORT" -F "$PIDFILE" \ |
|
|
|
-u $us -l "$USER" 127.0.0.1 "$(pwd)/$TESTIMG" |
|
|
|
|
|
|
|
ggate_dev=/dev/ggate${us} |
|
|
|
|
|
|
|
wait_for_ggate_device ${ggate_dev} |
|
|
|
|
|
|
|
# kill off ggate so we can schedule I/O |
|
|
|
pkill -F "$PIDFILE" |
|
|
|
|
|
|
|
# schedule some IO, to create a second session |
|
|
|
dd if=/dev/ggate$us of=/dev/null bs=1m & |
|
|
|
dd1pid="$!" |
|
|
|
dd if=/dev/ggate$us of=/dev/null bs=1m & |
|
|
|
dd2pid="$!" |
|
|
|
|
|
|
|
# restart ggate |
|
|
|
ggatessh rescue -v -i "$(pwd)/id_rsa" -p "$PORT" \ |
|
|
|
-u $us -l "$USER" 127.0.0.1 "$(pwd)/$TESTIMG" > ggatessh.log & |
|
|
|
ggatepid="$!" |
|
|
|
|
|
|
|
# This test will timeout if ggatessh exits before dd does, dump |
|
|
|
# the log to find out why |
|
|
|
|
|
|
|
# wait for IO to complete |
|
|
|
wait "$dd1pid" |
|
|
|
echo "dd exit:" $? |
|
|
|
|
|
|
|
wait "$dd2pid" |
|
|
|
echo "dd exit:" $? |
|
|
|
|
|
|
|
# kill off ggate |
|
|
|
kill "$ggatepid" |
|
|
|
wait "$ggatepid" |
|
|
|
|
|
|
|
#echo 'log:' |
|
|
|
#cat ggatessh.log |
|
|
|
#echo 'end of log' |
|
|
|
|
|
|
|
# make sure the second session was successfully created |
|
|
|
cnt=$(grep "new session created" ggatessh.log | wc -l) |
|
|
|
if [ "$cnt" -ne 1 ]; then |
|
|
|
echo "not the correct number of new sessions: $cnt" |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
ggatessh_multises_cleanup() |
|
|
|
{ |
|
|
|
|
|
|
|
common_cleanup |
|
|
|
} |
|
|
|
|
|
|
|
atf_test_case ggatessh_rowotest cleanup |
|
|
|
ggatessh_rowotest_head() |
|
|
|
{ |
|
|
@@ -192,7 +271,7 @@ ggatessh_rowotest_body() |
|
|
|
|
|
|
|
wait_for_ggate_device ${ggate_dev} |
|
|
|
|
|
|
|
# make sure it has correct size and sector sizekj |
|
|
|
# make sure it has correct size and sector size |
|
|
|
read _dev _secsize _size _nsecs _stripesize _stripeoff <<EOF |
|
|
|
$(diskinfo /dev/ggate$us) |
|
|
|
EOF |
|
|
@@ -250,6 +329,7 @@ atf_init_test_cases() |
|
|
|
{ |
|
|
|
atf_add_test_case ggatessh |
|
|
|
atf_add_test_case ggatessh_resize |
|
|
|
atf_add_test_case ggatessh_multises |
|
|
|
atf_add_test_case ggatessh_rowotest |
|
|
|
} |
|
|
|
|
|
|
|