+iozone_bg () {
+ local args=$@
+
+ local tmppipe=$TMP/${TESTSUITE}.${TESTNAME}.pipe
+ mkfifo $tmppipe
+
+ echo "+ iozone $args"
+ iozone $args > $tmppipe &
+
+ local pid=$!
+
+ echo "tmppipe=$tmppipe"
+ echo iozone pid=$pid
+
+ # iozone exit code is 0 even if iozone is not completed
+ # need to check iozone output on "complete"
+ local iozonelog=$TMP/${TESTSUITE}.iozone.log
+ rm -f $iozonelog
+ cat $tmppipe | while read line ; do
+ echo "$line"
+ echo "$line" >>$iozonelog
+ done;
+
+ local rc=0
+ wait $pid
+ rc=$?
+ if ! $(tail -1 $iozonelog | grep -q complete); then
+ echo iozone failed!
+ rc=1
+ fi
+ rm -f $tmppipe
+ rm -f $iozonelog
+ return $rc
+}
+