diff options
author | Mohamed Ashiq Liyazudeen <mliyazud@redhat.com> | 2016-08-25 16:35:27 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-11-22 14:42:00 +0000 |
commit | 8d53be68d8fb4272f0c88fef0a00dad452b941de (patch) | |
tree | ff7773d28f77b587b78da7b071c9742396443d10 /tests/basic | |
parent | aee2a1d2136f505eae180b258374ca8812a6f4fb (diff) |
tests : add a test to check if there is an inode leak
This test check if there is inode leak in bricks.
lru_size for mount is expected to be zero. active_size for mount
is expected to be 1 which is of root.
Change-Id: I18762b4255af411f1b55c0be98451c8ef1b35478
BUG: 1370116
Signed-off-by: Mohamed Ashiq Liyazudeen <mliyazud@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/inode-leak.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/basic/inode-leak.t b/tests/basic/inode-leak.t new file mode 100644 index 00000000000..35840e661a7 --- /dev/null +++ b/tests/basic/inode-leak.t @@ -0,0 +1,41 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +function get_mount_active_size_value { + local vol=$1 + local statedump=$(generate_mount_statedump $vol) + sleep 1 + local val=$(grep "active_size" $statedump | cut -f2 -d'=' | tail -1) + rm -f $statedump + echo $val +} + +function get_mount_lru_size_value { + local vol=$1 + local statedump=$(generate_mount_statedump $vol) + sleep 1 + local val=$(grep "lru_size" $statedump | cut -f2 -d'=' | tail -1) + rm -f $statedump + echo $val +} +cleanup + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3} +TEST $CLI volume start $V0 +TEST glusterfs -s $H0 --volfile-id $V0 $M0 + +EXPECT "1" get_mount_active_size_value $V0 +EXPECT "0" get_mount_lru_size_value $V0 + +TEST cp -rf /etc $M0 +TEST find $M0 +TEST rm -rf $M0/* + +EXPECT "1" get_mount_active_size_value $V0 +EXPECT "0" get_mount_lru_size_value $V0 + +cleanup |