From a78dfebb7343671b0a3a0af8b46951894a3cf7a4 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 12 Feb 2014 17:23:28 +0530 Subject: add build-gfid option to enable pgfid tracking ... .. for inode to pathname mapping Change-Id: I0486d85b02e86d739fc1d8ea16d118fb666abf60 BUG: 1064863 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/6989 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/basic/pgfid-feat.t | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/basic/pgfid-feat.t (limited to 'tests') diff --git a/tests/basic/pgfid-feat.t b/tests/basic/pgfid-feat.t new file mode 100644 index 000000000..8784cc7bf --- /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; -- cgit