summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-11-29 06:20:58 +0100
committerVijay Bellur <vbellur@redhat.com>2014-12-03 10:31:30 -0800
commitcd9ed7bd85bb3e876ef825a0c312a91c2206cc39 (patch)
treea24153d8166854ede8295a3f42d99da527bf8f04
parent2ca5b712f93dde62aadbf34f954ad53089490ded (diff)
Regression test portability: stat(1)
- Improve Linux stat(1) emulation for BSD: %t and %T should be 0 for non device nodes. - Remove what seems like a typo in entry-self-heal.t, which blocks in Linux stat(1) emulation for BSD. BUG: 1129939 Change-Id: I7635aa105e6d309cdb74608bdaba4135c7c00dd4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9217 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--tests/basic/afr/entry-self-heal.t2
-rw-r--r--tests/include.rc10
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/basic/afr/entry-self-heal.t b/tests/basic/afr/entry-self-heal.t
index ce542383e29..8c072ef9949 100644
--- a/tests/basic/afr/entry-self-heal.t
+++ b/tests/basic/afr/entry-self-heal.t
@@ -194,7 +194,7 @@ TEST ! stat spb_me/0
TEST ! stat source_deletions_me/fifo
TEST ! stat $B0/${V0}0/source_deletions_me/fifo
TEST ! stat $B0/${V0}1/source_deletions_me/fifo
-TEST ! stat source_deletions_me/block b 0 0
+TEST ! stat source_deletions_me/block
TEST ! stat $B0/${V0}0/source_deletions_me/block
TEST ! stat $B0/${V0}1/source_deletions_me/block
TEST ! stat source_deletions_me/char
diff --git a/tests/include.rc b/tests/include.rc
index cd5d07f2629..ab26755c639 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -324,6 +324,16 @@ stat -c %s /dev/null > /dev/null 2>&1 || {
exit 2;
fi
+ # %t/%T should return 0 for non devices.
+ case "${format}" in
+ *%t*|*%T*)
+ `which stat` -f '%HT' $f | grep -q 'Device$' || \
+ format=`echo "${format}" | sed 's/%t/0/g; s/%T/0/g;'`
+ ;;
+ *)
+ ;;
+ esac
+
if [ "x${format}" = "x" ] ; then
`which stat` $f
else