Example #1
0
    def setUp(self):
        softm = SoftwareManager()

        pkgs = ['gcc', 'make']
        if distro.detect().name in ['SuSE', 'Ubuntu']:
            pkgs.extend(['libpfm4'])
        else:
            pkgs.extend(['libpfm'])

        for pkg in pkgs:
            if not softm.check_installed(pkg) and not softm.install(pkg):
                self.cancel("%s is needed for the test to be run" % pkg)
        test_type = self.params.get('type', default='upstream')

        if test_type == 'upstream':
            tarball = self.fetch_asset(
                'https://netix.dl.sourceforge.net/project/perfmon2/'
                'libpfm4/libpfm-4.9.0.tar.gz', expire='1d')
            archive.extract(tarball, self.teststmpdir)
            version = os.path.basename(tarball.split('.tar.')[0])
            self.path = os.path.join(self.teststmpdir, version)
        elif test_type == 'distro':
            sourcedir = os.path.join(self.teststmpdir, 'libpfm-distro')
            if not os.path.exists(sourcedir):
                os.makedirs(sourcedir)
            if distro.detect().name == 'Ubuntu':
                self.path = softm.get_source('libpfm4', sourcedir)
            else:
                self.path = softm.get_source('libpfm', sourcedir)

        os.chdir(self.path)
        build.make(self.path)
    def setUp(self):
        """
        Verify :
        1. It is Power system and platform is Power NV.
        2. Cpupower tool is installed.
        """

        if 'ppc' not in distro.detect().arch:
            self.cancel("Processor is not ppc64")
        if not os.path.exists('/sys/devices/system/cpu/cpu0/cpufreq'):
            self.cancel('CPUFREQ is supported only on Power NV')

        smm = SoftwareManager()
        detected_distro = distro.detect()
        self.threshold = int(self.params.get("threshold", default=300000))
        if 'Ubuntu' in detected_distro.name:
            deps = ['linux-tools-common', 'linux-tools-%s'
                    % platform.uname()[2]]
        elif detected_distro.name == "SuSE":
            deps = ['cpupower']
        else:
            deps = ['kernel-tools']
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        self.cpus = cpu.total_cpus_count()
        self.cpu_num = 0
        self.max_freq = 0
        self.quad_dict = {}
        self.max_freq_dict = {}
        self.quad_to_cpu_mapping()
    def setUp(self):
        '''
        Build ebizzy
        '''
        if 'ppc' not in distro.detect().arch:
            self.cancel("Processor is not ppc64")
        smg = SoftwareManager()
        detected_distro = distro.detect()
        deps = ['gcc', 'make', 'patch']
        if 'Ubuntu' in detected_distro.name:
            deps.extend(['linux-tools-common', 'linux-tools-%s'
                         % platform.uname()[2]])
        elif detected_distro.name == "SuSE":
            deps.extend(['cpupower'])
        else:
            deps.extend(['kernel-tools'])
        for package in deps:
            if not smg.check_installed(package) and not smg.install(package):
                self.cancel("%s is needed for the test to be run" % package)
        tarball = self.fetch_asset('http://liquidtelecom.dl.sourceforge.net'
                                   '/project/ebizzy/ebizzy/0.3'
                                   '/ebizzy-0.3.tar.gz')
        archive.extract(tarball, self.workdir)
        version = os.path.basename(tarball.split('.tar.')[0])
        self.sourcedir = os.path.join(self.workdir, version)

        patch = self.params.get(
            'patch', default='Fix-build-issues-with-ebizzy.patch')

        os.chdir(self.sourcedir)
        fix_patch = 'patch -p0 < %s' % (self.get_data(patch))
        process.run(fix_patch, shell=True)
        process.run("./configure")
        build.make(self.sourcedir)
    def setUp(self):
        """
        Build bonnie++
        Source:
         http://www.coker.com.au/bonnie++/experimental/bonnie++-1.03e.tgz
        """
        fstype = self.params.get('fs', default='ext4')
        smm = SoftwareManager()
        deps = ['gcc', 'make']
        if distro.detect().name == 'Ubuntu':
            deps.extend(['g++'])
        else:
            deps.extend(['gcc-c++'])
        if fstype == 'btrfs':
            if distro.detect().name == 'Ubuntu':
                deps.extend(['btrfs-tools'])

        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Fail to install/check %s, which is needed for"
                            "Bonnie test to run" % package)

        self.disk = self.params.get('disk', default=None)
        self.scratch_dir = self.params.get('dir', default=self.srcdir)
        self.uid_to_use = self.params.get('uid-to-use',
                                          default=getpass.getuser())
        self.number_to_stat = self.params.get('number-to-stat', default=2048)
        self.data_size = self.params.get('data_size_to_pass', default=0)

        tarball = self.fetch_asset('http://www.coker.com.au/bonnie++/'
                                   'bonnie++-1.03e.tgz', expire='7d')
        archive.extract(tarball, self.teststmpdir)
        self.source = os.path.join(self.teststmpdir,
                                   os.path.basename(tarball.split('.tgz')[0]))
        os.chdir(self.source)
        process.run('./configure')
        build.make(self.source)

        if self.disk is not None:
            self.part_obj = Partition(self.disk, mountpoint=self.scratch_dir)
            self.log.info("Test will run on %s", self.scratch_dir)
            self.log.info("Unmounting disk/dir before creating file system")
            self.part_obj.unmount()
            self.log.info("creating %s file system on %s disk",
                          fstype, self.disk)
            self.part_obj.mkfs(fstype)
            self.log.info("Mounting disk %s on directory %s",
                          self.disk, self.scratch_dir)
            self.part_obj.mount()
Example #5
0
 def setUp(self):
     if "ppc" not in distro.detect().arch:
         self.cancel("supported only on Power platform")
     dist = distro.detect()
     if dist.name == 'Ubuntu':
         tar_ball = self.params.get('tar_ball_ubuntu', default='nstress_Ubuntu1410_ppc64_Nov_2015.tar')
     elif dist.name == 'rhel':
         tar_ball = self.params.get('tar_ball_rhel', default='nstress_RHEL71_LE_ppc64_Nov_2015.tar')
     elif dist.name == 'SuSE':
         tar_ball = self.params.get('tar_ball_sles', default='nstress_SLES12_ppc64_Nov_2015.tar')
     url = os.path.join('http://public.dhe.ibm.com/systems/power/community/wikifiles/PerfTools/',
                        tar_ball)
     tarball = self.fetch_asset(url, expire='10d')
     archive.extract(tarball, self.workdir)
     self.duration = self.params.get('duration', default=300)
    def setUp(self):
        smm = SoftwareManager()
        self.failures = []

        dist = distro.detect()
        deps = ['gcc', 'make']
        if dist.name == 'Ubuntu':
            deps.extend(['g++'])
        # FIXME: "redhat" as the distro name for RHEL is deprecated
        # on Avocado versions >= 50.0.  This is a temporary compatibility
        # enabler for older runners, but should be removed soon
        elif dist.name in ['SuSE', 'rhel', 'fedora', 'centos', 'redhat']:
            deps.extend(['gcc-c++'])
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)
        run_type = self.params.get('type', default='upstream')
        if run_type == "upstream":
            url = self.params.get('url', default="ftp://sourceware.org/pub/"
                                  "valgrind/valgrind-3.13.0.tar.bz2")
            tarball = self.fetch_asset(url)
            archive.extract(tarball, self.workdir)
            version = os.path.basename(tarball.split('.tar.')[0])
            self.sourcedir = os.path.join(self.workdir, version)
        elif run_type == "distro":
            self.sourcedir = os.path.join(self.workdir, 'valgrind-distro')
            if not os.path.exists(self.sourcedir):
                os.makedirs(self.sourcedir)
            self.sourcedir = smm.get_source('valgrind', self.sourcedir)
        os.chdir(self.sourcedir)
        process.run('./configure', ignore_status=True, sudo=True)
    def setUp(self):
        """
        Verifies if powerpc-utils is installed, and gets current SMT value.
        """
        if 'ppc' not in distro.detect().arch:
            self.cancel("Processor is not ppc64")
        if SoftwareManager().check_installed("powerpc-utils") is False:
            if SoftwareManager().install("powerpc-utils") is False:
                self.cancel("powerpc-utils is not installing")
        self.smt_str = "ppc64_cpu --smt"
        smt_op = process.system_output(self.smt_str, shell=True)
        if "is not SMT capable" in smt_op:
            self.cancel("Machine is not SMT capable")
        if "Inconsistent state" in smt_op:
            self.cancel("Machine has mix of ST and SMT cores")

        self.curr_smt = smt_op.strip().split("=")[-1].split()[-1]
        self.smt_subcores = 0
        if os.path.exists("/sys/devices/system/cpu/subcores_per_core"):
            self.smt_subcores = 1
        self.failures = 0
        self.failure_message = "\n"
        self.smt_values = {1: "off"}
        self.key = 0
        self.value = ""
        self.max_smt_value = 4
        if cpu.get_cpu_arch().lower() == 'power8':
            self.max_smt_value = 8
        if cpu.get_cpu_arch().lower() == 'power6':
            self.max_smt_value = 2
Example #8
0
    def create_iSCSI(params, root_dir=data_dir.get_tmp_dir()):
        iscsi_instance = None
        ubuntu = distro.detect().name == 'Ubuntu'
        # check and install iscsi initiator packages
        if ubuntu:
            iscsi_package = ["open-iscsi"]
        else:
            iscsi_package = ["iscsi-initiator-utils"]

        if not utils_package.package_install(iscsi_package):
            raise exceptions.TestError("Failed to install iscsi initiator"
                                       " packages")
        # Install linux iscsi target software targetcli
        iscsi_package = ["targetcli"]
        if not utils_package.package_install(iscsi_package):
            logging.error("Failed to install targetcli trying with scsi-"
                          "target-utils or tgt package")
            # try with scsi target utils if targetcli is not available
            if ubuntu:
                iscsi_package = ["tgt"]
            else:
                iscsi_package = ["scsi-target-utils"]
            if not utils_package.package_install(iscsi_package):
                raise exceptions.TestError("Failed to install iscsi target and"
                                           " initiator packages")
            iscsi_instance = IscsiTGT(params, root_dir)
        else:
            iscsi_instance = IscsiLIO(params, root_dir)
        return iscsi_instance
Example #9
0
    def setUp(self):
        smm = SoftwareManager()
        self.minthreads = self.params.get(
            'minthrd', default=(500 + cpu.online_cpus_count()))
        self.maxthreads = self.params.get('maxthrd', default=None)
        self.iothreads = self.params.get('iothrd', default=self.minthreads/2)
        self.maxmem = self.params.get('maxmem', default=int(
            memory.meminfo.MemFree.m / self.minthreads))
        self.maxio = self.params.get('maxio', default=None)
        self.longthreads = self.params.get('longthrd', default=False)
        self.shrtthreads = self.params.get('shortthrd', default=False)
        self.time = self.params.get('time', default=100)
        self.iotime = self.params.get('iotime', default=50)

        if self.longthreads and self.shrtthreads:
            self.cancel('Please choose right inputs')

        dist = distro.detect()
        packages = ['gcc']
        if dist.name == 'Ubuntu':
            packages.extend(['g++'])
        elif dist.name in ['SuSE', 'fedora', 'rhel']:
            packages.extend(['gcc-c++'])
        for package in packages:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        for file_name in ['dwh.cpp', 'Makefile']:
            self.copyutil(file_name)
        os.chdir(self.teststmpdir)
        if dist.name in ['fedora', 'rhel']:
            process.system('patch -p0 < %s' %
                           self.get_data('fofd.patch'), shell=True)
        build.make(self.teststmpdir)
    def setUp(self):
        '''
        Build Integrity Test
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        self.scenario_arg = self.params.get('scenario_arg', default='1')
        if self.scenario_arg not in ['1', '2', '3']:
            self.cancel("Test need to skip as scenario needs to be 1-3")
        detected_distro = distro.detect()
        deps = ['gcc', 'make']
        if detected_distro.name == "Ubuntu":
            deps.extend(['libnuma-dev'])
        elif detected_distro.name in ["centos", "rhel", "fedora"]:
            deps.extend(['numactl-devel'])
        else:
            deps.extend(['libnuma-devel'])
        for packages in deps:
            if not smm.check_installed(packages) and not smm.install(packages):
                self.cancel('%s is needed for the test to be run' % packages)

        archive.extract(self.get_data("Integritytests.tar"), self.workdir)
        self.build_dir = os.path.join(self.workdir, 'Integritytests')
        build.make(self.build_dir)
    def setUp(self):
        """
        Build 'aiostress'.
        Source:
         https://oss.oracle.com/~mason/aio-stress/aio-stress.c
        """
        smm = SoftwareManager()
        packages = []
        dist_name = distro.detect().name.lower()
        if dist_name == 'ubuntu':
            packages.extend(['libaio1', 'libaio-dev'])
        # FIXME: "redhat" as the distro name for RHEL is deprecated
        # on Avocado versions >= 50.0.  This is a temporary compatibility
        # enabler for older runners, but should be removed soon
        elif dist_name in ['centos', 'fedora', 'rhel', 'redhat']:
            packages.extend(['libaio', 'libaio-devel'])
        elif dist_name == 'suse':
            packages.extend(['libaio1', 'libaio-devel'])

        for package in packages:
            if not smm.check_installed(package) and not smm.install(package):
                self.error('%s is needed for the test to be run' % package)

        aiostress = self.fetch_asset(
            'https://oss.oracle.com/~mason/aio-stress/aio-stress.c')
        os.chdir(self.workdir)
        # This requires libaio.h in order to build
        # -laio -lpthread is provided at end as a workaround for Ubuntu
        process.run('gcc -Wall -o aio-stress %s -laio -lpthread' % aiostress)
Example #12
0
    def setUp(self):
        '''
        Build IOZone
        Source:
        http://www.iozone.org/src/current/iozone3_434.tar
        '''

        self.base_dir = os.path.abspath(self.basedir)
        smm = SoftwareManager()
        for package in ['gcc', 'make', 'patch']:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("%s is needed for the test to be run" % package)
        tarball = self.fetch_asset(
            'http://www.iozone.org/src/current/iozone3_434.tar')
        archive.extract(tarball, self.teststmpdir)
        version = os.path.basename(tarball.split('.tar')[0])
        self.sourcedir = os.path.join(self.teststmpdir, version)

        make_dir = os.path.join(self.sourcedir, 'src', 'current')
        os.chdir(make_dir)
        patch = self.params.get('patch', default='makefile.patch')
        patch = os.path.join(self.datadir, patch)
        process.run('patch -p3 < %s' % patch, shell=True)

        d_distro = distro.detect()
        arch = d_distro.arch
        if arch == 'ppc':
            build.make(make_dir, extra_args='linux-powerpc')
        elif arch == 'ppc64' or arch == 'ppc64le':
            build.make(make_dir, extra_args='linux-powerpc64')
        elif arch == 'x86_64':
            build.make(make_dir, extra_args='linux-AMD64')
        else:
            build.make(make_dir, extra_args='linux')
    def setUp(self):
        """
        Build 'fio'.
        """
        default_url = "http://brick.kernel.dk/snaps/fio-2.1.10.tar.gz"
        url = self.params.get('fio_tool_url', default=default_url)
        self.disk = self.params.get('disk', default=None)
        self.dir = self.params.get('dir', default=self.srcdir)
        fstype = self.params.get('fs', default='ext4')
        tarball = self.fetch_asset(url)
        archive.extract(tarball, self.teststmpdir)
        fio_version = os.path.basename(tarball.split('.tar.')[0])
        self.sourcedir = os.path.join(self.teststmpdir, fio_version)
        build.make(self.sourcedir)

        smm = SoftwareManager()
        if fstype == 'btrfs':
            if distro.detect().name == 'Ubuntu':
                if not smm.check_installed("btrfs-tools") and not \
                        smm.install("btrfs-tools"):
                    self.cancel('btrfs-tools is needed for the test to be run')

        if self.disk is not None:
            self.part_obj = Partition(self.disk, mountpoint=self.dir)
            self.log.info("Unmounting disk/dir before creating file system")
            self.part_obj.unmount()
            self.log.info("creating file system")
            self.part_obj.mkfs(fstype)
            self.log.info("Mounting disk %s on directory %s",
                          self.disk, self.dir)
            self.part_obj.mount()
    def setUp(self):
        '''
        Build numatop Test
        Source:
        https://github.com/01org/numatop.git
        '''

        # Check for basic utilities
        # TODO: Add support for other distributions
        self.numa_pid = None
        detected_distro = distro.detect().name.lower()
        if not detected_distro == "ubuntu":
            self.cancel("Upsupported OS %s" % detected_distro)
        smm = SoftwareManager()
        for package in ['gcc', 'numatop', 'make', 'libnuma-dev']:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Failed to install %s, which is needed for"
                            "the test to be run" % package)

        locations = ["https://github.com/01org/numatop/archive/master.zip"]
        tarball = self.fetch_asset("numatop.zip", locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.srcdir)
        self.sourcedir = os.path.join(self.srcdir, 'numatop-master')

        os.chdir(self.sourcedir)

        build.make(self.sourcedir, extra_args='test')
    def setUp(self):
        '''
        Install the basic packages to support perf
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        self.distro_name = detected_distro.name
        deps = ['gcc', 'make']
        if 'Ubuntu' in self.distro_name:
            deps.extend(['linux-tools-common', 'linux-tools-%s' %
                         platform.uname()[2]])
        elif self.distro_name in ['rhel', 'SuSE', 'fedora', 'centos']:
            deps.extend(['perf'])
        else:
            self.cancel("Install the package for perf supported\
                      by %s" % detected_distro.name)
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        shutil.copyfile(self.get_data('uprobe.c'),
                        os.path.join(self.teststmpdir, 'uprobe.c'))

        shutil.copyfile(self.get_data('Makefile'),
                        os.path.join(self.teststmpdir, 'Makefile'))

        build.make(self.teststmpdir)
        os.chdir(self.teststmpdir)
        self.temp_file = tempfile.NamedTemporaryFile().name
        self.cmdProbe = "perf probe -x"
        self.recProbe = "perf record -o %s -e probe_uprobe_test:doit" % self.temp_file
        self.report = "perf report --input=%s" % self.temp_file
        self.distro_version = detected_distro.version
Example #16
0
    def run(self, args):
        if args.distro_def_create:
            if not (args.distro_def_name and args.distro_def_version and
                    args.distro_def_arch and args.distro_def_type and
                    args.distro_def_path):
                LOG_UI.error('Required arguments: name, version, arch, type '
                             'and path')
                sys.exit(exit_codes.AVOCADO_FAIL)

            output_file_name = self.get_output_file_name(args)
            if os.path.exists(output_file_name):
                error_msg = ('Output file "%s" already exists, will not '
                             'overwrite it', output_file_name)
                LOG_UI.error(error_msg)
            else:
                LOG_UI.debug("Loading distro information from tree... "
                             "Please wait...")
                distro = load_from_tree(args.distro_def_name,
                                        args.distro_def_version,
                                        args.distro_def_release,
                                        args.distro_def_arch,
                                        args.distro_def_type,
                                        args.distro_def_path)
                save_distro(distro, output_file_name)
                LOG_UI.debug('Distro information saved to "%s"',
                             output_file_name)
        else:
            detected = utils_distro.detect()
            LOG_UI.debug('Detected distribution: %s (%s) version %s release '
                         '%s', detected.name, detected.arch, detected.version,
                         detected.release)
Example #17
0
    def __init__(self, params):
        self.mount_dir = params.get("nfs_mount_dir")
        self.mount_options = params.get("nfs_mount_options")
        self.mount_src = params.get("nfs_mount_src")
        self.nfs_setup = False
        path.find_command("mount")
        self.mk_mount_dir = False
        self.unexportfs_in_clean = False
        distro_details = distro.detect()

        if params.get("setup_local_nfs") == "yes":
            self.nfs_setup = True
            path.find_command("service")
            path.find_command("exportfs")
            if distro_details.name == 'Ubuntu':
                self.nfs_service = service.Factory.create_service("nfs-server")
            else:
                self.nfs_service = service.Factory.create_service("nfs")
            self.rpcbind_service = service.Factory.create_service("rpcbind")

            self.export_dir = (params.get("export_dir") or
                               self.mount_src.split(":")[-1])
            self.export_ip = params.get("export_ip", "*")
            self.export_options = params.get("export_options", "").strip()
            self.exportfs = Exportfs(self.export_dir, self.export_ip,
                                     self.export_options)
            self.mount_src = "127.0.0.1:%s" % self.export_dir
 def setUp(self):
     '''
         To check and install dependencies for the test
     '''
     smm = SoftwareManager()
     pkgs = ["ethtool", "net-tools"]
     detected_distro = distro.detect()
     if detected_distro.name == "Ubuntu":
         pkgs.extend(["openssh-client", "iputils-ping"])
     elif detected_distro.name == "SuSE":
         pkgs.extend(["openssh", "iputils"])
     else:
         pkgs.extend(["openssh-clients", "iputils"])
     for pkg in pkgs:
         if not smm.check_installed(pkg) and not smm.install(pkg):
             self.cancel("%s package is need to test" % pkg)
     interfaces = netifaces.interfaces()
     interface = self.params.get("interface")
     if interface not in interfaces:
         self.cancel("%s interface is not available" % interface)
     mtu_list = self.params.get("size_val", default=1500)
     self.mtu_list = mtu_list.split()
     self.iface = interface
     self.peer = self.params.get("peer_ip")
     self.eth = "ethtool %s | grep 'Link detected:'" % self.iface
     self.eth_state = process.system_output(self.eth, shell=True)
     if AF_INET in netifaces.ifaddresses(self.iface):
         self.ip_set = netifaces.ifaddresses(self.iface)[AF_INET][0]['addr']
Example #19
0
 def setUp(self):
     sm = SoftwareManager()
     detected_distro = distro.detect()
     self.tmpdir = data_dir.get_tmp_dir()
     # Check for basic utilities
     for package in ['gcc', 'make', 'gfortran']:
         if detected_distro.name == "SuSE" and package == "gfortran":
             package = 'gcc-fortran'
         # FIXME: "redhat" as the distro name for RHEL is deprecated
         # on Avocado versions >= 50.0.  This is a temporary compatibility
         # enabler for older runners, but should be removed soon
         if detected_distro.name in ["rhel", "redhat"] and package == "gfortran":
             package = 'gcc-gfortran'
         if not sm.check_installed(package) and not sm.install(package):
             self.error(package + ' is needed for the test to be run')
     atlas_url = 'https://sourceforge.net/projects/'\
                 'math-atlas/files/Stable/3.10.3/atlas3.10.3.tar.bz2'
     lapack_url = 'http://www.netlib.org/lapack/lapack-3.6.1.tgz'
     atlas_url = self.params.get('atlas_url', default=atlas_url)
     lapack_url = self.params.get('lapack_url', default=lapack_url)
     atlas_tarball = self.fetch_asset(atlas_url, expire='7d')
     archive.extract(atlas_tarball, self.workdir)
     self.atlas_dir = os.path.join(self.workdir, 'ATLAS')
     self.atlas_build_dir = os.path.join(self.atlas_dir, 'atlas_build_dir')
     os.makedirs(self.atlas_build_dir)
     lapack_tarball = self.fetch_asset(lapack_url, expire='7d')
     os.chdir(self.atlas_build_dir)
     config_args = '--shared -b 64 '\
                   '--with-netlib-lapack-tarfile=%s '\
                   '--cripple-atlas-performance' % lapack_tarball
     config_args = self.params.get('config_args', default=config_args)
     process.system('../configure %s' % config_args)
     # Tune and compile library
     build.make(self.atlas_build_dir)
Example #20
0
    def setUp(self):
        '''
        Build Bcc Test
        Source:
        https://github.com/iovisor/bcc
        '''

        # Check for basic utilities
        detected_distro = distro.detect().name.lower()
        smm = SoftwareManager()
        # TODO: Add support for other distributions
        if not detected_distro == "ubuntu":
            self.cancel("Upsupported OS %s" % detected_distro)
        for package in ['bison', 'build-essential', 'cmake', 'flex',
                        'libedit-dev', 'libllvm3.8', 'llvm-3.8-dev',
                        'libclang-3.8-dev', 'python', 'zlib1g-dev',
                        'libelf-dev', 'clang-format-3.8', 'python-netaddr',
                        'python-pyroute2', 'arping', 'iperf', 'netperf',
                        'ethtool']:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Failed to install %s, which is needed for"
                            "the test to be run" % package)

        locations = ["https://github.com/iovisor/bcc/archive/master.zip"]
        tarball = self.fetch_asset("bcc.zip", locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.srcdir)
        self.sourcedir = os.path.join(self.srcdir, 'bcc-master')
        os.makedirs('%s/build' % self.sourcedir)
        self.builddir = '%s/build' % self.sourcedir
        os.chdir(self.builddir)
        process.run('cmake .. -DCMAKE_INSTALL_PREFIX=/usr', shell=True)

        build.make(self.builddir)
    def setUp(self):
        '''
        Build linsched  Test
        Source:
        https://github.com/thejinxters/linux-scheduler-testing
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        deps = ['gcc', 'make', 'patch']
        if distro.detect().name == "SuSE":
            deps.append('git-core')
        else:
            deps.append('git')
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel(
                    "Fail to install %s required for this test." % package)
        self.args = self.params.get('args', default='pi 100')
        git.get_repo('https://github.com/thejinxters/linux-scheduler-testing',
                     destination_dir=self.srcdir)
        os.chdir(self.srcdir)
        fix_patch = 'patch -p1 < %s' % (
            os.path.join(self.datadir, 'fix.patch'))
        process.run(fix_patch, shell=True, ignore_status=True)

        build.make(self.srcdir)
    def setUp(self):
        '''
        Build Connectathon
        Source:
        git://git.linux-nfs.org/projects/steved/cthon04.git
        '''
        self.nfail = 0
        # Check for root permission
        if os.geteuid() != 0:
            exit("You need to have root privileges to run this script."
                 "\nPlease try again, using 'sudo'. Exiting.")
        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        packages = ['gcc', 'make']

        if detected_distro.name == "SuSE":
            packages.extend(['git-core'])

        else:
            packages.extend(['git'])

        for package in packages:
            if not smm.check_installed(package) and not smm.install(package):
                self.error("Fail to install %s required for this test." %
                           package)

        self.tmpdir = tempfile.mkdtemp(prefix='avocado_' + __name__)
        data_dir = os.path.abspath(self.datadir)
        git.get_repo('git://git.linux-nfs.org/projects/steved/cthon04.git',
                     destination_dir=self.srcdir)
        os.chdir(self.srcdir)

        build.make(self.srcdir)
    def test_traceroute(self):
        """
        Verify traceroute,traceroute6 functionality.
        """
        ret = process.run(cmd="traceroute localhost",
                          env={"LANG": "C"})
        no_of_hops = re.search(r"(\d+)\s+\S+\s*\(127.0.0.1\)",
                               ret.stdout).group(1)
        # Only one hop is required to get to localhost.
        if str(no_of_hops) != '1':
            self.fail("traceroute did not show 1 hop for localhost")

        if self.ipv6:
            detected_distro = distro.detect()
            if detected_distro.name in ("SuSE", "Ubuntu"):
                ret = process.run(cmd="traceroute6 ipv6-localhost",
                                  env={"LANG": "C"})
            else:
                ret = process.run(cmd="traceroute6 localhost6",
                                  env={"LANG": "C"})
            no_of_hops = re.search(r"(\d+)\s+\S+\s*\(::1\)",
                                   ret.stdout).group(1)
            if str(no_of_hops) != '1':
                self.fail("traceroute6 did not show 1 hop for "
                          "localhost6/ipv6-localhost")
 def install_packages(self):
     '''
     Install necessary packages
     '''
     smm = SoftwareManager()
     detected_distro = distro.detect()
     self.log.info("Test is running on %s", detected_distro.name)
     if not smm.check_installed("ksh") and not smm.install("ksh"):
         self.cancel('ksh is needed for the test to be run')
     if detected_distro.name == "Ubuntu":
         if not smm.check_installed("python-paramiko") and not \
                 smm.install("python-paramiko"):
             self.cancel('python-paramiko is needed for the test to be run')
         ubuntu_url = self.params.get('ubuntu_url', default=None)
         debs = self.params.get('debs', default=None)
         if not ubuntu_url or not debs:
             self.cancel("No url specified")
         for deb in debs:
             deb_url = os.path.join(ubuntu_url, deb)
             deb_install = self.fetch_asset(deb_url, expire='7d')
             shutil.copy(deb_install, self.workdir)
             process.system("dpkg -i %s/%s" % (self.workdir, deb),
                            ignore_status=True, sudo=True)
     else:
         url = self.params.get('url', default=None)
         if not url:
             self.cancel("No url specified")
         rpm_install = self.fetch_asset(url, expire='7d')
         shutil.copy(rpm_install, self.workdir)
         os.chdir(self.workdir)
         process.run('chmod +x ibmtools')
         process.run('./ibmtools --install --managed')
    def setUp(self):
        '''
        Install the basic packages to support perf
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        kernel_ver = platform.uname()[2]
        deps = ['gcc', 'make']
        if 'Ubuntu' in detected_distro.name:
            deps.extend(['linux-tools-common', 'linux-tools-%s' % kernel_ver])
        # FIXME: "redhat" as the distro name for RHEL is deprecated
        # on Avocado versions >= 50.0.  This is a temporary compatibility
        # enabler for older runners, but should be removed soon
        elif detected_distro.name in ['rhel', 'SuSE', 'fedora', 'centos', 'redhat']:
            deps.extend(['perf'])
        else:
            self.cancel("Install the package for perf supported\
                      by %s" % detected_distro.name)
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        locations = ["https://github.com/rfmvh/perftool-testsuite/archive/"
                     "master.zip"]
        tarball = self.fetch_asset("perftool.zip", locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.srcdir)
        self.sourcedir = os.path.join(self.srcdir, 'perftool-testsuite-master')
Example #26
0
 def setUp(self):
     sm = SoftwareManager()
     dist = distro.detect()
     packages = ['gcc', 'dejagnu', 'flex', 'bison', 'texinfo']
     if dist.name == 'Ubuntu':
         packages.extend(['g++', 'binutils-dev'])
     # FIXME: "redhat" as the distro name for RHEL is deprecated
     # on Avocado versions >= 50.0.  This is a temporary compatibility
     # enabler for older runners, but should be removed soon
     elif dist.name in ['SuSE', 'rhel', 'fedora', 'redhat']:
         packages.extend(['gcc-c++', 'binutils-devel', 'texi2html'])
     else:
         self.fail('no packages list for your distro.')
     for package in packages:
         if not sm.check_installed(package) and not sm.install(package):
             self.error("Fail to install %s required for this test." %
                        package)
     test_type = self.params.get('type', default='upstream')
     if test_type == 'upstream':
         gdb_version = self.params.get('gdb_version', default='7.10')
         tarball = self.fetch_asset(
             "http://ftp.gnu.org/gnu/gdb/gdb-%s.tar.gz" % gdb_version)
         archive.extract(tarball, self.workdir)
         sourcedir = os.path.join(
             self.workdir, os.path.basename(tarball.split('.tar')[0]))
     elif test_type == 'distro':
         sourcedir = os.path.join(self.workdir, 'gdb-distro')
         if not os.path.exists(sourcedir):
             os.makedirs(sourcedir)
         sourcedir = sm.get_source("gdb", sourcedir)
     os.chdir(sourcedir)
     process.run('./configure', ignore_status=True, sudo=True)
     build.make(sourcedir)
Example #27
0
 def setUp(self):
     '''
     To check and install dependencies for the test
     '''
     sm = SoftwareManager()
     detected_distro = distro.detect()
     depends = ["openssh-clients"]
     if detected_distro.name == "Ubuntu":
         depends.append("ibverbs")
     elif detected_distro.name == "redhat":
         depends.append("libibverbs")
     for package in depends:
         if not sm.check_installed(package):
             self.error("%s package is need to test" % package)
     if process.system("ibstat", shell=True) != 0:
         self.skip("infiniband adaptors not available")
     interfaces = netifaces.interfaces()
     self.flag = self.params.get("ext_flag", default="0")
     self.IF = self.params.get("Iface", default="")
     self.PEER_IP = self.params.get("PEERIP", default="")
     if self.IF not in interfaces:
         self.skip("%s interface is not available" % self.IF)
     if self.PEER_IP == "":
         self.skip("%s peer machine is not available" % self.PEER_IP)
     self.CA = self.params.get("CA_NAME", default="mlx4_0")
     self.GID = int(self.params.get("GID_NUM", default="0"))
     self.PORT = int(self.params.get("PORT_NUM", default="1"))
     self.PEER_CA = self.params.get("PEERCA", default="mlx4_0")
     self.PEER_GID = int(self.params.get("PEERGID", default="0"))
     self.PEER_PORT = int(self.params.get("PEERPORT", default="1"))
     self.to = self.params.get("timeout", default="120")
    def setUp(self):
        """
        fs_mark
        """

        smm = SoftwareManager()
        tarball = self.fetch_asset('https://github.com/josefbacik/fs_mark/'
                                   'archive/master.zip')
        archive.extract(tarball, self.teststmpdir)
        self.sourcedir = os.path.join(self.teststmpdir, 'fs_mark-master')
        os.chdir(self.sourcedir)
        process.run('make')
        build.make(self.sourcedir)
        self.disk = self.params.get('disk', default=None)
        self.num = self.params.get('num_files', default='1024')
        self.size = self.params.get('size', default='1000')
        self.dir = self.params.get('dir', default=self.srcdir)
        self.fstype = self.params.get('fs', default='ext4')

        if self.fstype == 'btrfs':
            if distro.detect().name == 'Ubuntu':
                if not smm.check_installed("btrfs-tools") and not \
                        smm.install("btrfs-tools"):
                    self.cancel('btrfs-tools is needed for the test to be run')

        if self.disk is not None:
            self.part_obj = Partition(self.disk, mountpoint=self.dir)
            self.log.info("Test will run on %s", self.dir)
            self.log.info("Unmounting the disk before creating file system")
            self.part_obj.unmount()
            self.log.info("creating file system")
            self.part_obj.mkfs(self.fstype)
            self.log.info("Mounting disk %s on dir %s", self.disk, self.dir)
            self.part_obj.mount()
 def setUp(self):
     '''
     To check and install dependencies for the test
     '''
     smm = SoftwareManager()
     pkgs = ["net-tools"]
     detected_distro = distro.detect()
     if detected_distro.name == "Ubuntu":
         pkgs.extend(["openssh-client", "iputils-ping"])
     elif detected_distro.name == "SuSE":
         pkgs.extend(["openssh", "iputils"])
     else:
         pkgs.extend(["openssh-clients", "iputils"])
     for pkg in pkgs:
         if not smm.check_installed(pkg) and not smm.install(pkg):
             self.cancel("%s package is need to test" % pkg)
     interfaces = netifaces.interfaces()
     self.iface = self.params.get("interface")
     if self.iface not in interfaces:
         self.cancel("%s interface is not available" % self.iface)
     self.peer = self.params.get("peer_ip", default="")
     if self.peer == "":
         self.cancel("peer ip should specify in input")
     self.user = self.params.get("user_name", default="root")
     msg = "ip addr show  | grep %s | grep -oE '[^ ]+$'" % self.peer
     cmd = "ssh %s@%s \"%s\"" % (self.user, self.peer, msg)
     self.peerif = process.system_output(cmd, shell=True).strip()
     if self.peerif == "":
         self.cancel("unable to get peer interface")
     cmd = "ip -f inet -o addr show %s | awk '{print $4}' | cut -d / -f1"\
           % self.iface
     self.local_ip = process.system_output(cmd, shell=True).strip()
     if self.local_ip == "":
         self.cancel("unable to get local ip")
    def setUp(self):
        '''
        Check for required packages namely gcc, make, valgrind.
        Transfer the source file and make file.
        Compile
        '''
        smm = SoftwareManager()

        dist = distro.detect()
        if dist.arch != "ppc64le":
            self.cancel("Test is not applicable!!")
        deps = ['gcc', 'make', 'valgrind']
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        self.log.info("Tranferring the files ...")
        shutil.copyfile(self.get_data('print_power_time_base.c'),
                        os.path.join(self.teststmpdir, 'print_power_time_base.c'))

        self.log.info("About to compile ...")
        shutil.copyfile(self.get_data('Makefile'),
                        os.path.join(self.teststmpdir, 'Makefile'))

        build.make(self.teststmpdir)
    def setUp(self):
        smg = SoftwareManager()
        dist = distro.detect()
        if dist.name in ['Ubuntu', 'debian']:
            linux_tools = "linux-tools-" + os.uname()[2][3]
            pkgs = [linux_tools]
            if dist.name in ['Ubuntu']:
                pkgs.extend(['linux-tools-common'])
        elif dist.name in ['centos', 'fedora', 'rhel', 'SuSE']:
            pkgs = ['perf']
        else:
            self.cancel("perf is not supported on %s" % dist.name)

        for pkg in pkgs:
            if not smg.check_installed(pkg) and not smg.install(pkg):
                self.cancel("Package %s is missing/could not be installed" %
                            pkg)
        process.run("ppc64_cpu --frequency -t 10 &",
                    shell=True,
                    ignore_status=True,
                    verbose=True,
                    ignore_bg_processes=True)
Example #32
0
    def setUp(self):
        """
        fs_mark
        """

        smm = SoftwareManager()
        tarball = self.fetch_asset('http://prdownloads.source'
                                   'forge.net/fsmark/fs_mark-3.3.tar.gz')
        archive.extract(tarball, self.srcdir)
        fs_version = os.path.basename(tarball.split('.tar.')[0])
        self.srcdir = os.path.join(self.srcdir, fs_version)
        os.chdir(self.srcdir)
        process.run('make')
        build.make(self.srcdir)
        self.disk = self.params.get('disk', default=None)
        self.fstype = self.params.get('fs', default='ext4')

        if self.fstype == 'btrfs':
            if distro.detect().name == 'Ubuntu':
                if not smm.check_installed("btrfs-tools") and not \
                        smm.install("btrfs-tools"):
                    self.cancel('btrfs-tools is needed for the test to be run')
    def setUp(self):
        """
        Setup
        """
        if 'ppc64' not in distro.detect().arch:
            self.cancel("Platform does not supports")

        self.mdt_file = self.params.get('mdt_file', default='mdt.hd')
        self.time_limit = int(self.params.get('time_limit', default=1)) * 60
        self.block_devices = self.params.get('htx_disks', default=None)
        self.all = self.params.get('all', default=False)

        if not self.all and self.block_devices is None:
            self.cancel("Needs the block devices to run the HTX")
        if self.all:
            self.block_device = ""
        else:
            self.block_device = []
            for disk in self.block_devices.split():
                self.block_device.append(disk.rsplit("/")[-1])
            self.block_device = " ".join(self.block_device)
        self.failed = False
 def test(self):
     dist = distro.detect()
     is_fail = 0
     if dist.name == 'rhel':
         packages_rhel = self.params.get('packages_rhel',
                                         default=['lshw', 'librtas'])
         self.packages.extend(packages_rhel)
         for package in self.packages:
             if "anaconda" in process.system_output("yum list installed | "
                                                    "grep %s | tail -1" %
                                                    package,
                                                    shell=True):
                 self.log.info("%s package is installed by default" %
                               package)
             else:
                 self.log.info("%s package is not installed by default" %
                               package)
                 is_fail += 1
     elif dist.name == 'Ubuntu':
         packages_ubuntu = self.params.get('packages_ubuntu',
                                           default=['librtas2'])
         self.packages.extend(packages_ubuntu)
         for package in self.packages:
             if process.system_output("apt-mark showauto %s" % package,
                                      shell=True):
                 self.log.info("%s package is installed by default" %
                               package)
             else:
                 self.log.info("%s package is not installed by default" %
                               package)
                 is_fail += 1
     else:
         for package in self.packages:
             if self.sm.check_installed(package):
                 self.log.info("%s package is installed" % package)
             else:
                 self.log.info("%s package is not installed" % package)
     if is_fail >= 1:
         self.fail("%s package(s) not installed by default" % is_fail)
Example #35
0
 def setUp(self):
     # Check for basic utilities
     sm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['dejagnu', 'expect']
     if detected_distro.name == "SuSE":
         deps.append("git-core")
     else:
         deps.append("git")
     if detected_distro.name in ["Ubuntu", 'debian']:
         deps.extend(["libxml2-utils", "tclsh"])
         if detected_distro.name == "Ubuntu":
             deps.extend(["oprofile"])
     else:
         deps.append("oprofile")
     for package in deps:
         if not sm.check_installed(package) and not sm.install(package):
             self.cancel('%s is needed for the test to be run' % package)
     git.get_repo('https://git.code.sf.net/p/oprofile/oprofile-tests',
                  destination_dir=self.workdir)
     os.chdir(self.workdir)
     os.chdir("testsuite/")
 def setUp(self):
     '''
     Install the packages
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['gcc', 'make']
     if 'Ubuntu' in detected_distro.name:
         kernel_ver = platform.uname()[2]
         deps.extend(['linux-tools-common', 'linux-tools-%s' % kernel_ver])
     elif 'debian' in detected_distro.name:
         kernel_ver = platform.uname()[2][3]
         deps.extend(['linux-tools-%s' % kernel_ver])
     elif detected_distro.name in ['rhel', 'SuSE', 'fedora']:
         deps.extend(['perf'])
     else:
         self.cancel("Install the package for perf supported by %s" %
                     detected_distro.name)
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel('%s is needed for the test to be run' % package)
Example #37
0
 def setUp(self):
     sm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['gcc', 'make']
     for package in deps:
         if not sm.check_installed(package) and not sm.install(package):
             self.error(package + ' is needed for the test to be run')
     url = 'https://github.com/julman99/eatmemory/archive/master.zip'
     tarball = self.fetch_asset("eatmemory.zip",
                                locations=[url],
                                expire='7d')
     archive.extract(tarball, self.srcdir)
     self.sourcedir = os.path.join(self.srcdir, "eatmemory-master")
     # patch for getch remove
     getch_patch = 'patch -p1 < %s' % (os.path.join(self.datadir,
                                                    'eatmem_getch.patch'))
     process.run(getch_patch, shell=True)
     build.make(self.sourcedir)
     mem = self.params.get('memory_to_test', default=memory.memtotal())
     self.mem_to_eat = self._mem_to_mbytes(mem)
     if self.mem_to_eat is None:
         self.error("Memory '%s' not valid." % mem)
    def setUp(self):
        '''
        Install the basic packages to support perf
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        deps = ['gcc', 'make']
        if 'Ubuntu' in detected_distro.name:
            deps.extend(
                ['linux-tools-common',
                 'linux-tools-%s' % platform.uname()[2]])
        elif 'debian' in detected_distro.name:
            deps.extend(['linux-tools-%s' % platform.uname()[2][3]])
        # FIXME: "redhat" as the distro name for RHEL is deprecated
        # on Avocado versions >= 50.0.  This is a temporary compatibility
        # enabler for older runners, but should be removed soon
        elif detected_distro.name in [
                'rhel', 'SuSE', 'fedora', 'centos', 'redhat'
        ]:
            deps.extend(['perf', 'gcc-g++'])
        else:
            self.cancel("Install the package for perf supported\
                      by %s" % detected_distro.name)
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        locations = [
            "https://github.com/rfmvh/perftool-testsuite/archive/"
            "master.zip"
        ]
        tarball = self.fetch_asset("perftool.zip",
                                   locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.workdir)
        self.sourcedir = os.path.join(self.workdir,
                                      'perftool-testsuite-master')
Example #39
0
 def setUp(self):
     '''
     To check and install dependencies for the test
     '''
     self.host_interfaces = self.params.get("host_interfaces",
                                            default="").split(",")
     if not self.host_interfaces:
         self.cancel("user should specify host interfaces")
     smm = SoftwareManager()
     if distro.detect().name == 'Ubuntu':
         pkg = 'iputils-ping'
     else:
         pkg = 'iputils'
     if not smm.check_installed(pkg) and not smm.install(pkg):
         self.cancel("Package %s is needed to test" % pkg)
     self.peer_ips = self.params.get("peer_ips",
                                     default="").split(",")
     interfaces = netifaces.interfaces()
     for self.host_interface in self.host_interfaces:
         if self.host_interface not in interfaces:
             self.cancel("interface is not available")
     self.count = self.params.get("count", default="1000")
     self.ipaddr = self.params.get("host_ip", default="").split(",")
     self.netmask = self.params.get("netmask", default="")
     for ipaddr, interface in zip(self.ipaddr, self.host_interfaces):
         configure_network.set_ip(ipaddr, self.netmask, interface)
     self.peer_user = self.params.get("peer_user", default="root")
     self.peer_password = self.params.get("peer_password", '*',
                                          default="None")
     self.mtu = self.params.get("mtu", default=1500)
     self.peerinfo = PeerInfo(self.peer_ips[0], peer_user=self.peer_user,
                              peer_password=self.peer_password)
     for peer_ip in self.peer_ips:
         self.peer_interface = self.peerinfo.get_peer_interface(peer_ip)
         if not self.peerinfo.set_mtu_peer(self.peer_interface, self.mtu):
             self.cancel("Failed to set mtu in peer")
     for host_interface in self.host_interfaces:
         if not configure_network.set_mtu_host(host_interface, self.mtu):
             self.cancel("Failed to set mtu in host")
Example #40
0
    def setUp(self):
        '''
        Build numatop Test
        Source:
        https://github.com/01org/numatop.git
        '''

        # Check for basic utilities
        self.numa_pid = None
        distro_name = distro.detect().name.lower()
        smm = SoftwareManager()
        deps = ['gcc', 'numatop', 'make']
        if distro_name == 'ubuntu':
            deps.extend(
                ['libnuma-dev', 'libncurses-dev', 'pkg-config', 'check'])
        elif distro_name in ['rhel', 'fedora']:
            deps.extend([
                'ncurses-devel', 'numactl-libs', 'numactl-devel', 'check-devel'
            ])
        elif distro_name == 'suse':
            deps.extend(['ncurses-devel', 'libnuma-devel', 'check-devel'])
        else:
            self.cancel("Install corresponding libnuma packages")

        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Failed to install %s, which is needed for"
                            "the test to be run" % package)

        locations = ["https://github.com/intel/numatop/archive/master.zip"]
        tarball = self.fetch_asset("numatop.zip",
                                   locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.workdir)
        self.sourcedir = os.path.join(self.workdir, 'numatop-master')

        os.chdir(self.sourcedir)
        process.run('./autogen.sh', shell=True, sudo=True)
        build.make(self.sourcedir, extra_args='check')
Example #41
0
 def setUp(self):
     """
     Verifies if we have list of packages installed on OS
     and also skips the test if user gives the current OS boot disk as
     disk input it may erase the data
     :param disk: test disk where the disk operations can be done
     :param fs: type of filesystem to create
     :param dir: path of the directory to mount the disk device
     """
     smm = SoftwareManager()
     pkg = ""
     if 'ppc' not in platform.processor():
         self.cancel("Processor is not ppc64")
     self.disk = self.params.get('disk', default=None)
     self.dir = self.params.get('dir', default=self.workdir)
     self.fstype = self.params.get('fs', default='ext4')
     self.log.info("disk: %s, dir: %s, fstype: %s",
                   self.disk, self.dir, self.fstype)
     if not self.disk:
         self.cancel("No disk input, please update yaml and re-run")
     cmd = "df --output=source"
     if self.disk in process.system_output(cmd, ignore_status=True):
         self.cancel("Given disk is os boot disk,"
                     "it will be harmful to run this test")
     pkg_list = ["lshw"]
     self.distro = distro.detect().name
     if self.distro == 'Ubuntu':
         pkg_list.append("hwinfo")
     if self.fstype == 'ext4':
         pkg_list.append('e2fsprogs')
     if self.fstype == 'xfs':
         pkg_list.append('xfsprogs')
     if self.fstype == 'btrfs':
         if self.distro == 'Ubuntu':
             pkg_list.append("btrfs-tools")
     for pkg in pkg_list:
         if pkg and not smm.check_installed(pkg) and not smm.install(pkg):
             self.cancel("Package %s is missing and could not be installed"
                         % pkg)
Example #42
0
    def setUp(self):

        # Check for basic utilities
        smm = SoftwareManager()
        dist = distro.detect()

        deps = ["gcc", "make"]
        if dist.name in ['Ubuntu', 'debian']:
            deps.extend(['libncurses-dev'])
        elif dist.name in ['rhel', 'SuSE']:
            deps.extend(['ncurses-devel'])
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Fail to install %s required for this test." %
                            package)

        git.get_repo('git://git.code.sf.net/p/perfmon2/libpfm4',
                     destination_dir=self.workdir)

        os.chdir(self.workdir)

        build.make('.')
Example #43
0
 def setUp(self):
     sm = SoftwareManager()
     detected_distro = distro.detect()
     # Check for basic utilities
     deps = ['gcc', 'make']
     self.tmpdir = data_dir.get_tmp_dir()
     self.build_dir = self.params.get('build_dir', default=self.tmpdir)
     for package in deps:
         if not sm.check_installed(package) and not sm.install(package):
             self.error(package + ' is needed for the test to be run')
     url = 'https://github.com/kdlucas/byte-unixbench/archive/master.zip'
     tarball = self.fetch_asset("byte-unixbench.zip",
                                locations=[url],
                                expire='7d')
     archive.extract(tarball, self.srcdir)
     self.srcdir = os.path.join(self.srcdir,
                                "byte-unixbench-master/UnixBench")
     os.chdir(self.srcdir)
     makefile_patch = 'patch -p1 < %s' % (os.path.join(
         self.datadir, 'Makefile.patch'))
     process.run(makefile_patch, shell=True)
     build.make(self.srcdir)
 def setUp(self):
     '''
     Install the packages
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     detected_distro = distro.detect()
     kernel_ver = platform.uname()[2]
     deps = ['gcc', 'make']
     if 'Ubuntu' in detected_distro.name:
         deps.extend(['linux-tools-common', 'linux-tools-%s' % kernel_ver])
     # FIXME: "redhat" as the distro name for RHEL is deprecated
     # on Avocado versions >= 50.0.  This is a temporary compatibility
     # enabler for older runners, but should be removed soon
     elif detected_distro.name in ['rhel', 'SuSE', 'fedora', 'redhat']:
         deps.extend(['perf'])
     else:
         self.skip("Install the package for perf supported by %s" %
                   detected_distro.name)
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.skip('%s is needed for the test to be run' % package)
Example #45
0
def create_host_os_cfg(options):
    def _forced_or_detected(forced, detected):
        if forced:
            return forced
        else:
            return detected
    host_os_cfg_path = data_dir.get_backend_cfg_path(get_opt(options, 'vt_type'),
                                                     'host-os.cfg')
    with open(host_os_cfg_path, 'w') as cfg:
        detected = distro.detect()
        name = host_os_get_distro_name(options, detected)
        version = _forced_or_detected(get_opt(options, 'vt_host_distro_version'),
                                      "m%s" % detected.version)
        release = _forced_or_detected(get_opt(options, 'vt_host_distro_release'),
                                      "u%s" % detected.release)
        arch = _forced_or_detected(get_opt(options, 'vt_host_distro_arch'),
                                   "Host_arch_%s" % detected.arch)
        cfg.write("variants:\n")
        cfg.write("    - @Host:\n")
        cfg.write("        variants:\n")
        cfg.write("            - @%s:\n" % name)
        cfg.write("                variants:\n")
        cfg.write("                    - @%s:\n" % version)
        cfg.write("                        variants:\n")
        cfg.write("                            - @%s:\n" % release)
        cfg.write("                                variants:\n")
        cfg.write("                                    - @%s:\n" % arch)

    count = [get_opt(options, 'vt_host_distro_name'),
             get_opt(options, 'vt_host_distro_version'),
             get_opt(options, 'vt_host_distro_release'),
             get_opt(options, 'vt_host_distro_arch')].count(None)
    if count == 4:
        source = "distro detection"
    elif count == 0:
        source = "command line parameters"
    else:
        source = "distro detection and command line parameters"
    LOG.debug("Config file %s generated from %s", host_os_cfg_path, source)
Example #46
0
 def setUp(self):
     '''
     Install the basic packages to support seccomp
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['gcc', 'make']
     if detected_distro.name in [
             'rhel', 'SuSE', 'fedora', 'centos', 'redhat'
     ]:
         deps.extend(['gperf'])
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel('%s is needed for the test to be run' % package)
     url = "https://github.com/seccomp/libseccomp/archive/refs/heads/main.zip"
     tarball = self.fetch_asset(url, expire='7d')
     archive.extract(tarball, self.workdir)
     self.sourcedir = os.path.join(self.workdir, 'libseccomp-main')
     os.chdir(self.sourcedir)
     process.run("./autogen.sh")
     process.run("./configure")
    def setUp(self):
        """
        Setup
        """
        if 'ppc64' not in distro.detect().arch:
            self.cancel("Supported only on Power Architecture")

        self.mdt_file = self.params.get('mdt_file', default='mdt.mem')
        self.time_limit = int(self.params.get('time_limit', default=2))
        self.time_unit = self.params.get('time_unit', default='m')
        if self.time_unit == 'm':
            self.time_limit = self.time_limit * 60
        elif self.time_unit == 'h':
            self.time_limit = self.time_limit * 3600
        else:
            self.cancel(
                "running time unit is not proper, please pass as 'm' or 'h' ")
        if str(self.name.name).endswith('test_start'):
            # Build HTX only at the start phase of test
            self.setup_htx()
        if not os.path.exists("/usr/lpp/htx/mdt/%s" % self.mdt_file):
            self.cancel("MDT file %s not found due to config" % self.mdt_file)
Example #48
0
    def setUp(self):
        sm = SoftwareManager()
        self.is_fail = 0
        dist = distro.detect()
        packages = ['lshw', 'net-tools', 'pciutils']
        if dist.name == "SuSE" and int(dist.version) < 15:
            self.cancel("lshw not supported on SLES-%s. Please run "
                        "on SLES15 or higher versions only " % dist.version)
        if ((dist.name == 'Ubuntu' and int(dist.version) >= 18)
                or (dist.name in ["SuSE", 'debian'])):
            packages.extend(['iproute2'])
        else:
            packages.extend(['iproute'])
        if dist.name in ['Ubuntu', 'debian']:
            if 'IBM' in process.system_output('lshw -class system',
                                              shell='true').decode():
                packages.extend(['powerpc-ibm-utils'])

        for package in packages:
            if not sm.check_installed(package) and not sm.install(package):
                self.cancel("Fail to install %s required for this"
                            " test." % package)
Example #49
0
 def setUp(self):
     '''
     Install the basic packages to support perf and systemtap-sdt-devel
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     distro_name = distro.detect().name
     deps = []
     if 'Ubuntu' in distro_name:
         deps.extend(
             ['linux-tools-common',
              'linux-tools-%s' % platform.uname()[2]])
     elif 'rhel' in distro_name:
         deps.extend(['perf', 'kernel-debuginfo'])
     elif 'SuSE' in distro_name:
         deps.extend(['perf', 'kernel-default-base-debuginfo'])
     else:
         self.cancel("Install the package for perf supported\
                   by %s" % distro_name)
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel('%s is needed for the test to be run' % package)
Example #50
0
 def setUp(self):
     """
     Gets the console and set-up the machine for test
     """
     if 'ppc' not in distro.detect().arch:
         self.cancel("Processor is not ppc64")
     output = genio.read_file("/sys/kernel/debug/powerpc/eeh_enable")\
         .strip()
     if output != '0x1':
         self.cancel("EEH is not enabled, please enable via FSP")
     self.max_freeze = int(self.params.get('max_freeze', default='1'))
     cmd = "echo %d > /sys/kernel/debug/powerpc/eeh_max_freezes"\
         % self.max_freeze
     process.system(cmd, ignore_status=True, shell=True)
     self.function = str(self.params.get('function', default='4'))
     self.err = str(self.params.get('err'))
     self.pci_device = str(self.params.get('pci_device', default=""))
     if not self.pci_device:
         self.cancel("PCI bus id not given")
     self.phb = self.pci_device.split(":", 1)[0]
     self.addr = genio.read_file("/sys/bus/pci/devices/%s/"
                                 "eeh_pe_config_addr" % self.pci_device)
     self.addr = str(self.addr).rstrip()
     self.err = 0
     smm = SoftwareManager()
     if not smm.check_installed("pciutils") and not smm.install("pciutils"):
         self.cancel("pciutils package is need to test")
     for line in process.system_output('lspci -vs %s' % self.pci_device,
                                       ignore_status=True,
                                       shell=True).decode("utf-8\
                                       ").splitlines():
         if 'Memory' in line and '64-bit, prefetchable' in line:
             self.err = 1
             break
     self.mem_addr = pci.get_memory_address(self.pci_device)
     self.mask = pci.get_mask(self.pci_device)
     self.log.info("Test-----> %s", self.addr)
     self.log.info("===============Testing EEH Frozen PE==================")
Example #51
0
    def setUp(self):
        '''
        Install the basic packages to support perf
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        self.distro_name = detected_distro.name

        if 'ppc64' not in detected_distro.arch:
            self.cancel('This test is not supported on %s architecture' %
                        detected_distro.arch)
        if 'PowerNV' in cpu._get_cpu_info():
            self.cancel('This test is only supported on LPAR')

        deps = ['gcc', 'make']
        if 'Ubuntu' in self.distro_name:
            deps.extend(
                ['linux-tools-common',
                 'linux-tools-%s' % platform.uname()[2]])
        elif self.distro_name in ['rhel', 'SuSE', 'fedora', 'centos']:
            deps.extend(['perf'])
        else:
            self.cancel("Install the package for perf supported \
                         by %s" % detected_distro.name)
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        # Collect all hv_gpci events
        self.list_of_hv_gpci_events = []
        for line in process.get_perf_events('hv_gpci'):
            line = line.split(',')[0].split('/')[1]
            self.list_of_hv_gpci_events.append(line)

        # Clear the dmesg, by that we can capture the delta at the end of the test.
        output = process.run("dmesg -c")
Example #52
0
    def setUp(self):
        smm = SoftwareManager()
        self.minthreads = self.params.get('minthrd',
                                          default=(500 +
                                                   cpu.online_cpus_count()))
        self.maxthreads = self.params.get('maxthrd', default=None)
        self.iothreads = self.params.get('iothrd', default=self.minthreads / 2)
        self.maxmem = self.params.get('maxmem',
                                      default=int(memory.meminfo.MemFree.m /
                                                  self.minthreads))
        self.maxio = self.params.get('maxio', default=None)
        self.longthreads = self.params.get('longthrd', default=False)
        self.shrtthreads = self.params.get('shortthrd', default=False)
        self.time = self.params.get('time', default=100)
        self.iotime = self.params.get('iotime', default=50)

        if self.longthreads and self.shrtthreads:
            self.cancel('Please choose right inputs')

        dist = distro.detect()
        packages = ['gcc', 'patch']
        if dist.name in ['Ubuntu', 'debian']:
            packages.extend(['g++'])
        elif dist.name in ['SuSE', 'fedora', 'rhel', 'centos']:
            packages.extend(['gcc-c++'])
        for package in packages:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        for file_name in ['dwh.cpp', 'Makefile']:
            self.copyutil(file_name)
        os.chdir(self.teststmpdir)
        if dist.name in ['fedora', 'rhel']:
            process.system('patch -p0 < %s' % self.get_data('fofd.patch'),
                           shell=True)
        elif dist.name in ['Ubuntu', 'debian']:
            process.system("sed -i 's/g++.*/& -lrt/' Makefile", shell=True)
        build.make(self.teststmpdir)
    def setUp(self):
        '''
        Install the basic packages to support perf
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        detected_distro = distro.detect()
        self.distro_name = detected_distro.name
        self.cpu_family = cpu.get_family()[5:]
        if detected_distro.arch != 'ppc64le':
            self.cancel('This test is not supported on %s architecture' %
                        detected_distro.arch)
        deps = ['gcc', 'make']
        if self.distro_name in ['Ubuntu']:
            deps.extend(
                ['linux-tools-common',
                 'linux-tools-%s' % platform.uname()[2]])
        elif self.distro_name in ['debian']:
            deps.extend(['linux-tools-%s' % platform.uname()[2][3]])
        elif self.distro_name in ['rhel', 'SuSE', 'fedora', 'centos']:
            deps.extend(['perf'])
        else:
            self.cancel("Install the package for perf supported \
                         by %s" % detected_distro.name)
        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel('%s is needed for the test to be run' % package)

        for filename in [
                'name_events_p8', 'raw_codes_p8', 'name_events_p9',
                'raw_codes_p9', 'name_events_p10', 'raw_codes_p10'
        ]:
            self.copy_files(filename)

        os.chdir(self.teststmpdir)
        # Clear the dmesg to capture the delta at the end of the test.
        process.run("dmesg -C")
 def setUp(self):
     """
     Mount MOFED iso.
     """
     self.iso_location = self.params.get('iso_location', default='')
     self.kernelc = self.params.get("kernel_compile", default="Y")
     if self.iso_location is '':
         self.cancel("No ISO location given")
     self.option = self.params.get('option', default='')
     self.uninstall_flag = self.params.get('uninstall', default=True)
     detected_distro = distro.detect()
     pkgs = []
     self.uname = linux_modules.platform.uname()[2]
     kernel_ver = "kernel-devel-%s" % self.uname
     smm = SoftwareManager()
     if detected_distro.name == "SuSE":
         pkgs.extend([
             "make", "gcc", "python3-devel", "kernel-source", "kernel-syms",
             "insserv-compat", "rpm-build"
         ])
     # FIXME: "redhat" as the distro name for RHEL is deprecated
     # on Avocado versions >= 50.0.  This is a temporary compatibility
     # enabler for older runners, but should be removed soon
     elif detected_distro.name in ['rhel', 'fedora', 'redhat']:
         pkgs.extend([
             "make", "gcc", "python36-devel", "tcsh", "kernel-rpm-macros",
             "gdb-headless", "rpm-build", "gcc-gfortran", kernel_ver
         ])
     for pkg in pkgs:
         if not smm.check_installed(pkg) and not smm.install(pkg):
             self.cancel("Not able to install %s" % pkg)
     self.iso = self.fetch_asset(self.iso_location, expire='10d')
     cmd = "mount -o loop %s %s" % (self.iso, self.workdir)
     process.run(cmd, shell=True)
     self.pwd = os.getcwd()
     if self.options_check() is False:
         self.cancel("option %s not supported with this MOFED" %
                     self.option)
Example #55
0
    def setUp(self):
        """
        Resolve the packages dependencies and download the source.
        """
        smg = SoftwareManager()
        detected_distro = distro.detect()
        deps = ['gcc', 'make', 'automake', 'autoconf']

        if 'Ubuntu' in detected_distro.name:
            deps.extend(['libpopt0', 'libc6', 'libc6-dev',
                         'libpopt-dev', 'libcap-ng0', 'libcap-ng-dev',
                         'libnuma-dev', 'libfuse-dev'])
        elif 'SuSE' in detected_distro.name:
            deps.extend(['popt', 'glibc', 'glibc-devel',
                         'popt-devel', 'libcap1', 'libcap1-devel',
                         'libcap-ng', 'libcap-ng-devel'])
        # FIXME: "redhat" as the distro name for RHEL is deprecated
        # on Avocado versions >= 50.0.  This is a temporary compatibility
        # enabler for older runners, but should be removed soon
        elif detected_distro.name in ['centos', 'fedora', 'rhel', 'redhat']:
            deps.extend(['popt', 'glibc', 'glibc-devel', 'glibc-static',
                         'libcap-ng', 'libcap', 'libcap-devel'])

        for package in deps:
            if not smg.check_installed(package) and not smg.install(package):
                self.cancel(
                    "Fail to install %s required for this test." % (package))

        location = ["https://github.com/torvalds/linux/archive/master.zip"]
        tarball = self.fetch_asset("kselftest.zip", locations=location,
                                   expire='1d')
        archive.extract(tarball, self.srcdir)
        self.buldir = os.path.join(self.srcdir, 'linux-master')
        self.sourcedir = os.path.join(self.buldir, self.testdir)
        result = build.run_make(self.sourcedir)
        for line in str(result).splitlines():
            if 'ERROR' in line:
                self.fail("Compilation failed, Please check the build logs !!")
Example #56
0
    def setUp(self):
        '''
        Build fsfuzzer
        Source:
        https://github.com/stevegrubb/fsfuzzer.git
        '''
        detected_distro = distro.detect()

        smm = SoftwareManager()

        if not smm.check_installed("gcc") and not smm.install("gcc"):
            self.error("Gcc is needed for the test to be run")

        locations = ["https://github.com/stevegrubb/fsfuzzer/archive/"
                     "master.zip"]
        tarball = self.fetch_asset("fsfuzzer.zip", locations=locations)
        archive.extract(tarball, self.srcdir)
        os.chdir(os.path.join(self.srcdir, "fsfuzzer-master"))

        if detected_distro.name == "Ubuntu":
            # Patch for ubuntu
            fuzz_fix_patch = 'patch -p1 < %s' % (
                os.path.join(self.datadir, 'fsfuzz_fix.patch'))
            if process.system(fuzz_fix_patch, shell=True, ignore_status=True):
                self.log.warn("Unable to apply sh->bash patch!")

        process.run('./autogen.sh', shell=True)
        process.run('./configure', shell=True)

        build.make('.')

        self._args = self.params.get('fstype', default='')
        self._fsfuzz = os.path.abspath(os.path.join('.', "fsfuzz"))
        fs_sup = process.system_output('%s %s' % (self._fsfuzz, ' --help'))
        match = re.search(r'%s' % self._args, fs_sup, re.M | re.I)
        if not match:
            self.skip('File system ' + self._args +
                      ' is unsupported in ' + detected_distro.name)
Example #57
0
    def setUp(self):
        """
        fs_mark
        """

        smm = SoftwareManager()
        tarball = self.fetch_asset('https://github.com/josefbacik/fs_mark/'
                                   'archive/master.zip')
        archive.extract(tarball, self.teststmpdir)
        self.sourcedir = os.path.join(self.teststmpdir, 'fs_mark-master')
        os.chdir(self.sourcedir)
        process.run('make')
        build.make(self.sourcedir)
        self.disk = self.params.get('disk', default=None)
        self.num = self.params.get('num_files', default='1024')
        self.size = self.params.get('size', default='1000')
        self.dirs = self.params.get('dir', default=self.workdir)
        self.fstype = self.params.get('fs', default='ext4')

        if self.fstype == 'btrfs':
            if distro.detect().name == 'Ubuntu':
                if not smm.check_installed("btrfs-tools") and not \
                        smm.install("btrfs-tools"):
                    self.cancel('btrfs-tools is needed for the test to be run')

        if self.disk is not None:
            self.part_obj = Partition(self.disk, mountpoint=self.dirs)
            self.log.info("Test will run on %s", self.dirs)
            self.log.info("Unmounting the disk before creating file system")
            self.part_obj.unmount()
            self.log.info("creating file system")
            self.part_obj.mkfs(self.fstype)
            self.log.info("Mounting disk %s on dir %s", self.disk, self.dirs)
            try:
                self.part_obj.mount()
            except PartitionError:
                self.fail("Mounting disk %s on directory %s failed" %
                          (self.disk, self.dirs))
 def setUp(self):
     '''
     Install the basic packages to support selinux
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['gcc', 'make']
     self.sourcedir = None
     if detected_distro.name in [
             'rhel', 'SuSE', 'fedora', 'centos', 'redhat'
     ]:
         deps.extend([
             "perl-Test", "perl-Test-Harness", "perl-Test-Simple",
             "perl-libs", "selinux-policy-devel", "net-tools",
             "netlabel_tools", "iptables", "libbpf", "lksctp-tools-devel",
             "attr", "libbpf-devel", "keyutils-libs-devel", "quota",
             "xfsprogs-devel", "libuuid-devel", "nftables", "kernel-devel",
             "kernel-modules", "perl-Test-Harness", "coreutils",
             "netlabel_tools", "libsepol", "checkpolicy", "libselinux",
             "policycoreutils", "libsemanage", "nfs-utils",
             "policycoreutils-newrole", "xfsprogs-devel", "libselinux-devel"
         ])
     else:
         self.cancel("Install the package for selinux supported\
                   by %s" % detected_distro.name)
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel('%s is needed for the test to be run' % package)
     url = "https://github.com/SELinuxProject/selinux-testsuite/archive/master.zip"
     tarball = self.fetch_asset(url, expire='7d')
     archive.extract(tarball, self.workdir)
     self.sourcedir = os.path.join(self.workdir, 'selinux-testsuite-master')
     os.chdir(self.sourcedir)
     if not linux.enable_selinux_enforcing():
         self.fail("Unable to enter in to 'Enforcing' mode")
     if build.make(self.sourcedir, extra_args="-C policy load") > 0:
         self.cancel("Failed to load the policies")
Example #59
0
 def setUp(self):
     smm = SoftwareManager()
     detected_distro = distro.detect()
     packages = ['make', 'gcc']
     if detected_distro.name == "Ubuntu":
         packages.append("gfortran")
     else:
         packages.append("gcc-gfortran")
     for package in packages:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel(' %s is needed for the test to be run' % package)
     url = "https://github.com/xianyi/OpenBLAS/archive/develop.zip"
     tarball = self.fetch_asset("OpenBLAS-develop.zip",
                                locations=[url],
                                expire='7d')
     archive.extract(tarball, self.srcdir)
     openblas_dir = os.path.join(self.srcdir, "OpenBLAS-develop")
     openblas_bin_dir = os.path.join(openblas_dir, 'bin')
     os.mkdir(openblas_bin_dir)
     build.make(openblas_dir, extra_args='FC=gfortran')
     build.make(openblas_dir,
                extra_args='PREFIX=%s install' % openblas_bin_dir)
     self.test_dir = os.path.join(openblas_dir, "test")
 def install_packages(self):
     '''
     Install necessary packages
     '''
     smm = SoftwareManager()
     packages = ['ksh', 'src', 'rsct.basic', 'rsct.core.utils',
                 'rsct.core', 'DynamicRM', 'powerpc-utils']
     detected_distro = distro.detect()
     if detected_distro.name == "Ubuntu":
         packages.extend(['python-paramiko'])
     self.log.info("Test is running on: %s", detected_distro.name)
     for pkg in packages:
         if not smm.check_installed(pkg) and not smm.install(pkg):
             self.cancel('%s is needed for the test to be run' % pkg)
     if detected_distro.name == "Ubuntu":
         ubuntu_url = self.params.get('ubuntu_url', default=None)
         debs = self.params.get('debs', default=None)
         for deb in debs:
             deb_url = os.path.join(ubuntu_url, deb)
             deb_install = self.fetch_asset(deb_url, expire='7d')
             shutil.copy(deb_install, self.workdir)
             process.system("dpkg -i %s/%s" % (self.workdir, deb),
                            ignore_status=True, sudo=True)