-test_4() {
- local file1=$DIR/$tfile-1
- local file2=$DIR/$tfile-2
-
- ! $GSS_PIPEFS && skip "pipefs not used" && return
-
- chmod 0777 $DIR || error "chmod $DIR failed"
- # current access should be ok
- $RUNAS touch $file1 || error "can't touch $file1"
- [ -f $file1 ] || error "$file1 not found"
-
- # stop lgssd
- send_sigint client lgssd
- sleep 5
- check_gss_daemon_facet client lgssd && error "lgssd still running"
-
- # flush context, and touch
- $RUNAS $LFS flushctx $MOUNT || error "can't flush context on $MOUNT"
- $RUNAS touch $file2 &
- TOUCHPID=$!
- echo "waiting touch pid $TOUCHPID"
- wait $TOUCHPID && error "touch should fail"
-
- # restart lgssd
- do_facet client "$LGSSD -v"
- sleep 5
- check_gss_daemon_facet client lgssd
-
- # touch new should succeed
- $RUNAS touch $file2 || error "can't touch $file2"
- [ -f $file2 ] || error "$file2 not found"
-}
-run_test 4 "lgssd dead, operations should wait timeout and fail"
-
-test_5() {
- local file1=$DIR/$tfile-1
- local file2=$DIR/$tfile-2
- local wait_time=$((TIMEOUT + TIMEOUT / 2))
-
- chmod 0777 $DIR || error "chmod $DIR failed"
- # current access should be ok
- $RUNAS touch $file1 || error "can't touch $file1"
- [ -f $file1 ] || error "$file1 not found"
-
- # stop lsvcgssd
- send_sigint $(comma_list $(mdts_nodes)) lsvcgssd
- sleep 5
- check_gss_daemon_nodes $(comma_list $(mdts_nodes)) lsvcgssd && error "lsvcgssd still running"
-
- # flush context, and touch
- $RUNAS $LFS flushctx $MOUNT || error "can't flush context on $MOUNT"
- $RUNAS touch $file2 &
- TOUCHPID=$!
-
- # wait certain time
- echo "waiting $wait_time seconds for touch pid $TOUCHPID"
- sleep $wait_time
- num=`ps --no-headers -p $TOUCHPID | wc -l`
- [ $num -eq 1 ] || error "touch already ended ($num)"
- echo "process $TOUCHPID still hanging there... OK"
-
- # restart lsvcgssd, expect touch suceed
- echo "restart lsvcgssd and recovering"
- start_gss_daemons $(comma_list $(mdts_nodes)) "$LSVCGSSD -v"
- sleep 5
- check_gss_daemon_nodes $(comma_list $(mdts_nodes)) lsvcgssd
- wait $TOUCHPID || error "touch fail"
- [ -f $file2 ] || error "$file2 not found"
-}
-run_test 5 "lsvcgssd dead, operations lead to recovery"
-