summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2012-11-23 22:19:32 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-23 23:27:33 -0800
commit016480eb8221a403e5224653e57c401fcb61acc0 (patch)
treefa66b54238279702d94dbd81e5e4e90eccf8965d /tests/volume.rc
parent7c23a94516c5dd21536c259f323a3cc113fdfa0d (diff)
tests: Add volume utils in a new file
Change-Id: Ie78d24ca466d4bddc5c0727ed8ed51707e1f2a34 BUG: 839595 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4228 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
new file mode 100644
index 00000000..55c96b3a
--- /dev/null
+++ b/tests/volume.rc
@@ -0,0 +1,22 @@
+function volinfo_field()
+{
+ local vol=$1;
+ local field=$2;
+
+ $CLI volume info $vol | grep "^$field: " | sed 's/.*: //';
+}
+
+
+function brick_count()
+{
+ local vol=$1;
+
+ $CLI volume info $vol | egrep "^Brick[0-9]+: " | wc -l;
+}
+
+function volume_option()
+{
+ local vol=$1
+ local key=$2
+ $CLI volume info $vol | egrep "^$key: " | cut -f2 -d' ';
+}