X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Freplay-vbr.sh;h=1ad92881689a22f7125287ff232482ec9915745b;hb=1ba7eb520d6f50908985b45cb1aecad83bdf9c63;hp=e1af41b987b8f338f2755afc3ebb50e095185a79;hpb=8c4f96f910786ff3d73474ef5f8d4a96a30a0bed;p=fs%2Flustre-release.git diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index e1af41b..1ad9288 100644 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- +# vim:shiftwidth=4:softtabstop=4:tabstop=4: set -e @@ -10,6 +12,7 @@ LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} SETUP=${SETUP:-} CLEANUP=${CLEANUP:-} MOUNT_2=${MOUNT_2:-"yes"} +export MULTIOP=${MULTIOP:-multiop} . $LUSTRE/tests/test-framework.sh init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} @@ -55,23 +58,23 @@ rmultiop_start() { # /tmp/multiop_bg.pid file local pid_file=$TMP/multiop_bg.pid.$$ - do_node $client "MULTIOP_PID_FILE=$pid_file LUSTRE= sh runmultiop_bg_pause $file $cmds" & + do_node $client "MULTIOP_PID_FILE=$pid_file LUSTRE= runmultiop_bg_pause $file $cmds" & local pid=$! sleep 3 local multiop_pid multiop_pid=$(do_node $client cat $pid_file) [ -n "$multiop_pid" ] || error "$client : Can not get multiop_pid from $pid_file " - eval export $(client_var_name $client)_multiop_pid=$multiop_pid - eval export $(client_var_name $client)_do_node_pid=$pid - local var=$(client_var_name $client)_multiop_pid + eval export $(node_var_name $client)_multiop_pid=$multiop_pid + eval export $(node_var_name $client)_do_node_pid=$pid + local var=$(node_var_name $client)_multiop_pid echo client $client multiop_bg started multiop_pid=${!var} return $? } rmultiop_stop() { local client=$1 - local multiop_pid=$(client_var_name $client)_multiop_pid - local do_node_pid=$(client_var_name $client)_do_node_pid + local multiop_pid=$(node_var_name $client)_multiop_pid + local do_node_pid=$(node_var_name $client)_do_node_pid echo "Stopping multiop_pid=${!multiop_pid} (kill ${!multiop_pid} on $client)" do_node $client kill -USR1 ${!multiop_pid} @@ -86,13 +89,31 @@ get_version() { local fid fid=$(do_node $client $LFS path2fid $file) - do_facet $SINGLEMDS $LCTL --device ${!var} getobjversion $fid + do_facet $SINGLEMDS $LCTL --device ${!var} getobjversion \\\"$fid\\\" } #save COS setting cos_param_file=$TMP/rvbr-cos-params save_lustre_params $(comma_list $(mdts_nodes)) "mdt.*.commit_on_sharing" > $cos_param_file +test_0a() { + get_version $CLIENT1 $DIR/$tdir/1a || true +} +run_test 0a "getversion for non existent file shouldn't cause kernel panic" + +test_0b() { + local var=${SINGLEMDS}_svc + local fid + local file=$DIR/$tdir/f + + do_node $CLIENT1 mkdir -p $DIR/$tdir/ + do_node $CLIENT1 touch $file + fid=$(do_node $CLIENT1 $LFS path2fid $file) + do_node $CLIENT1 rm -rf $file + do_facet $SINGLEMDS $LCTL --device ${!var} getobjversion \\\"$fid\\\" || true +} +run_test 0b "getversion for non existent fid shouldn't cause kernel panic" + # test set #1: OPEN test_1a() { # former test_0a local file=$DIR/$tfile