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-823081.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/bugs/bug-823081.t') diff --git a/tests/bugs/bug-823081.t b/tests/bugs/bug-823081.t index 15b38517945..e8630521b64 100755 --- a/tests/bugs/bug-823081.t +++ b/tests/bugs/bug-823081.t @@ -22,20 +22,20 @@ function set_tail () set_tail $V0; TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; -tail=`tail --lines=1 $logdir/$cmd_log_history | cut -d " " -f 5-` +tail=`tail -n 1 $logdir/$cmd_log_history | cut -d " " -f 5-` TEST [[ \"$tail\" == \"$tail_success\" ]] TEST ! $CLI volume create $V0 $H0:$B0/${V0}{1,2}; -tail=`tail --lines=1 $logdir/$cmd_log_history | cut -d " " -f 5-` +tail=`tail -n 1 $logdir/$cmd_log_history | cut -d " " -f 5-` TEST [[ \"$tail\" == \"$tail_failure\" ]] set_tail $V1; TEST gluster volume create $V1 $H0:$B0/${V1}{1,2} force; -tail=`tail --lines=1 $logdir/$cmd_log_history | cut -d " " -f 5-` +tail=`tail -n 1 $logdir/$cmd_log_history | cut -d " " -f 5-` TEST [[ \"$tail\" == \"$tail_success_force\" ]] TEST ! gluster volume create $V1 $H0:$B0/${V1}{1,2} force; -tail=`tail --lines=1 $logdir/$cmd_log_history | cut -d " " -f 5-` +tail=`tail -n 1 $logdir/$cmd_log_history | cut -d " " -f 5-` TEST [[ \"$tail\" == \"$tail_failure_force\" ]] cleanup; -- cgit