From 72149b4c719ea77c71a1aff4d9b8e6f1dead69ed Mon Sep 17 00:00:00 2001 From: Rodrigo Barbieri Date: Wed, 25 Jan 2017 13:04:41 -0200 Subject: [PATCH] Improve share migration scenario test validation Changed test to handle only a specific exception to better validate the test when attempting to create a file in a readonly share. TrivialFix Change-Id: Ib22d7336dd366297f8b73a7e13f2b432c53d8e37 --- .../tests/scenario/test_share_basic_ops.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py index ef9a3d8d6e..abaa46c34c 100644 --- a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py +++ b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py @@ -351,14 +351,11 @@ class ShareBasicOpsBase(manager.ShareScenarioTest): self.share = self.migrate_share( self.share['id'], dest_pool, task_state, force_host_assisted) - read_only = False if force_host_assisted: - try: - ssh_client.exec_command( - "dd if=/dev/zero of=/mnt/f1/1m6.bin bs=1M count=1") - except Exception: - read_only = True - self.assertTrue(read_only) + self.assertRaises( + exceptions.SSHExecCommandFailed, + ssh_client.exec_command, + "dd if=/dev/zero of=/mnt/f1/1m6.bin bs=1M count=1") self.umount_share(ssh_client)