From aff367a601351ff7bfbfc572d6ae0d4ffafae0f0 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Mon, 30 Mar 2015 05:43:12 +0200 Subject: Tests: portability fixes Fix various portability problems in mount-nfs-auth.t, quota-ancestry-building.t and trash.t: - dd bs=1M is not portable, use dd bs=1024k instead - dd bs=1MB is not portable iether, use dd bs=1000000 instead - After restarting NFS service, wait for it to become available - After killing a process, wait for it to terminate - BSD awk does not accept a=b="", use a=""; b="" instead - NetBSD displays the original program name in paenthesis at the end of ps output. Strip it using sed 's/ *([^()]*)$//' is we want just the command - Do no use umount $N0, which leads to many troubles solved by EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" umount_nfs $N0 - The -p option for mkdir must be before the directory name - du -b is not portable. Use ls -l instead. BUG: 1129939 Change-Id: I3d44a10a37d47ebb6a263c206566487e3ffb85d8 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/10033 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Anoop C S Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- tests/features/trash.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/features/trash.t') diff --git a/tests/features/trash.t b/tests/features/trash.t index e0b85dafaf0..cbcff237f35 100755 --- a/tests/features/trash.t +++ b/tests/features/trash.t @@ -51,9 +51,9 @@ truncate_op() { sleep 2 test -e $M0/$1 - test $(du -b $M0/$1 | awk '{print $1}') -eq 2 &>/dev/null + test $(ls -l $M0/$1 | awk '{print $5}') -eq 2 &>/dev/null test -e $M0/.trashcan/$1* - test $(du -b $M0/.trashcan/$1*|awk '{print $1}') -eq $2 &>/dev/null + test $(ls -l $M0/.trashcan/$1*|awk '{print $5}') -eq $2 &>/dev/null # truncate from trashcan truncate -s 1 $M0/.trashcan/$1* @@ -94,7 +94,7 @@ TEST unlink_op file1 TEST truncate_op file2 4 # create files directory hierarchy and check [16] -mkdir $M0/1/2/3 -p +mkdir -p $M0/1/2/3 create_files $M0/1/2/3/foo1 $M0/1/2/3/foo2 TEST file_exists 1/2/3/foo1 1/2/3/foo2 @@ -122,7 +122,7 @@ TEST [ ! -e $M0/.trashcan/a/test1* ] # truncate from eliminate path [23-25] truncate -s 2 $M0/a/test2 TEST [ -e $M0/a/test2 ] -TEST [ `du -b $M0/a/test2 | awk '{print $1}'` -eq 2 ] +TEST [ `ls -l $M0/a/test2 | awk '{print $5}'` -eq 2 ] TEST [ ! -e $M0/.trashcan/a/test2* ] # set internal op on [26-27] -- cgit