def run_deployment(self, index, queue): try: blueprint_id = '{}_{}'.format(self.test_id, index) deployment_id = blueprint_id file_name = 'blueprint{}.yaml'.format(index) blueprint_yaml = self.blueprint_path / file_name blueprint_yaml.write_text(self.blueprint_yaml.text()) sg = 'sg{}'.format(index) self.modify_yaml(blueprint_path=blueprint_yaml, security_group_name=sg) self.cfy.upload_deploy_and_execute_install( blueprint_path=blueprint_yaml, blueprint_id=blueprint_id, deployment_id=deployment_id, # inputs are not used (overridden by modify_yaml) inputs=dict( agent_user='', image='', flavor='', )) floatingip_node, _, _ = bash.get_instances( client=self.client, deployment_id=deployment_id) bash.verify_webserver_running( web_server_node=bash.get_web_server_node( self.client, deployment_id), floatingip_node_instance=floatingip_node) self.cfy.execute_uninstall(deployment_id=deployment_id) except Exception, e: queue.put(e)
def run_deployment(self, index, queue): try: blueprint_id = '{}_{}'.format(self.test_id, index) deployment_id = blueprint_id file_name = 'blueprint{}.yaml'.format(index) blueprint_yaml = self.blueprint_path / file_name blueprint_yaml.write_text(self.blueprint_yaml.text()) sg = 'sg{}'.format(index) self.modify_yaml(blueprint_path=blueprint_yaml, security_group_name=sg) self.cfy.upload_deploy_and_execute_install( blueprint_path=blueprint_yaml, blueprint_id=blueprint_id, deployment_id=deployment_id, # inputs are not used (overridden by modify_yaml) inputs=dict( agent_user='', image='', flavor='', )) outputs = self.client.deployments.outputs.get( deployment_id)['outputs'] self.logger.info('Deployment outputs: {0}'.format(outputs)) bash.verify_webserver_running(outputs['http_endpoint']) self.cfy.execute_uninstall(deployment_id=deployment_id) except Exception, e: queue.put(e)
def _check_webserver(self, end_point, assert_online=True): if assert_online: self.logger.info('Verifying web server is running on: {0}' .format(end_point)) verify_webserver_running(end_point) else: try: self.logger.info('Verifying web server is not running on: {0}' .format(end_point)) self._verify_webserver_offline(end_point) except RequestException: return self.fail("Accessing should have resulted in Connection timeout " "error, But wasn't")