Run script only if volume device is found
[functest.git] / functest / opnfv_tests / openstack / cinder / write_data.sh
index 16cea17..6689309 100644 (file)
@@ -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