3 # run tests on different directories at the same time
8 SRCDIR=$(cd $(dirname $0); echo $PWD)
9 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
13 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
14 . $LUSTRE/tests/test-framework.sh
16 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
19 PARALLEL_RUNS=${PARALLEL_RUNS:-2}
22 check_and_setup_lustre
30 prepare_running_directories()
36 for i in $(seq $PARALLEL_RUNS); do
37 rm -rf $ORIGIN_DIR/dir$i
38 if [ $MDSCOUNT -gt 1 ]; then
39 mdtidx=$((i % MDSCOUNT))
40 $LFS mkdir -i $mdtidx $ORIGIN_DIR/dir$i || rc=$?
42 mkdir -p $ORIGIN_DIR/dir$i
46 echo "can not create dir$i"
54 prepare_running_directories || error "Can not create running directories"
56 cleanup_running_directories()
61 for i in $(seq $PARALLEL_RUNS); do
62 rm -rf $ORIGIN_DIR/dir$i || rc=$?
70 [ ! -f sanity.sh ] && skip_env "No sanity.sh skipping"
78 for index in $(seq $PARALLEL_RUNS); do
79 DIR=$ORIGIN_DIR/dir${index} PARALLEL=yes \
80 EXT2_DEV="$TMP/SANITY.LOOP_${index}" \
81 LOGDIR="${LOGDIR}_${index}" YAML_LOG="" sh sanity.sh &
83 echo start sanity: $pid
87 echo sanity pids: $rpids
91 echo "pid=$pid rc=$rc"
99 run_test sanity "Run sanity parallel on different directories at the same time"
101 cleanup_running_directories || error "unlink running directories"
104 check_and_cleanup_lustre