summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/afr/self-heald.t4
-rw-r--r--tests/basic/pump.t4
-rw-r--r--tests/include.rc18
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/basic/afr/self-heald.t b/tests/basic/afr/self-heald.t
index 37e10b254c1..6937cf227d7 100644
--- a/tests/basic/afr/self-heald.t
+++ b/tests/basic/afr/self-heald.t
@@ -4,6 +4,7 @@
. $(dirname $0)/../../volume.rc
cleanup;
+START_TIMESTAMP=`date +%s`
function disconnected_brick_count {
local vol=$1
@@ -162,4 +163,7 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{6}
TEST $CLI volume start $V0
TEST ! $CLI volume heal $V0 info
+# Check for non Linux systems that we did not mess with directory offsets
+TEST ! log_newer $START_TIMESTAMP "offset reused from another DIR"
+
cleanup
diff --git a/tests/basic/pump.t b/tests/basic/pump.t
index 6e81ddde6cd..e9e54a7a9ea 100644
--- a/tests/basic/pump.t
+++ b/tests/basic/pump.t
@@ -4,6 +4,7 @@
. $(dirname $0)/../volume.rc
cleanup;
+START_TIMESTAMP=`date +%s`
TEST glusterd
TEST pidof glusterd
@@ -41,4 +42,7 @@ done
EXPECT "" echo $files
+# Check for non Linux systems that we did not mess with directory offsets
+TEST ! log_newer $START_TIMESTAMP "offset reused from another DIR"
+
cleanup
diff --git a/tests/include.rc b/tests/include.rc
index 75db2d10d0e..7c31eb65402 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -783,6 +783,24 @@ function MKFS_LOOP ()
esac
}
+# usage: log_newer timestamp "string"
+# search in glusterfs logs for "string" logged after timestamp seconds
+# since the Epoch (usually obtained by date +%s)
+log_newer()
+{
+ ts=$1
+ msg=$2
+ logdir=`$CLI --print-logdir`
+
+ IFS="["
+ for date in `grep -hr "$msg" $logdir | awk -F '[\]]' '{print $1}'` ; do
+ if [ `date -d "$date" +%s` -gt $ts ] ; then
+ return 0;
+ fi
+ done 2>/dev/null
+ return 1
+}
+
function MOUNT_LOOP ()
{
if [ $# != 2 ] ; then