コード例 #1
0
 def install_nodecellar(self):
     nc_inputs = {'resource_suffix': os.environ['CIRCLE_BUILD_NUM']}
     if utils.install_nodecellar(
             blueprint_file_name=self.blueprint_file_name,
             inputs=nc_inputs) != 0:
         raise Exception('nodecellar install failed.')
     utils.execute_scale('nc')
     self.check_resources_in_deployment('nc')
コード例 #2
0
 def check_nodecellar(self):
     aws_nodes = [
         'security_group', 'haproxy_nic', 'nodejs_nic', 'mongo_nic',
         'nodecellar_ip'
     ]
     monitored_nodes = [
         'haproxy_frontend_host', 'nodejs_host', 'mongod_host'
     ]
     failed = utils.install_nodecellar(
         blueprint_file_name=self.blueprint_file_name)
     if failed:
         raise Exception('Nodecellar install failed.')
     del failed
     self.addCleanup(self.cleanup_deployment, 'nc')
     failed = utils.execute_scale('nc', scalable_entity_name='nodejs_group')
     if failed:
         raise Exception('Nodecellar scale failed.')
     del failed
     deployment_nodes = \
         utils.get_deployment_resources_by_node_type_substring(
             'nc', 'cloudify')
     self.check_resources_in_deployment_created(deployment_nodes, aws_nodes)
     self.check_resources_in_deployment_created(deployment_nodes,
                                                monitored_nodes)
     blueprint_dir = tempfile.mkdtemp()
     blueprint_zip = os.path.join(blueprint_dir, 'blueprint.zip')
     blueprint_archive = 'nodecellar-auto-scale-auto-heal-blueprint-master'
     download_path = \
         os.path.join(blueprint_dir, blueprint_archive, 'aws.yaml')
     blueprint_path = utils.create_blueprint(utils.NODECELLAR,
                                             blueprint_zip, blueprint_dir,
                                             download_path)
     skip_transform = [
         'aws', 'vpc', 'public_subnet', 'private_subnet',
         'ubuntu_trusty_ami'
     ]
     new_blueprint_path = utils.create_external_resource_blueprint(
         blueprint_path,
         aws_nodes,
         deployment_nodes,
         resource_id_attr='aws_resource_id',
         nodes_to_keep_without_transform=skip_transform)
     failed = utils.execute_command(
         'cfy install {0} -b nc-external'.format(new_blueprint_path))
     if failed:
         raise Exception('Nodecellar external install failed.')
     failed = utils.execute_uninstall('nc-external')
     if failed:
         raise Exception('Nodecellar external uninstall failed.')
     failed = utils.execute_uninstall('nc')
     if failed:
         raise Exception('Nodecellar uninstall failed.')
     del failed
     self.check_resources_in_deployment_deleted(deployment_nodes, aws_nodes)
     self.check_resources_in_deployment_deleted(deployment_nodes,
                                                monitored_nodes)
コード例 #3
0
    def check_nodecellar(self):
        nc_inputs = {
            'resource_prefix':
                'cfy-nc-{0}'.format(os.environ['CIRCLE_BUILD_NUM'])
        }
        # Add Cleanup method to clean "nc" whenever tests fail or pass
        self.addCleanup(self.cleanup_deployment, 'nc')

        # Check if executing install workflow passed or not
        if utils.install_nodecellar(
                blueprint_file_name=self.blueprint_file_name,
                inputs=nc_inputs) != 0:
            raise Exception('nodecellar install failed.')

        # Check if executing scale workflow passed or not
        utils.execute_scale('nc')

        for node_type in CFY_NODES_PATTERNS:
            nc_resources = self.get_resources_from_deployment('nc', node_type)
            self.check_resource_method(nc_resources)
コード例 #4
0
    def check_nodecellar(self):
        nc_inputs = {
            'resource_prefix':
            'cfy-nc-{0}'.format(os.environ['CIRCLE_BUILD_NUM'])
        }
        # Add Cleanup method to clean "nc" whenever tests fail or pass
        self.addCleanup(self.cleanup_deployment, 'nc')

        # Check if executing install workflow passed or not
        if utils.install_nodecellar(
                blueprint_file_name=self.blueprint_file_name,
                inputs=nc_inputs) != 0:
            raise Exception('nodecellar install failed.')

        # Check if executing scale workflow passed or not
        utils.execute_scale('nc')

        for node_type in CFY_NODES_PATTERNS:
            nc_resources = self.get_resources_from_deployment('nc', node_type)
            self.check_resource_method(nc_resources)
コード例 #5
0
    def check_nodecellar(self):
        failed = utils.install_nodecellar(
            blueprint_file_name=self.blueprint_file_name)

        if failed:
            raise Exception('Nodecellar install failed.')
        del failed

        self.addCleanup(self.cleanup_deployment, 'nc')

        failed = utils.execute_scale('nc', scalable_entity_name='nodejs_group')
        if failed:
            raise Exception('Nodecellar scale failed.')
        del failed

        deployment_nodes = self.get_nc_deployment_nodes()

        self.check_resources_in_deployment_created(deployment_nodes,
                                                   NC_AWS_NODES)
        self.check_resources_in_deployment_created(deployment_nodes,
                                                   NC_MONITOTED_NODES)