aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/cinder/write_data.sh
diff options
context:
space:
mode:
authorDelia Popescu <delia.popescu@enea.com>2018-05-10 12:13:08 +0300
committerDelia Popescu <delia.popescu@enea.com>2018-05-25 16:50:47 +0300
commit1e31574dfe4c803a7fab05827ab163f3bb7f2ec7 (patch)
treeacc71961da1d4350e6277de664ec71f2035e9907 /functest/opnfv_tests/openstack/cinder/write_data.sh
parentac8e3d4d9f7fe99021f41ee9c86370e7d9866d65 (diff)
Add cinder_test testcase
Create 2 instances with Floating IPs Attach data volume to instance 1 Write data on the volume Detach volume from instance 1 Attach volume to instance 2 Read data from volume JIRA: FUNCTEST-908 Change-Id: I10efdfb3b7f9d7e6ab5c6a538052437585d52fb0 Signed-off-by: Delia Popescu <delia.popescu@enea.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/cinder/write_data.sh')
-rw-r--r--functest/opnfv_tests/openstack/cinder/write_data.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/cinder/write_data.sh b/functest/opnfv_tests/openstack/cinder/write_data.sh
new file mode 100644
index 000000000..eeafbb54a
--- /dev/null
+++ b/functest/opnfv_tests/openstack/cinder/write_data.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+# Copyright (c) 2018 Enea AB and others
+
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+
+VOL_DEV_NAME="$(lsblk -l | grep -Po '^[vs]dc\W')"
+
+if [ -n $VOL_DEV_NAME ]; then
+ sudo mkdir -p /home/cirros/volume
+ sudo /usr/sbin/mkfs.ext4 -F /dev/$VOL_DEV_NAME
+ sudo mount /dev/$VOL_DEV_NAME /home/cirros/volume
+ sudo touch /home/cirros/volume/new_data
+ echo "New data added to the volume!"
+else
+ echo "Failed to write data!"
+ exit 1
+fi