Whamcloud - gitweb
LU-14739 quota: nodemap squashed root cannot bypass quota
[fs/lustre-release.git] / lustre / tests / replay-vbr.sh
index 46a96d6..7955f4c 100755 (executable)
@@ -1,27 +1,20 @@
 #!/bin/bash
-# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
 
 set -e
 
-# bug number:
-ALWAYS_EXCEPT=" $REPLAY_VBR_EXCEPT"
-
-SAVE_PWD=$PWD
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-SETUP=${SETUP:-}
-CLEANUP=${CLEANUP:-}
 MOUNT_2=${MOUNT_2:-"yes"}
-export MULTIOP=${MULTIOP:-multiop}
+
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
 
+ALWAYS_EXCEPT=" $REPLAY_VBR_EXCEPT"
+
 #                                  ~6  (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="7"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="7 "
 
 build_test_filter
 
@@ -42,60 +35,6 @@ CLIENT2=${CLIENT2:-$CLIENT1}
 
 is_mounted $MOUNT2 || error "MOUNT2 is not mounted"
 
-rmultiop_start() {
-       local client=$1
-       local file=$2
-       local cmds=$3
-       local WAIT_MAX=${4:-60}
-       local wait_time=0
-
-       # We need to run do_node in bg, because pdsh does not exit
-       # if child process of run script exists.
-       # I.e. pdsh does not exit when runmultiop_bg_pause exited,
-       # because of multiop_bg_pause -> $MULTIOP_PROG &
-       # By the same reason we need sleep a bit after do_nodes starts
-       # to let runmultiop_bg_pause start muliop and
-       # update /tmp/multiop_bg.pid ;
-       # The rm /tmp/multiop_bg.pid guarantees here that
-       # we have the updated by runmultiop_bg_pause
-       # /tmp/multiop_bg.pid file
-
-       local pid_file=$TMP/multiop_bg.pid.$$
-       do_node $client "MULTIOP_PID_FILE=$pid_file LUSTRE= \
-                       runmultiop_bg_pause $file $cmds" &
-       local pid=$!
-       local multiop_pid
-
-       while [[ $wait_time -lt $WAIT_MAX ]]; do
-               sleep 3
-               wait_time=$((wait_time + 3))
-               multiop_pid=$(do_node $client cat $pid_file)
-               if [ -n "$multiop_pid" ]; then
-                       break
-               fi
-       done
-
-       [ -n "$multiop_pid" ] ||
-               error "$client : Can not get multiop_pid from $pid_file "
-
-       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=$(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}
-
-    wait ${!do_node_pid}
-}
-
 #
 # get_version(): Gets the version of an object on servers
 # Parameter1: Client/Machine Name
@@ -175,7 +114,7 @@ test_1b() { # former test_0b
 
     do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
-    do_node $CLIENT1 mkdir -p -m 755 $MOUNT/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
@@ -273,7 +212,7 @@ test_2b() { # former test_0e
     do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
-    do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
@@ -321,7 +260,7 @@ test_3b() { # former test_0g
     do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
-    do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
     do_node $CLIENT1 mcreate $DIR/$tdir/$tfile
 
     replay_barrier $SINGLEMDS
@@ -591,7 +530,7 @@ test_5a() { # former test_0s
        local tp_post
 
        do_node $CLIENT1 mcreate $DIR/$tfile
-       do_node $CLIENT1 mkdir -p $DIR/$tdir
+       do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $DIR/$tdir
        pre=$(chk_get_version $CLIENT1 $DIR/$tfile)
        tp_pre=$(chk_get_version $CLIENT1 $DIR/$tdir)
        do_node $CLIENT1 link $DIR/$tfile $DIR/$tdir/$tfile
@@ -615,7 +554,7 @@ test_5b() { # former test_0t
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
     do_node $CLIENT1 mcreate $DIR/$tfile
-    do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
@@ -638,7 +577,7 @@ test_5c() { # former test_0u
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
     do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile
-    do_node $CLIENT1 mkdir -p $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 666 $MOUNT2/$tfile
@@ -660,7 +599,7 @@ test_6a() { # former test_0v
        local tp_post
 
        do_node $CLIENT1 mcreate $DIR/$tfile
-       do_node $CLIENT1 mkdir -p $DIR/$tdir
+       do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
        sp_pre=$(chk_get_version $CLIENT1 $DIR)
        tp_pre=$(chk_get_version $CLIENT1 $DIR/$tdir)
        do_node $CLIENT1 mv $DIR/$tfile $DIR/$tdir/$tfile
@@ -699,7 +638,7 @@ test_6c() { # former test_0x
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
     do_node $CLIENT1 mcreate $DIR/$tfile
-    do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 777 $MOUNT2
@@ -722,7 +661,7 @@ test_6d() { # former test_0y
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
     do_node $CLIENT1 mcreate $DIR/$tfile
-    do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
 
     replay_barrier $SINGLEMDS
     do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
@@ -753,7 +692,7 @@ test_7_cycle() {
     do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
-    do_node $CLIENT1 mkdir -p $DIR/$tdir
+    do_node $CLIENT1 $LFS mkdir -i 0 -c 1 $MOUNT/$tdir
     replay_barrier $SINGLEMDS
     # first operation
     echo "$cname first: $first"
@@ -916,21 +855,20 @@ test_7f() {
 run_test 7f "unlink, {lost}, rename"
 
 test_7g() {
-    first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
-    lost="mkdir $MOUNT2/$tdir/$tfile-0;rmdir $MOUNT2/$tdir/$tfile-0"
-    last="createmany -o $DIR/$tdir/$tfile- 1"
-    test_7_cycle "$first" "$lost" "$last" && error "Test 7g.1 failed"
-
-    first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
-    lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0"
-    last="mkdir $DIR/$tdir/$tfile-0"
-    test_7_cycle "$first" "$lost" "$last" && error "Test 7g.2 failed"
-
-    first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
-    lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
-    last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
-       if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.1) ]
-       then
+       first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
+       lost="mkdir $MOUNT2/$tdir/$tfile-0;rmdir $MOUNT2/$tdir/$tfile-0"
+       last="createmany -o $DIR/$tdir/$tfile- 1"
+       test_7_cycle "$first" "$lost" "$last" && error "Test 7g.1 failed"
+
+       first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
+       lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0"
+       last="mkdir $DIR/$tdir/$tfile-0"
+       test_7_cycle "$first" "$lost" "$last" && error "Test 7g.2 failed"
+
+       first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
+       lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
+       last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
+       if [ "$MDS1_VERSION" -lt $(version_code 2.5.1) ]; then
                test_7_cycle "$first" "$lost" "$last" ||
                        error "Test 7g.3 failed"
        else #LU-4442 LU-3528