summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
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 /tests/include.rc
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>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc10
1 files changed, 10 insertions, 0 deletions
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