summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDelia Popescu <delia.popescu@enea.com>2018-07-11 12:18:54 +0300
committerDelia Popescu <delia.popescu@enea.com>2018-07-11 11:03:59 +0000
commit77b42be3030c6e57f1a47cfd7a42a098a52902b8 (patch)
tree89466fe9715c095d5e5408d0e10549ae2ee83d48
parent4f89564b20e9c3462614706a616d469540631786 (diff)
Run script only if volume device is found
Add back volume device name search on instance. If vol is not attached script should not run. In the current state, if volume is not found, write_data returns positive result and read_data cannot find any new file Change-Id: Ifaa8af1e6d5c66f5ac776c83bebde526e77a9fd8 Signed-off-by: Delia Popescu <delia.popescu@enea.com>
-rw-r--r--functest/opnfv_tests/openstack/cinder/read_data.sh2
-rw-r--r--functest/opnfv_tests/openstack/cinder/write_data.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/functest/opnfv_tests/openstack/cinder/read_data.sh b/functest/opnfv_tests/openstack/cinder/read_data.sh
index e6ad57bd3..2c5fdd4c0 100644
--- a/functest/opnfv_tests/openstack/cinder/read_data.sh
+++ b/functest/opnfv_tests/openstack/cinder/read_data.sh
@@ -13,7 +13,7 @@ VOL_DEV_NAME=${1:-vdb}
echo "VOL_DEV_NAME: $VOL_DEV_NAME"
echo "$(lsblk -l -o NAME)"
-if [ ! -z $VOL_DEV_NAME ]; then
+if [ ! -z $(lsblk -l -o NAME | grep $VOL_DEV_NAME) ]; then
sudo mount /dev/$VOL_DEV_NAME $DEST
if [ -f $DEST/new_data ]; then
echo "Found new data!"
diff --git a/functest/opnfv_tests/openstack/cinder/write_data.sh b/functest/opnfv_tests/openstack/cinder/write_data.sh
index 16cea17bf..6689309b9 100644
--- a/functest/opnfv_tests/openstack/cinder/write_data.sh
+++ b/functest/opnfv_tests/openstack/cinder/write_data.sh
@@ -14,7 +14,7 @@ echo "VOL_DEV_NAME: $VOL_DEV_NAME"
echo "$(lsblk -l -o NAME)"
-if [ ! -z $VOL_DEV_NAME ]; then
+if [ ! -z $(lsblk -l -o NAME | grep $VOL_DEV_NAME) ]; then
sudo /usr/sbin/mkfs.ext4 -F /dev/$VOL_DEV_NAME
sudo mount /dev/$VOL_DEV_NAME $DEST
sudo touch $DEST/new_data