* [PATCH] xfstests: fix broken redirects in generic/131
@ 2013-05-01 7:53 Dave Chinner
0 siblings, 0 replies; only message in thread
From: Dave Chinner @ 2013-05-01 7:53 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
generic/131 attempts to kill processes that may no longer exist when
the test finishes and has a broken redirect for the error messages
and they end up in a file nemaed "1" in the xfstests root instead of
/dev/null.
Not only that, the attempts to redirect stderr to stdout in the
middle of the test use incorrect redirect syntax, so they create an
empty file named "1" in the xfstests root...
IOWs, all the redirects in the test are broken. Fix them and clean
up the failure case to use the exit trap to trigger the cleanup
function....
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tests/generic/131 | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/tests/generic/131 b/tests/generic/131
index 95eb612..6c3131c 100755
--- a/tests/generic/131
+++ b/tests/generic/131
@@ -33,8 +33,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
- kill $locktest_pid2 2&>1 /dev/null
- kill $locktest_pid1 2&>1 /dev/null
+ kill $locktest_pid2 > /dev/null 2>&1
+ kill $locktest_pid1 > /dev/null 2>&1
_cleanup_testdir
}
@@ -60,23 +60,21 @@ elif [ $$ -gt 32000 ]; then
fi
# Start the server
-src/locktest -p $PORT $TESTFILE > $testdir/server.out 2>&1 &
+src/locktest -p $PORT $TESTFILE 2>&1 > $testdir/server.out &
locktest_pid1=$!
sleep 1
# Start the client
-src/locktest -p $PORT -h localhost $TESTFILE > $testdir/client.out 2>&1
+src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $testdir/client.out
locktest_pid2=$!
result=$?
if [ $result -eq 0 ]; then
- echo success!
+ echo success!
+ status=0
else
- echo "Client reported failure ($result)"
- cat $testdir/*.out
- _cleanup
- exit $status
+ echo "Client reported failure ($result)"
+ cat $testdir/*.out
fi
-status=0
exit
--
1.7.10.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-05-01 7:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 7:53 [PATCH] xfstests: fix broken redirects in generic/131 Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox