def mark_neutron_logs(controllers):
    """Mark logs to know which logs are generated during the test"""
    logs_path = "/var/log/neutron/server.log"
    logs_start_marker = gen_random_resource_name(
        prefix='neutron')

    for controller in controllers:
        with controller.ssh() as remote:
            remote.check_call("echo {0} >> {1}".format(logs_start_marker,
                                                       logs_path))
    return logs_path, logs_start_marker
def data_sources(os_conn, files_for_pig_job, sahara):
    user = os_conn.session.auth.username
    password = os_conn.session.auth.password

    logger.info('Creating input data source')
    input_url = "swift://{0}/{1}".format(CONTAINER_NAME, INPUT_FILE_NAME)
    src_input = sahara.data_sources.create(name=INPUT_FILE_NAME,
                                           description="input_file",
                                           data_source_type='swift',
                                           url=input_url,
                                           credential_user=user,
                                           credential_pass=password)

    logger.info('Creating output data source with random name')
    output_name1 = gen_random_resource_name(prefix=OUTPUT_FILE_NAME)
    output_url1 = "swift://{0}/{1}".format(CONTAINER_NAME, output_name1)
    src_output1 = sahara.data_sources.create(name=output_name1,
                                             description="output_file1",
                                             data_source_type='swift',
                                             url=output_url1,
                                             credential_user=user,
                                             credential_pass=password)

    logger.info('Creating output data source to use after restart')
    output_name2 = gen_random_resource_name(prefix=OUTPUT_FILE_NAME)
    output_url2 = "swift://{0}/{1}".format(CONTAINER_NAME, output_name2)
    src_output2 = sahara.data_sources.create(name=output_name2,
                                             description="output_file2",
                                             data_source_type='swift',
                                             url=output_url2,
                                             credential_user=user,
                                             credential_pass=password)

    yield src_input.id, src_output1.id, src_output2.id

    sahara.data_sources.delete(src_input.id)
    sahara.data_sources.delete(src_output1.id)
    sahara.data_sources.delete(src_output2.id)
Esempio n. 3
0
def keypair(os_conn):
    keypair = os_conn.create_key(common.gen_random_resource_name(prefix="murano-key"))
    yield keypair
    os_conn.delete_key(key_name=keypair.name)
Esempio n. 4
0
def keypair(os_conn):
    key = os_conn.create_key(gen_random_resource_name(prefix='sahara_key'))
    yield key
    os_conn.delete_key(key_name=key.name)