summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2018-11-01 15:18:16 +0530
committerValerii Ponomarov <vponomar@redhat.com>2018-11-02 11:33:20 +0000
commit7699397102732aa673fb80d4540e2239294b5799 (patch)
treebba38b0d2ca4e565ba62cfd4fa850b01bdf0c573 /tests
parent384cb369f256162606190e4df4767500668d3a7c (diff)
[CNS-1392] Recreate app POD with attached block pv
We should be able to recreate application PODs when Gluster block volume is attached to it. Change-Id: Iad240925ba43db11ab84863f182e282253789924
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py b/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py
index 65a01c61..c4a479f5 100644
--- a/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py
+++ b/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py
@@ -312,3 +312,28 @@ class TestDynamicProvisioningBlockP0(CnsGlusterBlockBaseClass):
# create a new PVC
self._create_and_wait_for_pvc()
+
+ def test_recreate_app_pod_with_attached_block_pv(self):
+ """Test Case CNS-1392"""
+ datafile_path = '/mnt/temporary_test_file'
+
+ # Create DC with POD and attached PVC to it
+ dc_name, pod_name, pvc_name = self._create_dc_with_pvc()
+
+ # Write data
+ write_cmd = "oc exec %s -- dd if=/dev/urandom of=%s bs=4k count=10000"
+ self.cmd_run(write_cmd % (pod_name, datafile_path))
+
+ # Recreate app POD
+ scale_dc_pod_amount_and_wait(self.node, dc_name, 0)
+ scale_dc_pod_amount_and_wait(self.node, dc_name, 1)
+ new_pod_name = get_pod_name_from_dc(self.node, dc_name)
+
+ # Check presence of already written file
+ check_existing_file_cmd = (
+ "oc exec %s -- ls %s" % (new_pod_name, datafile_path))
+ out = self.cmd_run(check_existing_file_cmd)
+ self.assertIn(datafile_path, out)
+
+ # Perform I/O on the new POD
+ self.cmd_run(write_cmd % (new_pod_name, datafile_path))