Beispiel #1
0
def guest_download(guestos):
    """
    Guest image downloading
    """
    avocado_bin = helper.get_avocado_bin()
    cmd = '%s vt-bootstrap --vt-guest-os %s --yes-to-all' % (avocado_bin,
                                                             guestos)
    helper.runcmd(cmd, err_str="Failed to Download Guest OS. Error:",
                  info_str="Downloading the guest os image")
Beispiel #2
0
def kvm_bootstrap():
    """
    Prepare KVM Test environment
    """
    get_repo(AVOCADO_VT_REPO, BASE_PATH, True)
    avocado_bin = helper.get_avocado_bin()
    libvirt_cmd = '%s vt-bootstrap --vt-type libvirt \
                  --vt-update-providers --vt-skip-verify-download-assets \
                  --yes-to-all' % avocado_bin
    helper.runcmd(libvirt_cmd, err_str="Failed to bootstrap vt libvirt. Error:",
                  info_str="Bootstrapping vt libvirt")
    qemu_cmd = '%s vt-bootstrap --vt-type qemu --vt-update-providers \
               --vt-skip-verify-download-assets --yes-to-all' % avocado_bin
    helper.runcmd(qemu_cmd, err_str="Failed to bootstrap vt qemu. Error:",
                  info_str="Bootstrapping vt qemu")
Beispiel #3
0
def kvm_bootstrap(guest_os):
    """
    Prepare KVM Test environment
    """
    avocado_bin = helper.get_avocado_bin()
    libvirt_cmd = '%s vt-bootstrap --vt-type libvirt \
                  --vt-update-providers --vt-skip-verify-download-assets \
                  --yes-to-all' % avocado_bin
    helper.runcmd(libvirt_cmd, err_str="Failed to bootstrap vt libvirt. Error:",
                  info_str="\t\ti) Bootstrapping VT libvirt")
    qemu_cmd = '%s vt-bootstrap --vt-type qemu --vt-update-providers \
               --vt-skip-verify-download-assets --yes-to-all' % avocado_bin
    helper.runcmd(qemu_cmd, err_str="Failed to bootstrap vt qemu. Error:",
                  info_str="\t\tii) Bootstrapping VT qemu")
    if guest_os:
        guestos_cmd = '%s vt-bootstrap --vt-guest-os %s --yes-to-all' % (avocado_bin,
                                                                         guest_os)
        helper.runcmd(guestos_cmd, err_str="Failed to Download Guest OS. Error:",
                      info_str="\t\tiii) Downloading guest OS(%s) image" % guest_os)
Beispiel #4
0
def need_bootstrap(enable_kvm=False):
    """
    Check if bootstrap required
    :return: True if bootstrap is needed
    """
    logger.debug("Check if bootstrap required")
    needsBootstrap = False
    # Check for avocado
    if 'no avocado ' in helper.get_avocado_bin(ignore_status=True):
        logger.debug("Avocado needs to be installed")
        needsBootstrap = True
    if enable_kvm:
        # Check for avocado-vt
        for plugin in ['vt', 'vt-list', 'vt-bootstrap']:
            if not is_avocado_plugin_avl(plugin):
                logger.debug("Avocado %s plugin needs to installed", plugin)
                needsBootstrap = True
    # Check for avocado-tests
    for repo in TEST_REPOS:
        repo_name = repo.split('/')[-1].split('.')[0]
        if not os.path.isdir(os.path.join(TEST_DIR, repo_name)):
            logger.debug("Test needs to be downloaded/updated")
            needsBootstrap = True
    return needsBootstrap
Beispiel #5
0
     else:
         only_filter = args.guest_os
     if only_filter:
         TestSuite.guest_add_args += ' --vt-only-filter \
                                     "%s"' % only_filter
     if args.no_filter:
         TestSuite.guest_add_args += ' --vt-no-filter \
                                     "%s"' % args.no_filter
     if additional_args:
         TestSuite.guest_add_args += additional_args
 if "host_" in args.run_suite:
     TestSuite.host_add_args = additional_args
 test_suites = args.run_suite.split(',')
 if args.install_guest:
     test_suites.insert(0, 'guest_install')
 avocado_bin = helper.get_avocado_bin()
 Testsuites = {}
 # Validate if given test suite is available
 # and init TestSuite object for each test suite
 Testsuites_list = []
 for test_suite in test_suites:
     if 'host' in test_suite:
         test_list = parse_test_config(test_suite, avocado_bin,
                                       args.enable_kvm)
         if test_list is None:
             Testsuites[test_suite] = TestSuite(test_suite, outputdir,
                                                args.vt_type)
             Testsuites[test_suite].runstatus(
                 "Cant_Run", "Config file not present")
             continue
         for test in test_list: