Exemplo n.º 1
0
def validate_bigip_image(testenv, host_type):
    """
    Similar to validate_linux_image, but here we are 
    specifically testing the ability to launch BIG-IP images.
    """
    # we can get all information from the defaults file, assume the user will use these
    defaults = yaml.load(
        open(config['install_path'] +
             '/roles/inventory_manager/defaults/main.yml'))

    # get the ami id
    module_args = {
        'instance_type': defaults[host_type + '_instance_type'],
        'throughput': defaults[host_type + '_license_throughput'],
        'package': defaults[host_type + '_license_package'],
        'license': defaults[host_type + '_license_model'],
        'version': defaults[host_type + '_version'],
        'region': testenv['region'].region_name
    }
    image_id = image_finder.BigIpImageFinder().find(**module_args)[0]['id']

    return utils.touchImage(imageId=image_id,
                            instanceType=defaults[host_type +
                                                  '_instance_type'],
                            region=testenv['region'].region_name,
                            vpcId=testenv['region'].vpc_id,
                            keyName=testenv['region'].key_name,
                            subnetId=testenv['region'].subnet_id)
Exemplo n.º 2
0
def validate_bigip_image(testenv, host_type):
    """
    Similar to validate_linux_image, but here we are 
    specifically testing the ability to launch BIG-IP images.
    """
    # we can get all information from the defaults file, assume the user will use these
    defaults = yaml.load(open(config['install_path']+
        '/roles/inventory_manager/defaults/main.yml'))

    # get the ami id
    module_args = {
        'instance_type': defaults[host_type+'_instance_type'],
        'throughput': defaults[host_type+'_license_throughput'],
        'package': defaults[host_type+'_license_package'],
        'license': defaults[host_type+'_license_model'],
        'version': defaults[host_type+'_version'],
        'region': testenv['region'].region_name
    }
    image_id = image_finder.BigIpImageFinder().find(**module_args)[0]['id']

    return utils.touchImage(
        imageId=image_id,
        instanceType=defaults[host_type+'_instance_type'],
        region=testenv['region'].region_name,
        vpcId=testenv['region'].vpc_id,
        keyName=testenv['region'].key_name,
        subnetId=testenv['region'].subnet_id)
Exemplo n.º 3
0
def validate_linux_image(testenv, host_type):
    """
    Here we read from our defaults settings files and playbook
    definitions to get the instance type and ami ids that we 
    will launch.  Its possible that a user chooses a different
    instance type, in which case this test will be meaningless, 
    but it is okay for most usage scenarios. 
    """

    # get the ami id for this type of host working region
    cft = json.loads(
        open(
            config['install_path'] + '/roles/infra/files/' + host_type +
            '.json', 'r').read())
    image_id = cft['Mappings']['AWSRegionArch2AMI'][
        testenv['region'].region_name]['AMI']

    # get the default instance type for this type of host
    defaults = yaml.load(
        open(config['install_path'] +
             '/roles/inventory_manager/defaults/main.yml'))
    instance_type = defaults[host_type + '_instance_type']

    return utils.touchImage(imageId=image_id,
                            instanceType=instance_type,
                            region=testenv['region'].region_name,
                            vpcId=testenv['region'].vpc_id,
                            keyName=testenv['region'].key_name,
                            subnetId=testenv['region'].subnet_id)
Exemplo n.º 4
0
def validate_linux_image(testenv, host_type):
    """
    Here we read from our defaults settings files and playbook
    definitions to get the instance type and ami ids that we 
    will launch.  Its possible that a user chooses a different
    instance type, in which case this test will be meaningless, 
    but it is okay for most usage scenarios. 
    """

    # get the ami id for this type of host working region
    cft = json.loads(open(config['install_path']+
        '/roles/infra/files/'+host_type+'.json', 'r').read())
    image_id = cft['Mappings']['AWSRegionArch2AMI'][testenv['region'].region_name]['AMI']

    # get the default instance type for this type of host
    defaults = yaml.load(open(config['install_path']+
        '/roles/inventory_manager/defaults/main.yml'))
    instance_type = defaults[host_type+'_instance_type']

    return utils.touchImage(
        imageId=image_id,
        instanceType=instance_type,
        region=testenv['region'].region_name,
        vpcId=testenv['region'].vpc_id,
        keyName=testenv['region'].key_name,
        subnetId=testenv['region'].subnet_id)