diff options
| author | Valerii Ponomarov <vponomar@redhat.com> | 2018-11-05 10:07:14 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@gerrit.host.prod.eng.bos.redhat.com> | 2018-11-05 10:07:14 +0000 |
| commit | daa6f0e789a9440f2220c237d1f39abe730a447d (patch) | |
| tree | 15cdf541bdefdbd35decb6bfb65a332c27822e18 /tests/functional/common/provisioning | |
| parent | c8000e8a8b4c5d9f7d8e16392f8d6f333d871298 (diff) | |
| parent | 7699397102732aa673fb80d4540e2239294b5799 (diff) | |
Merge "[CNS-1392] Recreate app POD with attached block pv"
Diffstat (limited to 'tests/functional/common/provisioning')
| -rw-r--r-- | tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py | 25 |
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)) |
