diff options
Diffstat (limited to 'functest/opnfv_tests/openstack/cinder/read_data.sh')
-rw-r--r-- | functest/opnfv_tests/openstack/cinder/read_data.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/functest/opnfv_tests/openstack/cinder/read_data.sh b/functest/opnfv_tests/openstack/cinder/read_data.sh index 90758436d..c3ce9e4f7 100644 --- a/functest/opnfv_tests/openstack/cinder/read_data.sh +++ b/functest/opnfv_tests/openstack/cinder/read_data.sh @@ -8,14 +8,16 @@ # # http://www.apache.org/licenses/LICENSE-2.0 -VOL_DEV_NAME="$(lsblk -l | grep -Po '^[vs]dc\W')" +DEST=$(mktemp -d) +VOL_DEV_NAME="$(lsblk -l -o NAME | grep -o "vdc\|sdc\b")" +echo "VOL_DEV_NAME: $VOL_DEV_NAME" -if [ -n "$VOL_DEV_NAME" ]; then - sudo mount /dev/$VOL_DEV_NAME /home/cirros/volume; - if [ -f /home/cirros/volume/new_data ]; then - echo "Found existing data!"; +if [ ! -z $VOL_DEV_NAME ]; then + sudo mount /dev/$VOL_DEV_NAME $DEST + if [ -f $DEST/new_data ]; then + echo "Found new data!" else - echo "No data found on the volume!"; - exit 1 + echo "Failed to find data!" + exit 1 fi fi |