summaryrefslogtreecommitdiffstats
path: root/tests/basic/pgfid-feat.t
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2014-02-12 17:23:28 +0530
committerVijay Bellur <vbellur@redhat.com>2014-02-14 04:18:26 -0800
commita78dfebb7343671b0a3a0af8b46951894a3cf7a4 (patch)
tree846be0e1c612c6bb91a69716bd694bb99a512eda /tests/basic/pgfid-feat.t
parent0a8abcc5d0b727746a2ac6c0d5729700bfea742b (diff)
add build-gfid option to enable pgfid tracking ...
.. for inode to pathname mapping Change-Id: I0486d85b02e86d739fc1d8ea16d118fb666abf60 BUG: 1064863 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/6989 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/basic/pgfid-feat.t')
-rw-r--r--tests/basic/pgfid-feat.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/basic/pgfid-feat.t b/tests/basic/pgfid-feat.t
new file mode 100644
index 00000000000..8784cc7bf0e
--- /dev/null
+++ b/tests/basic/pgfid-feat.t
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+function get_ancestry_path() {
+ local path=$1
+ local ancestry=$(getfattr --absolute-names -e text -n glusterfs.ancestry.path "$M0/$path" | grep "^glusterfs.ancestry.path" | cut -d"=" -f2 | tr -d \");
+ echo $ancestry;
+}
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4};
+TEST $CLI volume start $V0;
+TEST glusterfs -s $H0 --volfile-id $V0 $M0;
+
+TEST $CLI volume set $V0 build-pgfid on;
+
+TEST mkdir $M0/a;
+TEST touch $M0/a/b;
+
+getfattr -e text -n glusterfs.ancestry.path "$M0/a/b" | grep "^glusterfs.ancestry.path" | cut -d"=" -f2 | tr -d \";
+EXPECT "/a/b" get_ancestry_path "/a/b";
+
+TEST $CLI volume set $V0 build-pgfid off;
+TEST ! getfattr -e text -n "glusterfs.ancestry.path" $M0/a/b;
+
+TEST $CLI volume stop $V0;
+TEST $CLI volume delete $V0;
+
+cleanup;