diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/volume.rc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc index add812d4779..44428606711 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -808,7 +808,19 @@ function get_fd_count { local fname=$4 local gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $brick/$fname)) local statedump=$(generate_brick_statedump $vol $host $brick) - local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep fd-count | cut -f2 -d'=' | tail -1) + local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep -w fd-count | cut -f2 -d'=' | tail -1) + rm -f $statedump + echo $count +} + +function get_active_fd_count { + local vol=$1 + local host=$2 + local brick=$3 + local fname=$4 + local gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $brick/$fname)) + local statedump=$(generate_brick_statedump $vol $host $brick) + local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep -w active-fd-count | cut -f2 -d'=' | tail -1) rm -f $statedump echo $count } |