From ba0f31b2a5c8bd35f99b1ba2a74c81a2c2ded200 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Thu, 7 Aug 2014 17:01:18 +0200 Subject: Regression test portability: stat Linux uses stat -c, stat --printf= or stat --printf NetBSD uses stat -f with different format strings. This change set changes all stat usage to stat -c and introduce a shell stat() fonction to perform the format string translation. BUG: 764655 Change-Id: I024fca7c1b736b053f5888cbf21da0a72489ef63 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/8424 Tested-by: Gluster Build System Reviewed-by: Harshavardhana Tested-by: Harshavardhana --- tests/bugs/bug-949242.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/bugs/bug-949242.t') diff --git a/tests/bugs/bug-949242.t b/tests/bugs/bug-949242.t index 027c25afd88..c596cf7f25b 100644 --- a/tests/bugs/bug-949242.t +++ b/tests/bugs/bug-949242.t @@ -25,8 +25,8 @@ require_fallocate -l 1m -n $M0/file && rm -f $M0/file # fallocate a file and verify blocks are allocated TEST fallocate -l 1m $M0/file -blksz=`stat --printf=%b $M0/file` -nblks=`stat --printf=%B $M0/file` +blksz=`stat -c %b $M0/file` +nblks=`stat -c %B $M0/file` TEST [ $(($blksz * $nblks)) -eq 1048576 ] TEST unlink $M0/file @@ -35,9 +35,9 @@ TEST unlink $M0/file # change TEST truncate --size=1m $M0/file TEST fallocate -l 2m -n $M0/file -blksz=`stat --printf=%b $M0/file` -nblks=`stat --printf=%B $M0/file` -sz=`stat --printf=%s $M0/file` +blksz=`stat -c %b $M0/file` +nblks=`stat -c %B $M0/file` +sz=`stat -c %s $M0/file` TEST [ $sz -eq 1048576 ] # Note that gluster currently incorporates a hack to limit the number of blocks # reported as allocated to the file by the file size. We have allocated beyond the -- cgit