diff options
-rwxr-xr-x | tests/basic/volume.t | 18 | ||||
-rw-r--r-- | tests/volume.rc | 22 |
2 files changed, 23 insertions, 17 deletions
diff --git a/tests/basic/volume.t b/tests/basic/volume.t index de3f001e0..8491164ce 100755 --- a/tests/basic/volume.t +++ b/tests/basic/volume.t @@ -1,6 +1,7 @@ #!/bin/bash . $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc cleanup; @@ -11,23 +12,6 @@ TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; -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; -} - - EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '8' brick_count $V0 diff --git a/tests/volume.rc b/tests/volume.rc new file mode 100644 index 000000000..55c96b3ad --- /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' '; +} |