summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/cli/bug-983317-volume-get.t (renamed from tests/bugs/cli/bug-983317.t)11
-rw-r--r--tests/volume.rc7
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/bugs/cli/bug-983317.t b/tests/bugs/cli/bug-983317-volume-get.t
index 11590ac280f..8f09d588565 100644
--- a/tests/bugs/cli/bug-983317.t
+++ b/tests/bugs/cli/bug-983317-volume-get.t
@@ -13,13 +13,22 @@ TEST $CLI volume create $V0 $H0:$B0/$V0
TEST $CLI volume set $V0 open-behind on
TEST $CLI volume start $V0
+TEST $CLI volume set all server-quorum-ratio 80
+
+TEST $CLI volume set $V0 user.metadata 'dummy'
+
# Execute volume get without having an explicit option, this should fail
TEST ! $CLI volume get $V0
# Execute volume get with an explicit option
TEST $CLI volume get $V0 open-behind
+EXPECT 'on' volume_get_field $V0 'open-behind'
# Execute volume get with 'all"
TEST $CLI volume get $V0 all
-cleanup;
+# Check if volume get can display correct global options values as well
+EXPECT '80' volume_get_field $V0 'server-quorum-ratio'
+
+# Check user.* options can also be retrived using volume get
+EXPECT 'dummy' volume_get_field $V0 'user.metadata'
diff --git a/tests/volume.rc b/tests/volume.rc
index 9bd9eca1ec5..9c6c6be2e8a 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -6,6 +6,13 @@ function volinfo_field()
$CLI volume info $vol | grep "^$field: " | sed 's/.*: //';
}
+function volume_get_field()
+{
+ local vol=$1
+ local field=$2
+ $CLI volume get $vol $field | tail -1 | awk '{print $2}'
+}
+
function brick_count()
{