lop-devops/tests

Check base packages and kvm packages

harish-24 opened this issue · 3 comments

When trying to run on a host (with kvm), only the following kvm packages are checked for.

# python avocado-setup.py 
14:46:32 INFO    : Check for environment
['libvirt-devel', 'tcpdump', 'virt-install', 'qemu-kvm', 'libvirt', 'SLOF', 'genisoimage', '^attr']

Is it supposed to check base + kvm packages?
i.e.

[deps_rhel8.0]
packages = gcc,python2-devel,xz-devel,python2-setuptools,numactl,policycoreutils-python-utils
and
[deps_rhel8.0_kvm]
packages = libvirt-devel,tcpdump,virt-install,qemu-kvm,libvirt,SLOF,genisoimage,^attr

it does both, not_found is appended anyways, we just reset the env_deps to take env specific,

   # try to check base packages
    env_deps = []
    if CONFIGFILE.has_section('deps_%s' % env_ver):
        packages = CONFIGFILE.get('deps_%s' % env_ver, 'packages')
        if packages != '':
            env_deps = packages.split(',')
    for dep in env_deps:
        if helper.runcmd(cmd_pat % dep, ignore_status=True)[0] != 0:
            not_found.append(dep)

    env_deps = []
    # try to check env specific packages
    if CONFIGFILE.has_section('deps_%s_%s' % (env_ver, env_type)):
        packages = CONFIGFILE.get('deps_%s_%s' % (env_ver, env_type), 'packages')
        if packages != '':
            env_deps = packages.split(',')
    for dep in env_deps:
        if helper.runcmd(cmd_pat % dep, ignore_status=True)[0] != 0:
            not_found.append(dep)
    if not_found:
        if args.no_deps_check:
            logger.warning(
                "No dependancy check flag is set, proceeding with bootstrap")
            logger.info("Please install following "
                        "dependancy packages %s", " ".join(not_found))
        else:
            logger.error("Please install following "
                         "dependancy packages %s", " ".join(not_found))
            sys.exit(1)

In code, I see we are doing it, what is the issue? is it not complaining about the base packages?

@sathnaga missed that part completely. Sorry for the confusion. Thanks for the clarification.