From 51eaed7fb243a989fdf96461ba2d9acfc07977f8 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Wed, 26 Nov 2014 09:59:25 +0100 Subject: Regression test portability: batch of bugs (volume 2) Fix various regression test portability in tests/bugs. bug-861542.t - Avoid syntax specific to GNU sed. bug-860663.t - Command argument length is system dependent, and specifying 1000 file path may overflow it. Use a C program to do the job in a portable and efficient way. - Add a test that we created the specified amount of files. bug-858242.c, bug-808400-fcntl.c, bug-808400-flock.c - fstat64() is Linux-specific. Define it as fstat for other systems. bug-823081.t - Use portable tail -n instead of tail --lines In many tests: - Do not assume python interpreter name. Use $PYTHON as defined in env.rc by configure. utils/libcxattr.py - If python version is 2.6 or higher, use a portable mechanism to recover errno. The original version is retained for python version 2.5 and earlier but it only works on Linux. BUG: 1129939 Change-Id: If2fea1ffec5cc6ab2de426fb200e884450afe61b Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/9097 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/bugs/bug-860663.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/bugs/bug-860663.t') diff --git a/tests/bugs/bug-860663.t b/tests/bugs/bug-860663.t index a4b3d71fb78..555a63436ba 100644 --- a/tests/bugs/bug-860663.t +++ b/tests/bugs/bug-860663.t @@ -17,6 +17,8 @@ function file_count() BRICK_COUNT=3 +build_tester $(dirname $0)/bug-860663.c + TEST glusterd TEST pidof glusterd @@ -26,9 +28,10 @@ TEST $CLI volume start $V0 ## Mount FUSE TEST glusterfs -s $H0 --volfile-id $V0 $M0; -TEST touch $M0/files{1..10000}; +TEST $(dirname $0)/bug-860663 $M0/files 10000 ORIG_FILE_COUNT=`ls -l $M0 | wc -l`; +TEST [ $ORIG_FILE_COUNT -ge 10000 ] # Kill a brick process kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; @@ -37,7 +40,7 @@ TEST $CLI volume rebalance $V0 fix-layout start sleep 30; -TEST ! touch $M0/files{1..10000}; +TEST ! $(dirname $0)/bug-860663 $M0/files 10000 TEST $CLI volume start $V0 force @@ -47,4 +50,5 @@ NEW_FILE_COUNT=`ls -l $M0 | wc -l`; EXPECT "0" file_count $ORIG_FILE_COUNT $NEW_FILE_COUNT +rm -f $(dirname $0)/bug-860663 cleanup; -- cgit