Esempio n. 1
0
def create_config_files(options):
    """
    Check if the appropriate configuration files are present.

    If the files are not present, create them.

    :param options: OptParser object with options.
    """
    shared_dir = os.path.dirname(data_dir.get_data_dir())
    test_dir = os.path.dirname(shared_dir)

    if options.vt_type and options.vt_config:
        test_dir = data_dir.get_backend_dir(options.vt_type)
    elif options.vt_type:
        test_dir = data_dir.get_backend_dir(options.vt_type)
    elif options.vt_config:
        parent_config_dir = os.path.dirname(options.vt_config)
        parent_config_dir = os.path.dirname(parent_config_dir)
        options.vt_type = parent_config_dir
        test_dir = os.path.join(test_dir, parent_config_dir)

    if not os.path.exists(os.path.join(test_dir, "cfg")):
        print_stdout("Setup error: %s does not exist" %
                     os.path.join(test_dir, "cfg"))
        print_stdout("Perhaps you have not specified -t?")
        sys.exit(1)
    # lvsb test doesn't use shared configs
    if options.vt_type != 'lvsb':
        bootstrap.create_config_files(test_dir, shared_dir, interactive=False)
        bootstrap.create_guest_os_cfg(options.vt_type)
    bootstrap.create_subtests_cfg(options.vt_type)
Esempio n. 2
0
def create_config_files(options):
    """
    Check if the appropriate configuration files are present.

    If the files are not present, create them.

    @param options: OptParser object with options.
    """
    shared_dir = os.path.dirname(data_dir.get_data_dir())
    test_dir = os.path.dirname(shared_dir)
    shared_dir = os.path.join(shared_dir, "cfg")

    if (options.type and options.config):
        test_dir = os.path.join(test_dir, options.type)
    elif options.type:
        test_dir = os.path.join(test_dir, options.type)
    elif options.config:
        parent_config_dir = os.path.dirname(options.config)
        parent_config_dir = os.path.basename(parent_config_dir)
        test_dir = os.path.join(test_dir, parent_config_dir)

    bootstrap.create_config_files(test_dir, shared_dir, interactive=False)
Esempio n. 3
0
def create_config_files(options):
    """
    Check if the appropriate configuration files are present.

    If the files are not present, create them.

    @param options: OptParser object with options.
    """
    shared_dir = os.path.dirname(data_dir.get_data_dir())
    test_dir = os.path.dirname(shared_dir)
    shared_dir = os.path.join(shared_dir, "cfg")

    if (options.type and options.config):
        test_dir = os.path.join(test_dir, options.type)
    elif options.type:
        test_dir = os.path.join(test_dir, options.type)
    elif options.config:
        parent_config_dir = os.path.dirname(options.config)
        parent_config_dir = os.path.basename(parent_config_dir)
        test_dir = os.path.join(test_dir, parent_config_dir)

    bootstrap.create_config_files(test_dir, shared_dir, interactive=False)