diff options
author | Sri Vignesh <sselvan@redhat.com> | 2019-08-28 12:20:52 +0530 |
---|---|---|
committer | Sri Vignesh <sselvan@redhat.com> | 2019-09-05 18:06:02 +0530 |
commit | 77bdadb75e8bdae4170c08027ff27f436a23eb66 (patch) | |
tree | f0b70903d327c23fa6eeafcfbf60475b187b50c6 | |
parent | a801a3f5ab3761af6ba366a5e2f9cd19067f6794 (diff) |
Add testcase to block device creation with different auth values
validate block volume creation with
different auth values
Change-Id: I820f65a5aaa5adc6cb58b16b18b6c93b22177d45
Signed-off-by: Sri Vignesh <sselvan@redhat.com>
-rw-r--r-- | tests/functional/heketi/test_block_volumes_heketi.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_block_volumes_heketi.py b/tests/functional/heketi/test_block_volumes_heketi.py index fe157282..424769d7 100644 --- a/tests/functional/heketi/test_block_volumes_heketi.py +++ b/tests/functional/heketi/test_block_volumes_heketi.py @@ -1,3 +1,4 @@ +import ddt from glustolibs.gluster.volume_ops import get_volume_info from openshiftstoragelibs.baseclass import BaseClass @@ -17,6 +18,7 @@ from openshiftstoragelibs.openshift_ops import ( from openshiftstoragelibs import podcmd +@ddt.ddt class TestBlockVolumeOps(BaseClass): """Class to test heketi block volume deletion with and without block volumes existing, heketi block volume list, heketi block volume info @@ -194,3 +196,30 @@ class TestBlockVolumeOps(BaseClass): self.assertIn(k, vol_info[bhv_name]["options"].keys()) self.assertEqual(v, vol_info[bhv_name] ["options"][k]) + + @ddt.data(True, False) + def test_create_blockvolume_with_different_auth_values(self, auth_value): + """To validate block volume creation with different auth values""" + # Block volume create with auth enabled + block_vol = heketi_blockvolume_create( + self.heketi_client_node, self.heketi_server_url, 1, + auth=auth_value, json=True) + self.addCleanup( + heketi_blockvolume_delete, self.heketi_client_node, + self.heketi_server_url, block_vol["id"]) + + # Verify username and password are present + block_vol_info = heketi_blockvolume_info( + self.heketi_client_node, self.heketi_server_url, + block_vol["id"], json=True) + assertion_func = (self.assertNotEqual if auth_value + else self.assertEqual) + assertion_msg_part = "not " if auth_value else "" + assertion_func( + block_vol_info["blockvolume"]["username"], "", + ("Username is %spresent in %s", (assertion_msg_part, + block_vol["id"]))) + assertion_func( + block_vol_info["blockvolume"]["password"], "", + ("Password is %spresent in %s", (assertion_msg_part, + block_vol["id"]))) |