From: Cédric Ollivier Date: Sun, 22 Jul 2018 13:25:07 +0000 (+0200) Subject: Add secrets operations in cloudify.py X-Git-Tag: opnfv-7.0.0~171 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F60083%2F1;p=functest.git Add secrets operations in cloudify.py It tries to prevent race conditions when running cloudify_ims. Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/functest/core/singlevm.py", line 411, in run if not self.execute(): File "/usr/lib/python2.7/site-packages/functest/opnfv_tests/vnf/ims/cloudify_ims.py", line 120, in execute self.cfy_client.secrets.create(k, val) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/secrets.py", line 86, in create response = self.api.put('/secrets/{0}'.format(key), data=data) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/client.py", line 263, in put timeout=timeout) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/client.py", line 233, in do_request 'SSL, but the client does'.format(e) ConnectionError: ('Connection aborted.', BadStatusLine("''",)) Change-Id: Id2603bbda462b50d3140b6f45894c8810d542e4c Signed-off-by: Cédric Ollivier --- diff --git a/functest/core/cloudify.py b/functest/core/cloudify.py index 3bb630d80..834989722 100644 --- a/functest/core/cloudify.py +++ b/functest/core/cloudify.py @@ -66,8 +66,11 @@ class Cloudify(singlevm.SingleVm2): "The current manager status is %s", cfy_status) if str(cfy_status) != 'running': raise Exception("Cloudify Manager isn't up and running") - self.cfy_client.secrets.list() - self.__logger.debug("Secrets API successfully reached") + self.cfy_client.secrets.create("foo", "bar") + self.__logger.debug( + "List secrets: %s", self.cfy_client.secrets.list()) + self.cfy_client.secrets.delete("foo") + self.__logger.info("Secrets API successfully reached") break except Exception: # pylint: disable=broad-except self.__logger.info(