Whamcloud - gitweb
b=20054
[fs/lustre-release.git] / lustre / tests / runmultiop_bg_pause
1 #!/bin/bash
2
3 # Run multiop in the background, but wait for it to print
4 # "PAUSING" to its stdout before returning from this function.
5
6 PTLDEBUG=${PTLDEBUG:--1}
7 LUSTRE=${LUSTRE:-`dirname $0`/..}
8 . $LUSTRE/tests/test-framework.sh
9
10 TMP=${TMP:-/tmp}
11 MULTIOP_PID_FILE=${MULTIOP_PID_FILE:-$TMP/multiop_bg.pid}
12 rm -f $MULTIOP_PID_FILE
13
14 pid=$(multiop_bg_pause $* | tail -1)
15 rc=${PIPESTATUS[0]}
16
17 [ "$rc" = 0 ] && echo $pid > $MULTIOP_PID_FILE
18 exit $rc