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):
        """
        Checking if the required packages are installed,
        if not found specific packages will be installed.
        """
        smm = SoftwareManager()
        if not smm.check_installed("lsscsi") and not smm.install("lsscsi"):
            self.cancel("Unable to install lsscsi")
        self.crtl_no = self.params.get('crtl_no')
        self.pci_id = self.params.get('pci_id', default="").split(",")
        self.http_path = self.params.get('http_path')
        self.tool_name = self.params.get('tool_name')
        self.firmware_path = self.params.get('firmware_path')
        self.firmware_name = self.params.get('firmware_name')
        self.option = self.params.get("option")
        self.option_args = self.params.get("option_args")

        # Gets the list of PCIIDs on the system
        cmd = 'for device in $(lspci | awk \'{print $1}\') ; do echo \
              $(lspci -vmm -nn -s $device | grep "\[" | awk \'{print $NF}\' \
              | sed -e "s/\]//g" | sed -e "s/\[//g" | tr \'\\n\' \' \' \
              | awk \'{print $2,$3,$4,$5}\') ; done'
        pci_id_formatted = []
        for i in self.cmdop_list(cmd).splitlines():
            pci_id_formatted.append(str(i.replace(" ", ":")))

        # check if all the yaml parameters are entered
        if self.crtl_no is '' or self.pci_id is '' or self.tool_name \
           is '' or self.http_path is '' or self.firmware_path\
           is '' or self.firmware_name is '':
            self.cancel(" please ensure yaml parameters are not empty")
        elif self.comp(self.pci_id, pci_id_formatted) == 1:
            self.cancel(" Test skipped!!, PMC controller not available")

        http_repo1 = "%s%s" % (self.firmware_path, self.firmware_name)
        self.repo1 = self.fetch_asset(http_repo1, expire='10d')
        self.repo1 = "%s.ufi" % self.repo1

        detected_distro = distro.detect()
        installed_package = "Arcconf"
        if detected_distro.name == "Ubuntu":
            installed_package = "arcconf"
        if not smm.check_installed(installed_package):
            if detected_distro.name == "Ubuntu":
                http_repo = "%s%s.deb" % (self.http_path, self.tool_name)
                self.repo = self.fetch_asset(http_repo, expire='10d')
                cmd = "dpkg -i %s" % self.repo
            else:
                http_repo = "%s%s.rpm" % (self.http_path, self.tool_name)
                self.repo = self.fetch_asset(http_repo, expire='10d')
                cmd = "rpm -ivh %s" % self.repo
            if process.system(cmd, ignore_status=True, shell=True) != 0:
                self.cancel("Unable to install arcconf")
    def setUp(self):
        '''
        set up required packages and gather necessary test inputs
        '''
        sm = SoftwareManager()
        detected_distro = distro.detect()
        self.log.info("Test is running on:" + detected_distro.name)
        if not sm.check_installed("ksh") and not sm.install("ksh"):
            self.error('ksh is needed for the test to be run')
        if detected_distro.name == "Ubuntu":
            if not sm.check_installed("python-paramiko") and not \
                                      sm.install("python-paramiko"):
                self.error('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)
            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.srcdir)
                process.system("dpkg -i %s/%s" % (self.srcdir, deb),
                               ignore_status=True, sudo=True)
        else:
            url = self.params.get('url', default=None)
            rpm_install = self.fetch_asset(url, expire='7d')
            shutil.copy(rpm_install, self.srcdir)
            os.chdir(self.srcdir)
            process.run('chmod +x ibmtools')
            process.run('./ibmtools --install --managed')
        self.hmc_ip = self.params.get("hmc_ip", '*', default=None)
        self.hmc_pwd = self.params.get("hmc_pwd", '*', default=None)
        self.hmc_username = self.params.get("hmc_username", '*', default=None)
        self.lpar_1 = self.params.get("lpar_1", '*', default=None)
        self.lpar_2 = self.params.get("lpar_2", '*', default=None)
        self.pci_device = self.params.get("pci_device", '*', default=None)
        self.server = self.params.get("server", '*', default=None)
        self.loc_code = pci.get_slot_from_sysfs(self.pci_device)
        self.num_of_dlpar = int(self.params.get("num_of_dlpar", default='1'))
        if self.loc_code is None:
            self.cancel("Failed to get the location code for the pci device")
        self.login(self.hmc_ip, self.hmc_username, self.hmc_pwd)
        self.run_command("uname -a")
        cmd = 'lshwres -r io -m ' + self.server + \
              ' --rsubtype slot --filter lpar_names=' + self.lpar_1 + \
              ' -F drc_index,lpar_id,drc_name | grep -i %s ' % self.loc_code

        output = self.run_command(cmd)
        self.drc_index = output[-1].split(',')[0]
        self.lpar_id = output[-1].split(',')[1]
        self.log.info("lpar_id : %s, loc_code: %s, drc_index: %s",
                      self.lpar_id, self.loc_code, self.drc_index)
    def setUp(self):
        """
        Check pre-requisites before running sensors command
        Testcase should be executed only on bare-metal environment.
        """
        s_mg = SoftwareManager()
        d_distro = distro.detect()
        if d_distro.name == "Ubuntu":
            if not s_mg.check_installed("lm-sensors") and not s_mg.install(
                    "lm-sensors"):
                self.cancel('Need sensors to run the test')
        elif d_distro.name == "SuSE":
            if not s_mg.check_installed("sensors") and not s_mg.install(
                    "sensors"):
                self.cancel('Need sensors to run the test')
        else:
            if not s_mg.check_installed("lm_sensors") and not s_mg.install(
                    "lm_sensors"):
                self.cancel('Need sensors to run the test')
        if d_distro.arch in ["ppc64", "ppc64le"]:
            if not cpu._list_matches(open('/proc/cpuinfo').readlines(),
                                     'platform\t: PowerNV\n'):
                self.cancel(
                    'sensors test is applicable to bare-metal environment.')

            config_check = linux_modules.check_kernel_config(
                'CONFIG_SENSORS_IBMPOWERNV')
            if config_check == 0:
                self.cancel('Config is not set')
            elif config_check == 1:
                if linux_modules.load_module('ibmpowernv'):
                    if linux_modules.module_is_loaded('ibmpowernv'):
                        self.log.info('Module Loaded Successfully')
                    else:
                        self.cancel('Module Loading Failed')
            else:
                self.log.info('Module is Built In')

        if not d_distro.name == "Ubuntu":
            try:
                process.run('service lm_sensors stop', sudo=True)
                process.run('service lm_sensors start', sudo=True)
                process.run('service lm_sensors status', sudo=True)
            except process.CmdError:
                self.error(
                    'Starting Service Failed. Make sure module is loaded')
        cmd = "yes | sudo sensors-detect"
        det_op = process.run(cmd, shell=True, ignore_status=True).stdout
        if 'no sensors were detected' in det_op:
            self.cancel('No sensors found to test !')
    def setUp(self):
        """
        Install  all the required dependencies
        Building source tarball requires packages specific to os
        that needs to be installed, if not installed test will stop.
        """

        backend = SoftwareManager()
        dist = distro.detect()

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

        pkgs = ['git', 'wget', 'autoconf', 'automake',
                'dejagnu', 'binutils']

        if dist.name == 'sles':
            sles_deps = ['build', 'libdw-devel', 'libelf-devel',
                         'elfutils', 'binutils-devel', 'libtool', 'gcc-c++']
            pkgs += sles_deps

        elif dist.name in ("redhat", "fedora"):
            rhel_deps = ['elfutils-devel', 'elfutils-libelf-devel',
                         'elfutils-libelf', 'elfutils-libs', 'libtool-ltdl']
            pkgs += rhel_deps

        elif dist.name == 'ubuntu':
            ubuntu_deps = ['elfutils', 'libelf-dev', 'libtool',
                           'libelf1', 'librpmbuild3', 'binutils-dev']
            pkgs += ubuntu_deps
        else:
            self.log.warn("Unsupported OS!")

        for pkg in pkgs:
            if not backend.check_installed(pkg):
                if backend.install(pkg):
                    self.log.warn("%s installed successfully", pkg)
                else:
                    self.error("Fail to install package- %s required for "
                               "this test" % pkg)

        # Source: git clone git://git.debian.org/git/collab-maint/ltrace.git
        git.get_repo('git://git.debian.org/git/collab-maint/ltrace.git',
                     destination_dir=os.path.join(self.srcdir, 'ltrace'))

        self.src_lt = os.path.join(self.srcdir, "ltrace")
        os.chdir(self.src_lt)
        process.run('./autogen.sh')
        process.run('./configure')
        build.make(self.src_lt)
class Package_check(Test):

    def setUp(self):
        if "ppc" not in distro.detect().arch:
            self.cancel("supported only on Power platform")

        self.sm = SoftwareManager()
        self.packages = self.params.get(
            'packages', default=['powerpc-utils', 'ppc64-diag', 'lsvpd'])
        if 'PowerNV' in open('/proc/cpuinfo', 'r').read():
            self.packages.extend(['opal-prd'])

    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 self.sm.check_installed("anaconda"):
                    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)
    def setUp(self):

        self.tlbflush_max_entries = self.params.get('entries', default=200)
        self.tlbflush_iteration = self.params.get('iterations', default=50)
        self.nr_threads = self.params.get('nr_threads', default=50)

        # Check for basic utilities

        smm = SoftwareManager()

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

        data_dir = os.path.abspath(self.datadir)

        shutil.copyfile(os.path.join(data_dir, 'tlbflush.c'),
                        os.path.join(self.srcdir, 'tlbflush.c'))

        os.chdir(self.srcdir)
        os.system('cp tlbflush.c /root/pp/tlbflush.c')
        tlbflush_patch = 'patch -p1 < %s' % (
            os.path.join(data_dir, 'tlbflush.patch'))

        process.run(tlbflush_patch, shell=True)
        cmd = 'gcc -DFILE_SIZE=$((128*1048576)) -g -O2 tlbflush.c \
               -lpthread -o tlbflush'
        process.run(cmd, shell=True)
Beispiel #8
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 interbench
        Source:
        http://ck.kolivas.org/apps/interbench/interbench-0.31.tar.bz2
        '''
        sm_manager = SoftwareManager()
        for pkg in ['gcc', 'patch']:
            if (not sm_manager.check_installed(pkg) and not
                    sm_manager.install(pkg)):
                self.cancel("%s is needed for the test to be run" % pkg)

        disk_free_mb = (disk.freespace(self.teststmpdir) / 1024) / 1024
        if memory.memtotal()/1024 > disk_free_mb:
            self.cancel('Disk space is less than total memory. Skipping test')

        tarball = self.fetch_asset('http://slackware.cs.utah.edu/pub/kernel'
                                   '.org/pub/linux/kernel/people/ck/apps/'
                                   'interbench/interbench-0.31.tar.gz')
        data_dir = os.path.abspath(self.datadir)
        archive.extract(tarball, self.srcdir)
        version = os.path.basename(tarball.split('.tar.')[0])
        self.sourcedir = os.path.join(self.srcdir, version)

        # Patch for make file
        os.chdir(self.sourcedir)
        makefile_patch = 'patch -p1 < %s ' % (
            os.path.join(data_dir, 'makefile_fix.patch'))
        process.run(makefile_patch, shell=True)

        build.make(self.sourcedir)
Beispiel #10
0
    def setUp(self):
        """
        Build xfstest
        Source: git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git
        """
        sm = SoftwareManager()
        packages = ['xfslibs-dev', 'uuid-dev', 'libtool-bin', 'e2fsprogs',
                    'automake', 'gcc', 'libuuid1', 'quota', 'attr',
                    'libattr1-dev', 'make', 'libacl1-dev', 'xfsprogs',
                    'libgdbm-dev', 'gawk', 'fio', 'dbench', 'uuid-runtime']
        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)

        self.test_range = self.params.get('test_range', default=None)
        if self.test_range is None:
            self.fail('Please provide a test_range.')

        self.skip_dangerous = self.params.get('skip_dangerous', default=True)

        git.get_repo('git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git',
                     destination_dir=self.srcdir)
        data_dir = os.path.abspath(self.datadir)

        shutil.copyfile(os.path.join(data_dir, 'group'),
                        os.path.join(self.srcdir, 'group'))
        build.make(self.srcdir)
        self.available_tests = self._get_available_tests()

        self.test_list = self._create_test_list()
        self.log.info("Tests available in srcdir: %s",
                      ", ".join(self.available_tests))
        process.run('useradd fsgqa', sudo=True)
        process.run('useradd 123456-fsgqa', sudo=True)
    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 Rmaptest
        Source:
        https://www.kernel.org/pub/linux/kernel/people/mbligh/tools/rmap-test.c
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        if not smm.check_installed("gcc") and not smm.install("gcc"):
            self.error('Gcc is needed for the test to be run')

        rmaptest = self.fetch_asset('https://www.kernel.org/pub/'
                                    'linux/kernel/people/mbligh/'
                                    'tools/rmap-test.c', expire='7d')

        shutil.copyfile(rmaptest, os.path.join(self.workdir, 'rmap-test.c'))

        os.chdir(self.workdir)

        if 'CC' in os.environ:
            cc = '$CC'
        else:
            cc = 'cc'
        process.system('%s  -Wall -o rmaptest rmap-test.c' %
                       cc, ignore_status=True)
 def setUp(self):
     '''
     check the availability of perftest package installed
     perftest package should be installed
     '''
     sm = SoftwareManager()
     depends = ["openssh-clients", "perftest"]
     for pkg in depends:
         if not sm.check_installed(pkg) and not sm.install(pkg):
             self.skip("%s package is need to test" % pkg)
     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.PORT = self.params.get("PORT_NUM", default="1")
     self.PEER_CA = self.params.get("PEERCA", default="mlx4_0")
     self.PEER_PORT = self.params.get("PEERPORT", default="1")
     self.to = self.params.get("timeout", default="600")
     self.tool_name = self.params.get("tool", default="")
     if self.tool_name == "":
         self.skip("should specify tool name")
     self.log.info("test with %s" % (self.tool_name))
     self.test_op = self.params.get("test_opt", default="").split(",")
     self.ext_test_op = self.params.get("ext_opt", default="").split(",")
 def setUp(self):
     """
     Build 'fio and ezfio'.
     """
     self.disk = self.params.get('disk', default='/dev/nvme0n1')
     cmd = 'ls %s' % self.disk
     if process.system(cmd, ignore_status=True) is not 0:
         self.cancel("%s does not exist" % self.disk)
     fio_path = os.path.join(self.teststmpdir, 'fio')
     fio_link = 'https://github.com/axboe/fio.git'
     git.get_repo(fio_link, destination_dir=fio_path)
     build.make(fio_path, make='./configure')
     build.make(fio_path)
     build.make(fio_path, extra_args='install')
     self.ezfio_path = os.path.join(self.teststmpdir, 'ezfio')
     ezfio_link = 'https://github.com/earlephilhower/ezfio.git'
     git.get_repo(ezfio_link, destination_dir=self.ezfio_path)
     self.utilization = self.params.get('utilization', default='100')
     # aio-max-nr is 65536 by default, and test fails if QD is 256 or above
     genio.write_file("/proc/sys/fs/aio-max-nr", "1048576")
     smm = SoftwareManager()
     # Not a package that must be installed, so not skipping.
     if not smm.check_installed("sdparm") and not smm.install("sdparm"):
         self.log.debug("Can not install sdparm")
     self.cwd = os.getcwd()
    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')
    def setUp(self):
        '''
        Build FileBench
        Source:
        https://github.com/filebench/filebench/releases/download/1.5-alpha3/filebench-1.5-alpha3.tar.gz
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        deps = ['libtool', 'automake', 'autoconf', 'bison', 'gcc', 'flex']

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

        self._testfile = self.params.get('testfile', default='fileserver.f')

        tarball = self.fetch_asset('https://github.com/filebench/'
                                   'filebench/releases/ownload/1.5-alpha3/'
                                   'filebench-1.5-alpha3.tar.gz', expire='7d')

        archive.extract(tarball, self.srcdir)
        version = os.path.basename(tarball.split('.tar.')[0])
        self.srcdir = os.path.join(self.srcdir, version)

        os.chdir(self.srcdir)

        process.run('./configure', shell=True, sudo=True)
        build.make(self.srcdir)
        build.make(self.srcdir, extra_args='install')

        # Setup test file
        t_dir = '/usr/local/share/filebench/workloads/'
        shutil.copyfile(os.path.join(t_dir, self._testfile),
                        os.path.join(self.srcdir, self._testfile))
Beispiel #17
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)
Beispiel #18
0
    def setUp(self):
        '''
        Build ebizzy
        Source:
        http://liquidtelecom.dl.sourceforge.net/project/ebizzy/ebizzy/0.3
        /ebizzy-0.3.tar.gz
        '''
        sm = SoftwareManager()
        if not sm.check_installed("gcc") and not sm.install("gcc"):
            self.error("Gcc is needed for the test to be run")
        tarball = self.fetch_asset('http://liquidtelecom.dl.sourceforge.net'
                                   '/project/ebizzy/ebizzy/0.3'
                                   '/ebizzy-0.3.tar.gz')
        data_dir = os.path.abspath(self.datadir)
        archive.extract(tarball, self.srcdir)
        version = os.path.basename(tarball.split('.tar.')[0])
        self.srcdir = os.path.join(self.srcdir, version)

        patch = self.params.get(
            'patch', default='Fix-build-issues-with-ebizzy.patch')
        os.chdir(self.srcdir)
        p1 = 'patch -p0 < %s/%s' % (data_dir, patch)
        process.run(p1, shell=True)
        process.run('[ -x configure ] && ./configure', shell=True)
        build.make(self.srcdir)
    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
    def setUp(self):
        '''
        Use 85% of memory with/without many process forked
        WARNING: System may go out-of-memory based on the available resource
        '''
        smm = SoftwareManager()
        self.itern = int(self.params.get('iterations', default='10'))
        self.procs = int(self.params.get('procs', default='1'))
        self.minmem = int(self.params.get('minmem', default='10'))
        self.fails = []

        if not (self.itern and self.procs and self.minmem):
            self.cancel(
                'Please use a non-zero value for number'
                ' of iterations, processes and memory to be used')

        self.freemem = int((0.85 * memory.freememtotal()) / 1024)
        # Check for basic utilities
        for packages in ['gcc', 'make']:
            if not smm.check_installed(packages) and not smm.install(packages):
                self.cancel('%s is needed for the test to be run' % packages)

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

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

        build.make(self.teststmpdir)
    def setUp(self):
        '''
        Build Hackbench
        Source:
        http://people.redhat.com/~mingo/cfs-scheduler/tools/hackbench.c
        '''
        self._threshold_time = self.params.get('time_val', default=None)
        self._num_groups = self.params.get('num_groups', default=90)
        self._iterations = self.params.get('iterations', default=1)
        self.results = None
        sm = SoftwareManager()
        if not sm.check_installed("gcc") and not sm.install("gcc"):
            self.cancel("Gcc is needed for the test to be run")
        hackbench = self.fetch_asset('http://people.redhat.com'
                                     '/~mingo/cfs-scheduler/'
                                     'tools/hackbench.c')
        shutil.copyfile(hackbench, os.path.join(self.workdir, 'hackbench.c'))

        os.chdir(self.workdir)

        if 'CC' in os.environ:
            cc = '$CC'
        else:
            cc = 'cc'
        process.system('%s  hackbench.c -o hackbench -lpthread' % cc)
    def setUp(self):
        """
        Checking if the required packages are installed,
        if not found packages will be installed
        """

        smm = SoftwareManager()
        if not smm.check_installed("mdadm"):
            print "Mdadm must be installed before continuing the test"
            if SoftwareManager().install("mdadm") is False:
                self.cancel("Unable to install mdadm")
        cmd = "mdadm -V"
        self.check_pass(cmd, "Unable to get mdadm version")
        self.disk = self.params.get('disks', default='').strip(" ")
        self.raidlevel = str(self.params.get('raid', default='0'))
        self.metadata = str(self.params.get('metadata', default='1.2'))
        self.setup = self.params.get('setup', default=True)
        self.run_test = self.params.get('run_test', default=False)
        self.cleanup = self.params.get('cleanup', default=True)
        self.sparedisk = ""
        if self.raidlevel == 'linear' or self.raidlevel == '0':
            self.disk_count = len(self.disk.split(" "))
        else:
            self.disk = self.disk.split(" ")
            self.sparedisk = self.disk.pop()
            self.remadd = ''.join(self.disk[-1:])
            self.disk_count = len(self.disk)
            self.disk = ' '.join(self.disk)
        self.force = self.params.get('force', default=False)
    def setUp(self):
        '''
        Build FileBench
        Source:
        https://github.com/filebench/filebench/releases/download/1.5-alpha3/filebench-1.5-alpha3.tar.gz
        '''

        # Check for basic utilities
        smm = SoftwareManager()
        deps = ['libtool', 'automake', 'autoconf', 'bison', 'gcc', 'flex']

        for package in deps:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel(package + ' is needed for the test to be run')

        name_version = 'filebench-1.5-alpha3'
        tarball = self.fetch_asset('https://github.com/filebench/'
                                   'filebench/releases/download/1.5-alpha3/'
                                   '%s.tar.gz' % name_version)

        archive.extract(tarball, self.workdir)
        self.install_prefix = os.path.join(self.workdir, 'install_prefix')
        build_dir = os.path.join(self.workdir, name_version)
        os.chdir(build_dir)
        process.run('./configure --prefix=%s' % self.install_prefix,
                    shell=True)
        build.make(build_dir)
        build.make(build_dir, extra_args='install')
    def setUp(self):

        if not memory.check_hotplug():
            self.cancel("UnSupported : memory hotplug not enabled\n")
        sm = SoftwareManager()
        if not sm.check_installed('stress') and not sm.install('stress'):
            tarball = self.fetch_asset(
                'https://people.seas.harvard.edu/~apw/stress/stress-1.0.4.tar.gz')
            archive.extract(tarball, self.teststmpdir)
            self.sourcedir = os.path.join(
                self.teststmpdir, os.path.basename(tarball.split('.tar.')[0]))

            os.chdir(self.sourcedir)
            process.run('[ -x configure ] && ./configure', shell=True)
            build.make(self.sourcedir)
            build.make(self.sourcedir, extra_args='install')
        self.iteration = self.params.get('iteration', default=1)
        self.stresstime = self.params.get('stresstime', default=10)
        self.vmcount = self.params.get('vmcount', default=4)
        self.iocount = self.params.get('iocount', default=4)
        self.memratio = self.params.get('memratio', default=5)
        self.blocks_hotpluggable = get_hotpluggable_blocks(
            (os.path.join('%s', 'memory*') % mem_path), self.memratio)
        if os.path.exists("%s/auto_online_blocks" % mem_path):
            if not self.__is_auto_online():
                self.hotplug_all(self.blocks_hotpluggable)
        clear_dmesg()
    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 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):
     """
     Download 'nvme-cli'.
     """
     self.device = self.params.get('device', default='/dev/nvme0')
     self.disk = self.params.get('disk', default='/dev/nvme0n1')
     cmd = 'ls %s' % self.device
     if process.system(cmd, ignore_status=True) is not 0:
         self.skip("%s does not exist" % self.device)
     smm = SoftwareManager()
     if not smm.check_installed("nvme-cli") and not \
             smm.install("nvme-cli"):
         self.skip('nvme-cli is needed for the test to be run')
     python_packages = pip.get_installed_distributions()
     python_packages_list = [i.key for i in python_packages]
     python_pkgs = ['nose', 'nose2', 'pep8', 'flake8', 'pylint', 'epydoc']
     for py_pkg in python_pkgs:
         if py_pkg not in python_packages_list:
             self.skip("python package %s not installed" % py_pkg)
     url = 'https://codeload.github.com/linux-nvme/nvme-cli/zip/master'
     tarball = self.fetch_asset("nvme-cli-master.zip", locations=[url],
                                expire='7d')
     archive.extract(tarball, self.teststmpdir)
     self.nvme_dir = os.path.join(self.teststmpdir, "nvme-cli-master")
     print os.listdir(self.nvme_dir)
     os.chdir(os.path.join(self.nvme_dir, 'tests'))
     msg = ['{']
     msg.append('    \"controller\": \"%s\",' % self.device)
     msg.append('    \"ns1\": \"%s\",' % self.disk)
     msg.append('    \"log_dir\": \"%s\"' % self.outputdir)
     msg.append('}')
     with open('config.json', 'w') as config_file:
         config_file.write("\n".join(msg))
     process.system("cat config.json")
Beispiel #29
0
    def setUp(self):
        '''
        Build Stutter Test
        Source:
        https://github.com/gaowanlong/stutter/archive/master.zip
        '''

        # Check for basic utilities
        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/gaowanlong/stutter/archive/"
                     "master.zip"]
        tarball = self.fetch_asset("stutter.zip", locations=locations,
                                   expire='7d')
        archive.extract(tarball, self.srcdir)
        self.srcdir = os.path.join(self.srcdir, 'stutter-master')

        mem_byte = str(memory.memtotal())
        print mem_byte
        self._memory = self.params.get('memory', default=mem_byte)
        self._iteration = self.params.get('iteration', default='10')
        self._logdir = self.params.get('logdir', default='/var/tmp/logdir')
        self._rundir = self.params.get('rundir', default='/tmp')

        process.run('mkdir -p  %s' % self._logdir)

        # export env variable, used by test script
        os.environ['MEMTOTAL_BYTES'] = self._memory
        os.environ['ITERATIONS'] = self._iteration
        os.environ['LOGDIR_RESULTS'] = self._logdir
        os.environ['TESTDISK_DIR'] = self._rundir

        build.make(self.srcdir)
    def setUp(self):
        self.test_file = self.params.get('tmp_file', default='/tmp/dummy')
        self.duration = self.params.get('duration', default='30')
        self.threads = self.params.get(
            'threads', default=cpu.online_cpus_count())
        self.size = self.params.get(
            'memory_to_test', default=int(0.9 * memory.meminfo.MemFree.m))

        smm = SoftwareManager()
        for package in ['gcc', 'libtool', 'autoconf', 'automake', 'make']:
            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)

        if not os.path.exists(self.test_file):
            try:
                os.mknod(self.test_file)
            except OSError:
                self.cancel("Skipping test since test file creation failed")
        loc = ["https://github.com/stressapptest/"
               "stressapptest/archive/master.zip"]
        tarball = self.fetch_asset("stressapp.zip", locations=loc,
                                   expire='7d')
        archive.extract(tarball, self.workdir)
        self.sourcedir = os.path.join(self.workdir, 'stressapptest-master')

        os.chdir(self.sourcedir)
        process.run('./configure', shell=True)

        build.make(self.sourcedir)
 def setUp(self):
     '''
     To check and install dependencies for the test
     '''
     sm = SoftwareManager()
     for pkg in ["ethtool", "net-tools"]:
         if not sm.check_installed(pkg) and not sm.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.ipaddr = self.params.get("host_ip", default="")
     self.netmask = self.params.get("netmask", default="")
     configure_network.set_ip(self.ipaddr, self.netmask, self.iface)
     cmd = "basename /sys/class/net/%s/device/driver/module/drivers/*" % self.iface
     self.iface_type, self.driver = process.system_output(
         cmd, shell=True).decode("utf-8").split(':')
     self.businfo = self.get_bus_info(self.iface, self.iface_type)
    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()
        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')

        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()
Beispiel #33
0
    def setUp(self):
        """
        Build libvecpf

        Source:
        http://github.com/Libvecpf/libvecpf.git
        """
        smm = SoftwareManager()
        for package in ['gcc', 'make']:
            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('libvecpf.zip', locations=[
                                   'https://github.com/Libvecpf/libvecpf'
                                   '/archive/master.zip'], expire='7d')
        archive.extract(tarball, self.workdir)
        self.sourcedir = os.path.join(self.workdir, 'libvecpf-master')

        build.make(self.sourcedir, make='./configure')
        build.make(self.sourcedir)
Beispiel #34
0
 def setUp(self):
     '''
         To check and install dependencies for the test
     '''
     sm = SoftwareManager()
     network_tools = ("iputils", "ethtool", "net-tools", "openssh-clients")
     for pkg in network_tools:
         if not sm.check_installed(pkg) and not sm.install(pkg):
             self.skip("%s package is need to test" % pkg)
     interfaces = netifaces.interfaces()
     interface = self.params.get("iface")
     if interface not in interfaces:
         self.skip("%s interface is not available" % interface)
     mtu_list = self.params.get("size_val", default=1500)
     self.mtu_list = mtu_list.split()
     self.interface = interface
     self.peer = self.params.get("peerip")
     self.eth = "ethtool %s | grep 'Link detected:'" % self.interface
     self.eth_state = process.system_output(self.eth, shell=True)
 def setUp(self):
     # 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 distro.detect().name in ['rhel', 'redhat']:
         self.cancel('Hwinfo not supported on RHEL')
     sm = SoftwareManager()
     if not sm.check_installed("hwinfo") and not sm.install("hwinfo"):
         self.cancel("Fail to install hwinfo required for this test.")
     self.clear_dmesg()
     self.disk_name = process.system_output(
         "df -h | egrep '(s|v)d[a-z][1-8]' | "
         "tail -1 | cut -d' ' -f1",
         shell=True).strip("12345")
     self.Unique_Id = process.system_output("hwinfo --disk --only %s | "
                                            "grep 'Unique' | head -1 | "
                                            "cut -d':' -f2" %
                                            self.disk_name,
                                            shell=True)
    def setUp(self):
        """
        Verifies if we have gcc to compile disktest.
        :param disk: Disk to be used in test.
        :param dir: Directory of used in test. When the target does not exist,
                    it's created.
        :param gigabytes: Disk space that will be used for the test to run.
        :param chunk_mb: Size of the portion of the disk used to run the test.
                        Cannot be smaller than the total amount of RAM.
        """
        softm = SoftwareManager()
        if not softm.check_installed("gcc") and not softm.install("gcc"):
            self.cancel('Gcc is needed for the test to be run')
        # Log of all the disktest processes
        self.disk_log = os.path.abspath(os.path.join(self.outputdir,
                                                     "log.txt"))

        self._init_params()
        self._compile_disktest()
Beispiel #37
0
 def setUp(self):
     # Check for basic utilities
     sm = SoftwareManager()
     detected_distro = distro.detect()
     deps = ['oprofile', 'dejagnu', 'expect']
     if detected_distro.name == "SuSE":
         deps.append("git-core")
     else:
         deps.append("git")
     if detected_distro.name == "Ubuntu":
         deps.append("libxml2-utils")
         deps.append("tclsh")
     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')
     git.get_repo('git://git.code.sf.net/p/oprofile/oprofile-tests',
                  destination_dir=self.srcdir)
     os.chdir(self.srcdir)
     os.chdir("testsuite/")
Beispiel #38
0
    def setUp(self):
        '''
        Build Trinity
        Source:
        https://github.com/kernelslacker/trinity
        '''
        """
        Add not root user
        """
        if process.system('getent group trinity', ignore_status=True):
            process.run('groupadd trinity', sudo=True)
        if process.system('getent passwd trinity', ignore_status=True):
            process.run('useradd -g trinity  -m -d /home/trinity  trinity',
                        sudo=True)
        process.run('usermod -a -G trinity  trinity', sudo=True)

        smm = SoftwareManager()

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

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

        os.chdir(self.srcdir)

        process.run('chmod -R  +x ' + self.srcdir)
        process.run('./configure', shell=True)
        build.make('.')
        process.run('touch trinity.log')
        process.run('cp -r ' + self.srcdir + ' /home/trinity')
        self.srcdir = os.path.join('/home/trinity', 'trinity-master')

        process.run('chown -R trinity:trinity ' + self.srcdir)
Beispiel #39
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

        deps = ['gcc', 'make']
        if 'Ubuntu' in self.distro_name:
            deps.extend(
                ['linux-tools-common',
                 'linux-tools-%s' % platform.uname()[2]])
        elif 'debian' in detected_distro.name:
            deps.extend(['linux-perf'])
        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)

        # Check for c2c is available in the system.
        output = process.run('perf mem record -e list').stderr.decode("utf-8")
        if 'ldlat-stores' in output or 'ldlat-loads' in output:
            self.log.info("perf c2c is available")
        else:
            self.cancel('perf c2c is not available')

        # Creating temporary file to collect the perf.data
        self.temp_file = tempfile.NamedTemporaryFile().name

        # Getting the parameters from yaml file
        self.record = self.params.get('record_method', default='')
        self.report = self.params.get('report_method', default='')

        # Clear the dmesg, by that we can capture the delta at the end of the
        # test.
        process.run("dmesg -C", sudo=True)
    def setUp(self):
        """
        Verify it is baremetal
        Install the cpupower tool

        :avocado: tags=cpu,power
        """
        if not os.path.exists('/proc/device-tree/ibm,opal/power-mgt'):
            self.cancel("Supported only on Power Non Virutalized environment")
        smm = SoftwareManager()
        detected_distro = distro.detect()
        if 'Ubuntu' in detected_distro.name:
            deps = ['linux-tools-common', 'linux-tools-%s'
                    % platform.uname()[2]]
        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)
    def setUp(self):
        '''
        Build posixtest
        Source:
            http://ufpr.dl.sourceforge.net/sourceforge/posixtest/posixtestsuite-1.5.2.tar.gz
        '''
        self.test_type = self.params.get('test_type', default='THR')
        sm = SoftwareManager()
        for package in ['gcc', 'make']:
            if not sm.check_installed(package) and not sm.install(package):
                self.cancel("%s is needed for the test to be run" % package)
        tarball = self.fetch_asset("http://ufpr.dl.sourceforge.net"
                                   "/sourceforge/posixtest"
                                   "/posixtestsuite-1.5.2.tar.gz")
        archive.extract(tarball, self.workdir)
        version = os.path.basename(tarball.split('-1.')[0])
        self.sourcedir = os.path.join(self.workdir, version)

        build.make(self.sourcedir)
Beispiel #42
0
    def setUp(self):
        smg = SoftwareManager()
        dist = distro.detect()
        if dist.name in ['Ubuntu']:
            linux_tools = "linux-tools-" + os.uname()[2]
            pkgs = [linux_tools]
            if dist.name in ['Ubuntu']:
                pkgs.extend(['linux-tools-common'])
        elif dist.name in ['debian']:
            pkgs = ['linux-perf']
        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)
    def setUp(self):
        if "ppc" not in os.uname()[4]:
            self.cancel("supported only on Power platform")
        smm = SoftwareManager()
        detected_distro = distro.detect()
        parser = configparser.ConfigParser()
        parser.read(self.get_data("pvr.cfg"))
        if detected_distro.name == "Ubuntu":
            pkg = 'device-tree-compiler'
        else:
            pkg = 'dtc'
        if not smm.check_installed(pkg) and not smm.install(pkg):
            self.cancel("%s package is needed for the test to be run" % pkg)

        val = genio.read_file("/proc/cpuinfo")
        for line in val.splitlines():
            if 'revision' in line:
                rev = (line.split('revision')[1]).split()
                self.log.info("Revision: %s %s" % (rev, rev[1]))
                break
        if 'pSeries|PowerNV' in val and 'POWER8' in val:
            self.pvr_value = parser.get('PVR_Values', 'pvr_value_p8')
        elif 'pSeries' in val and 'POWER9' in val:
            if (rev[1] == '1.2'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9LPAR_1.2')
            elif (rev[1] == '2.2'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9LPAR_2.2')
            elif (rev[1] == '2.3'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9LPAR_2.3')
        elif 'PowerNV' in val and 'POWER9' in val:
            if (rev[1] == '2.1'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9NV_2.1')
            elif (rev[1] == '2.2'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9NV_2.2')
            elif (rev[1] == '2.3'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p9NV_2.3')
        elif 'pSeries' in val and 'POWER10' in val:
            if (rev[1] == '1.0'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p10_1')
            elif (rev[1] == '2.0'):
                self.pvr_value = parser.get('PVR_Values', 'pvr_value_p10_2')
        else:
            self.fail("Unsupported processor family")
 def setUp(self):
     smm = SoftwareManager()
     deps = ['gcc', 'make', 'patch']
     for package in deps:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel(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.workdir)
     self.sourcedir = os.path.join(self.workdir, "eatmemory-master")
     # patch for getch remove
     getch_patch = 'patch -p1 < %s' % self.get_data('eatmem_getch.patch')
     os.chdir(self.sourcedir)
     process.run(getch_patch, shell=True)
     build.make(self.sourcedir)
     mem = self.params.get('memory_to_test', default=int(0.95 * memory.meminfo.MemFree.k))
     self.mem_to_eat = self._mem_to_mbytes(mem)
     if self.mem_to_eat is None:
         self.cancel("Memory '%s' not valid." % mem)
    def setup_htx(self):
        """
        Builds HTX
        """
        detected_distro = distro.detect()
        packages = ['git', 'gcc', 'make']
        if detected_distro.name in ['centos', 'fedora', 'rhel', 'redhat']:
            packages.extend(['gcc-c++', 'ncurses-devel', 'tar'])
        elif detected_distro.name == "Ubuntu":
            packages.extend(
                ['libncurses5', 'g++', 'ncurses-dev', 'libncurses-dev'])
        elif detected_distro.name == 'SuSE':
            packages.extend(['libncurses5', 'gcc-c++', 'ncurses-devel', 'tar'])
        else:
            self.cancel("Test not supported in  %s" % detected_distro.name)

        smm = SoftwareManager()
        for pkg in packages:
            if not smm.check_installed(pkg) and not smm.install(pkg):
                self.cancel("Can not install %s" % pkg)

        url = "https://github.com/open-power/HTX/archive/master.zip"
        tarball = self.fetch_asset("htx.zip", locations=[url], expire='7d')
        archive.extract(tarball, self.teststmpdir)
        htx_path = os.path.join(self.teststmpdir, "HTX-master")
        os.chdir(htx_path)

        exercisers = ["hxecapi_afu_dir", "hxedapl", "hxecapi", "hxeocapi"]
        for exerciser in exercisers:
            process.run("sed -i 's/%s//g' %s/bin/Makefile" %
                        (exerciser, htx_path))

        build.make(htx_path, extra_args='all')
        build.make(htx_path, extra_args='tar')
        process.run('tar --touch -xvzf htx_package.tar.gz')
        os.chdir('htx_package')
        if process.system('./installer.sh -f'):
            self.fail("Installation of htx fails:please refer job.log")
        self.log.info("Starting the HTX Deamon")
        process.run('/usr/lpp/htx/etc/scripts/htxd_run')

        self.log.info("Creating the HTX mdt files")
        process.run('htxcmdline -createmdt')
Beispiel #46
0
 def setUp(self):
     dist = distro.detect()
     sm = SoftwareManager()
     sos_pkg = ""
     if not process.system("sosreport", ignore_status=True, sudo=True):
         self.log.info("sosreport is installed")
     elif dist.name == 'Ubuntu':
         sos_pkg = 'sosreport'
     # 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 ['rhel', 'redhat']:
         sos_pkg = 'sos'
     else:
         self.cancel("sosreport is not supported on this distro ")
     if sos_pkg and not sm.check_installed(sos_pkg) and not sm.install(
             sos_pkg):
         self.cancel("Package %s is missing and could not be installed" %
                     sos_pkg)
    def setUp(self):
        '''
        Build Stutter Test
        Source:
        https://github.com/gaowanlong/stutter/archive/master.zip
        '''

        # Check for basic utilities
        smm = SoftwareManager()

        for package in ['gcc', 'make']:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel("Fail to install %s required for this test." %
                            package)

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

        mem_byte = str(memory.memtotal())
        print mem_byte
        self._memory = self.params.get('memory', default=mem_byte)
        self._iteration = self.params.get('iteration', default='10')
        self._logdir = self.params.get('logdir', default='/var/tmp/logdir')
        self._rundir = self.params.get('rundir', default='/tmp')

        if not os.path.exists(self._logdir):
            os.makedirs(self._logdir)

        # export env variable, used by test script
        os.environ['MEMTOTAL_BYTES'] = self._memory
        os.environ['ITERATIONS'] = self._iteration
        os.environ['LOGDIR_RESULTS'] = self._logdir
        os.environ['TESTDISK_DIR'] = self._rundir

        build.make(self.sourcedir)
Beispiel #48
0
    def setUp(self):
        """
        Install all the dependency packages required for building
        source tarball specific to os,if not tests will stop.
        """
        smm = SoftwareManager()
        dist = distro.detect()
        packages = ['gcc', 'dejagnu', 'flex', 'bison', 'sharutils']

        if dist.name in ['Ubuntu', 'debian']:
            packages.extend(['libmpfr-dev', 'libgmp-dev', 'libmpc-dev',
                             'zip', 'libc6-dev', 'libelf1',
                             'elfutils', 'autogen'])
            if dist.name == 'Ubuntu':
                packages.extend(['texinfo', 'gnat'])
        elif dist.name == 'SuSE':
            packages.extend(['glibc-devel-static', 'zlib-devel', 'elfutils',
                             'libelf-devel', 'gcc-c++', 'isl-devel',
                             'gmp-devel', 'glibc-devel', 'mpfr-devel',
                             'makeinfo', 'texinfo', 'mpc-devel'])
        else:
            packages.extend(['glibc-static', 'autogen', 'guile',
                             'guile-devel', 'libgo', 'libgo-devel',
                             'libgo-static', 'elfutils-devel',
                             'texinfo-tex', 'texinfo', 'elfutils-libelf-devel',
                             'gmp-devel', 'mpfr-devel', 'libmpc-devel',
                             'gcc-gnat', 'libgnat', 'zlib-devel',
                             'gettext', 'libgcc', 'libgomp'])

        for package in packages:
            if not smm.check_installed(package) and not smm.install(package):
                self.cancel(
                    "Failed to install %s required for this test." % package)
        tarball = self.fetch_asset('gcc.zip', locations=[
                                   'https://github.com/gcc-mirror/gcc/archive'
                                   '/master.zip'], expire='7d')
        archive.extract(tarball, self.workdir)
        self.sourcedir = os.path.join(self.workdir, 'gcc-master')

        os.chdir(self.sourcedir)
        process.run('./configure', ignore_status=True, sudo=True)
        build.make(self.sourcedir, ignore_status=True)
 def setUp(self):
     '''
     set up required packages and gather necessary test inputs
     '''
     smm = SoftwareManager()
     packages = [
         'src', 'rsct.basic', 'rsct.core.utils', 'rsct.core', 'DynamicRM',
         'powerpc-utils'
     ]
     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)
     self.hmc_ip = self.get_mcp_component("HMCIPAddr")
     if not self.hmc_ip:
         self.cancel("HMC IP not got")
     self.hmc_pwd = self.params.get("hmc_pwd", '*', default=None)
     self.hmc_username = self.params.get("hmc_username", '*', default=None)
     self.lpar = self.get_partition_name("Partition Name")
     if not self.lpar:
         self.cancel("LPAR Name not got from lparstat command")
     self.login(self.hmc_ip, self.hmc_username, self.hmc_pwd)
     cmd = 'lssyscfg -r sys  -F name'
     output = self.run_command(cmd)
     self.server = ''
     for line in output.splitlines():
         if line in self.lpar:
             self.server = line
             break
     if not self.server:
         self.cancel("Managed System not got")
     self.sriov_adapter = self.params.get('sriov_adapter',
                                          '*',
                                          default=None).split(' ')
     self.sriov_port = self.params.get('sriov_port', '*',
                                       default=None).split(' ')
     self.ipaddr = self.params.get('ipaddr', '*', default="").split(' ')
     self.netmask = self.params.get('netmasks', '*', default="").split(' ')
     self.peer_ip = self.params.get('peer_ip', '*', default="").split(' ')
     self.mac_id = self.params.get('mac_id',
                                   default="02:03:03:03:03:01").split(' ')
     self.mac_id = [mac.replace(':', '') for mac in self.mac_id]
     self.local = LocalHost()
Beispiel #50
0
    def setUp(self):
        """
        Check existence of input PV,VG, LV and snapshots prior to Test.
        """
        pkg = ""
        smm = SoftwareManager()
        self.disk = self.params.get('disk', default=None)
        vg_name = self.params.get('vg_name', default='avocado_vg')
        lv_name = self.params.get('lv_name', default='avocado_lv')
        self.lv_size = self.params.get('lv_size', default='1G')
        self.fs_name = self.params.get('fs', default='ext4').lower()
        if self.fs_name == 'xfs':
            pkg = 'xfsprogs'
        if self.fs_name == 'btrfs':
            if distro.detect().name == 'SuSE':
                pkg = 'btrfsprogs'
            else:
                pkg = 'btrfs-progs'
        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)
        lv_snapshot_name = self.params.get('lv_snapshot_name',
                                           default='avocado_sn')
        self.lv_snapshot_size = self.params.get('lv_snapshot_size',
                                                default='1G')
        self.ramdisk_vg_size = self.params.get('ramdisk_vg_size',
                                               default='10000')
        self.ramdisk_basedir = self.params.get('ramdisk_basedir',
                                               default=self.workdir)
        self.ramdisk_sparse_filename = self.params.get(
            'ramdisk_sparse_filename', default='virtual_hdd')

        if lv_utils.vg_check(vg_name):
            self.cancel('Volume group %s already exists' % vg_name)
        self.vg_name = vg_name
        if lv_utils.lv_check(vg_name, lv_name):
            self.cancel('Logical Volume %s already exists' % lv_name)
        self.lv_name = lv_name
        if lv_utils.lv_check(vg_name, lv_snapshot_name):
            self.cancel('Snapshot %s already exists' % lv_snapshot_name)
        self.mount_loc = self.srcdir
        self.lv_snapshot_name = lv_snapshot_name
Beispiel #51
0
    def setUp(self):
        smg = SoftwareManager()
        dist = distro.detect()
        self.args = self.params.get('args', default='')
        self.mem_leak = self.params.get('mem_leak', default=0)

        deps = ['gcc', 'make', 'automake', 'autoconf', 'psmisc']
        if dist.name == "Ubuntu":
            deps.extend(['libnuma-dev'])
        elif dist.name in ["centos", "rhel", "fedora"]:
            deps.extend(['numactl-devel'])
        elif dist.name == "SuSE":
            deps.extend(['libnuma-devel'])
        self.ltpbin_dir = self.mount_dir = None
        self.thp = False
        if self.args in self.mem_tests:
            self.mount_dir = self.params.get('tmpfs_mount_dir', default=None)
            if self.mount_dir:
                self.setup_tmpfs_dir()
            over_commit = self.params.get('overcommit', default=True)
            if not over_commit:
                process.run('echo 2 > /proc/sys/vm/overcommit_memory',
                            shell=True,
                            ignore_status=True)

        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)
        clear_dmesg()
        url = "https://github.com/linux-test-project/ltp/archive/master.zip"
        tarball = self.fetch_asset("ltp-master.zip", locations=[url])
        archive.extract(tarball, self.workdir)
        ltp_dir = os.path.join(self.workdir, "ltp-master")
        os.chdir(ltp_dir)
        build.make(ltp_dir, extra_args='autotools')
        if not self.ltpbin_dir:
            self.ltpbin_dir = os.path.join(self.teststmpdir, 'bin')
        if not os.path.exists(self.ltpbin_dir):
            os.mkdir(self.ltpbin_dir)
        process.system('./configure --prefix=%s' % self.ltpbin_dir)
        build.make(ltp_dir)
        build.make(ltp_dir, extra_args='install')
Beispiel #52
0
    def setUp(self):
        """
        Build 'fio'.
        """
        print("start set up")
        default_url = "https://brick.kernel.dk/snaps/fio-git-latest.tar.gz"
        url = self.params.get('fio_tool_url', default=default_url)
        self.disk = self.params.get('disk', default=None)
        self.dirs = self.params.get('dir', default=self.workdir)
        fstype = self.params.get('fs', default='ext4')
        tarball = self.fetch_asset(url)
        archive.extract(tarball, self.teststmpdir)
        self.sourcedir = os.path.join(self.teststmpdir, "fio")
        build.make(self.sourcedir)
        print("set up done.")

        smm = SoftwareManager()

        if fstype == 'btrfs':
            ver = int(distro.detect().version)
            rel = int(distro.detect().release)
            if distro.detect().name == 'rhel':
                if (ver == 7 and rel >= 4) or ver > 7:
                    self.cancel("btrfs is not supported with \
                                RHEL 7.4 onwards")

        if distro.detect().name in ['Ubuntu', 'debian']:
            pkg_list = ['libaio-dev']
            if fstype == 'btrfs':
                pkg_list.append('btrfs-progs')
        else:
            pkg_list = ['libaio', 'libaio-devel']

        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)

        if self.disk is not None:
            self.part_obj = Partition(self.disk, mountpoint=self.dirs)

        self.fio_file = 'fiotest-image'
Beispiel #53
0
    def setUp(self):
        """
        Setting up the env for the kernel building
        """
        smg = SoftwareManager()
        self.detected_distro = distro.detect()
        deps = ['gcc', 'make', 'automake', 'autoconf', 'time', 'bison', 'flex']
        if 'Ubuntu' in self.detected_distro.name:
            deps.extend([
                'libpopt0', 'libc6', 'libc6-dev', 'libpopt-dev', 'libcap-ng0',
                'libcap-ng-dev', 'elfutils', 'libelf1', 'libnuma-dev',
                'libfuse-dev', 'libssl-dev'
            ])
        elif 'SuSE' in self.detected_distro.name:
            deps.extend([
                'libpopt0', 'glibc', 'glibc-devel', 'popt-devel', 'libcap2',
                'libcap-devel', 'libcap-ng-devel', 'openssl-devel'
            ])
        elif self.detected_distro.name in ['centos', 'fedora', 'rhel']:
            deps.extend([
                'popt', 'glibc', 'glibc-devel', 'libcap-ng', 'libcap',
                'libcap-devel', 'elfutils-libelf', 'elfutils-libelf-devel',
                'openssl-devel'
            ])

        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)
        self.kernel_version = platform.uname()[2]
        self.iterations = self.params.get('runs', default=1)
        self.threads = self.params.get('cpus',
                                       default=2 * cpu.online_cpus_count())
        self.location = self.params.get(
            'url',
            default='https://github.com/torvalds/linux/archive'
            '/master.zip')
        self.config_path = os.path.join('/boot/config-', self.kernel_version)
        # Uncompress the kernel archive to the work directory
        tarball = self.fetch_asset("kernbench.zip",
                                   locations=[self.location],
                                   expire='1d')
        archive.extract(tarball, self.workdir)
Beispiel #54
0
 def setUp(self):
     sm = SoftwareManager()
     # Check for basic utilities
     for package in ['gcc', 'make']:
         if not sm.check_installed(package) and not sm.install(package):
             self.error(package + ' is needed for the test to be run')
     url = 'https://download.pureftpd.org/blogbench/blogbench-1.1.tar.bz2'
     blogbench_url = self.params.get('blogbench_url', default=url)
     blogbench_tarball = self.fetch_asset(blogbench_url, expire='7d')
     archive.extract(blogbench_tarball, self.srcdir)
     blogbench_version = os.path.basename(
         blogbench_tarball.split('.tar.')[0])
     self.blogbench_dir = os.path.join(self.srcdir, blogbench_version)
     os.chdir(self.blogbench_dir)
     patch = self.params.get('patch', default='config_guess.patch')
     process.run('patch -p1 config.guess %s' %
                 os.path.join(self.datadir, patch),
                 shell=True)
     process.system('./configure')
     build.make(self.blogbench_dir, extra_args='install-strip')
 def setUp(self):
     '''
     Install the basic packages to support evmctl
     '''
     # Check for basic utilities
     smm = SoftwareManager()
     deps = ['gcc', 'make']
     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://sourceforge.net/projects/linux-ima/files/latest/download"
     tarball = self.fetch_asset(name="download.tar.gz",
                                locations=url,
                                expire='7d')
     archive.extract(tarball, self.workdir)
     self.sourcedir = os.path.join(self.workdir,
                                   os.listdir(self.workdir)[0])
     self.log.info("sourcedir - %s" % self.sourcedir)
     os.chdir(self.sourcedir)
     process.run('./autogen.sh', ignore_status=True)
    def setUp(self):
        """
        Checking if the required packages are installed,
        if not found packages will be installed
        """

        smm = SoftwareManager()
        if not smm.check_installed("smartctl"):
            self.log.info("smartctl should be installed prior to the test")
            if smm.install("smartmontools") is False:
                self.cancel("Unable to install smartctl")
        self.option = self.params.get('option')
        self.disks = self.params.get('disk')
        if self.disks is '' or self.option is '':
            self.cancel(" Test skipped!!, please ensure Block device and \
            options are specified in yaml file")
        cmd = "df -h /boot | grep %s" % (self.disks)
        if process.system(cmd, timeout=300, ignore_status=True,
                          shell=True) == 0:
            self.cancel(" Skipping it's OS disk")
Beispiel #57
0
 def setUp(self):
     """
     Build 'nvme-cli' and setup the device.
     """
     self.device = self.params.get('device', default='/dev/nvme0')
     cmd = 'ls %s' % self.device
     if process.system(cmd, ignore_status=True) is not 0:
         self.skip("%s does not exist" % self.device)
     smm = SoftwareManager()
     if not smm.check_installed("nvme-cli") and not \
             smm.install("nvme-cli"):
         self.skip('nvme-cli is needed for the test to be run')
     self.id_ns = self.create_namespace()
     self.log.info(self.id_ns)
     cmd = "nvme id-ns %s | grep 'in use' | awk '{print $5}' | \
         awk -F':' '{print $NF}'" % self.id_ns
     self.format_size = process.system_output(cmd, shell=True).strip('\n')
     self.format_size = pow(2, int(self.format_size))
     cmd = "nvme id-ns %s | grep 'in use' | awk '{print $2}'" % self.id_ns
     self.lba = process.system_output(cmd, shell=True).strip('\n')
 def setUp(self):
     """
     Setting up the env for SDT markers
     """
     smg = SoftwareManager()
     detected_distro = distro.detect()
     if 'ppc' not in distro.detect().arch:
         self.cancel("Test supportd only on  ppc64 arch")
     deps = ['gcc', 'make']
     if 'Ubuntu' in detected_distro.name:
         deps.extend(['libc-dev', 'libc-bin', 'linux-tools-common',
                      'linux-tools-%s' % platform.uname()[2]])
     elif detected_distro.name in ['rhel', 'SuSE', 'fedora', 'centos']:
         deps.extend(['perf', 'glibc', 'glibc-devel'])
     else:
         self.cancel("Install the package for perf supported by %s"
                     % detected_distro.name)
     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)
Beispiel #59
0
 def setUp(self):
     """
     Build tiobench.
     Source:
     https://github.com/mkuoppal/tiobench.git
     """
     self.fstype = self.params.get('fs', default='ext4')
     smm = SoftwareManager()
     packages = ['gcc']
     if self.fstype == 'btrfs':
         if distro.detect().name == 'Ubuntu':
             packages.extend(['btrfs-tools'])
     for package in packages:
         if not smm.check_installed(package) and not smm.install(package):
             self.cancel("%s package required for this test." % package)
     locations = ["https://github.com/mkuoppal/tiobench/archive/master.zip"]
     tarball = self.fetch_asset("tiobench.zip", locations=locations)
     archive.extract(tarball, self.srcdir)
     os.chdir(os.path.join(self.srcdir, "tiobench-master"))
     build.make(".")
 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])
     elif detected_distro.name in ['redhat', 'SuSE', 'fedora']:
         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)