diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/inode-leak.t | 17 | ||||
-rw-r--r-- | tests/bugs/shard/shard-inode-refcount-test.t | 27 | ||||
-rw-r--r-- | tests/volume.rc | 18 |
3 files changed, 45 insertions, 17 deletions
diff --git a/tests/basic/inode-leak.t b/tests/basic/inode-leak.t index f73d2af6898..6bfbf572f03 100644 --- a/tests/basic/inode-leak.t +++ b/tests/basic/inode-leak.t @@ -3,23 +3,6 @@ . $(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 diff --git a/tests/bugs/shard/shard-inode-refcount-test.t b/tests/bugs/shard/shard-inode-refcount-test.t new file mode 100644 index 00000000000..635809724cf --- /dev/null +++ b/tests/bugs/shard/shard-inode-refcount-test.t @@ -0,0 +1,27 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}0 +TEST $CLI volume set $V0 features.shard on +TEST $CLI volume set $V0 features.shard-block-size 4MB +TEST $CLI volume start $V0 + +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 + +TEST dd if=/dev/zero of=$M0/one-plus-five-shards bs=1M count=23 + +ACTIVE_INODES_BEFORE=$(get_mount_active_size_value $V0) +TEST rm -f $M0/one-plus-five-shards +EXPECT `expr $ACTIVE_INODES_BEFORE - 5` get_mount_active_size_value $V0 + +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup diff --git a/tests/volume.rc b/tests/volume.rc index 3ee83624058..add812d4779 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -812,3 +812,21 @@ function get_fd_count { rm -f $statedump echo $count } + +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 +} |