diff --git a/fs/filebench.py b/fs/filebench.py deleted file mode 100644 index 5d94311b1..000000000 --- a/fs/filebench.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# See LICENSE for more details. -# -# Copyright: 2016 IBM -# Author:Praveen K Pandey -# - - -import os - -from avocado import Test -from avocado.utils import process, archive, build -from avocado.utils.software_manager.manager import SoftwareManager - - -class Filebench(Test): - - """ - Filebench - A Model Based File System Workload Generator - - :avocado: tags=fs - """ - - 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 test(self): - binary_path = os.path.join(self.install_prefix, 'bin', 'filebench') - testfile = self.params.get('testfile', default='fileserver.f') - testfile_path = os.path.join(self.install_prefix, 'share', 'filebench', - 'workloads', testfile) - - # Due to compatibility issues with filebench, ASLR (Address Space - # Layout Randomization) is disabled in the process personality. - # Filebench does not work properly when ASLR is enabled. - # Disabling ASLR ensures consistent behavior and reliable execution - # of filebench benchmarks. - - cmd = 'setarch --addr-no-randomize %s -f %s' % (binary_path, testfile_path) - out = process.system_output(cmd) - self.log.info(b"result:" + out) diff --git a/fs/filebench.py.data/README b/fs/filebench.py.data/README deleted file mode 100644 index 11a7ca0c0..000000000 --- a/fs/filebench.py.data/README +++ /dev/null @@ -1,31 +0,0 @@ -Through avocado yaml file workload file can be passed as param testfile -it can lies in two category - -1: User-defined workloads -First step is to create the description of the workload (so called workload -personality) in WML language. Typically, workload personalities are stored in -files with '.f' extension. In this example we describe a very simple workload -consisting of two processes with three threads each. Every thread continuously -picks a file among many, reads it, and then closes the file. Here is the -corresponding workload personality: - -01 define fileset name="testF",entries=10000,filesize=16k,prealloc,path="/tmp" -02 -03 define process name="readerP",instances=2 { -04 thread name="readerT",instances=3 { -05 flowop openfile name="openOP",filesetname="testF" -06 flowop readwholefile name="readOP",filesetname="testF" -07 flowop closefile name="closeOP" -08 } -09 } -10 -11 run 60 -2- There is multiple workload available by default in test suite - -Filebench comes with several predefined micro- and macro-workloads (e.g., -webserver, fileserver, mailserver) which are also described in WML, not -differently than the workload in Example 1 above. In the source code tree, -workloads are located in the workloads/ directory and are typically installed in -/usr/local/share/filebench/workloads/ during 'make install' (though this can -differ from one installation to another). -can be find in /usr/local/share/filebench/workloads/ diff --git a/fs/filebench.py.data/filebench.yaml b/fs/filebench.py.data/filebench.yaml deleted file mode 100644 index 8ad2c055f..000000000 --- a/fs/filebench.py.data/filebench.yaml +++ /dev/null @@ -1,2 +0,0 @@ -filebenchrun: - testfile : 'webserver.f' diff --git a/fs/fsx.py b/fs/fsx.py deleted file mode 100644 index 4a522fb9f..000000000 --- a/fs/fsx.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# See LICENSE for more details. -# Copyright: 2017 IBM -# Author: Harish -# Ayush Jain -# - -import os -import re -from avocado import Test -from avocado.utils import process, genio, archive, build -from avocado.utils.software_manager.manager import SoftwareManager -from avocado.utils.partition import Partition - - -class Fsx(Test): - ''' - The Fsx test is a file system exerciser test - - :avocado: tags=fs - ''' - - def parse_results(self, results): - pattern = re.compile( - r"\b(passed|failed|broken|skipped|warnings)\s+(\d+)") - matches = pattern.findall(results.stderr.decode("utf-8")) - result_dict = dict(matches) - for param, count in result_dict.items(): - self.log.info(f"{str(param)} : {str(count)}") - if (int(result_dict["failed"]) > 0 or int(result_dict["broken"]) > 0): - self.fail('Fsx test failed') - elif (int(result_dict["skipped"]) > 0): - self.cancel(f'Fsx test {result_dict["skipped"]} skipped') - elif (int(result_dict["warnings"]) > 0): - self.log.warn(f'Fsx test {result_dict["warnings"]} warns') - - @staticmethod - def mount_point(dir): - lines = genio.read_file('/proc/mounts').rstrip('\t\r\0').splitlines() - for substr in lines: - mop = substr.split(" ")[1] - if mop == dir: - return True - return False - - def check_thp(self): - if 'thp_file_alloc' in genio.read_file('/proc/vm' - 'stat').rstrip('\t\r\n\0'): - self.thp = True - return self.thp - - def setup_tmpfs_dir(self): - # check for THP page cache - self.check_thp() - - if not os.path.isdir(self.dir): - os.makedirs(self.dir) - - self.device = None - if not self.mount_point(self.dir): - if self.thp: - self.device = Partition( - device=self.disk, mountpoint=self.dir, - mount_options="huge=always") - else: - self.device = Partition( - device=self.disk, mountpoint=self.dir) - self.device.mount(mountpoint=self.dir, - fstype="tmpfs", mnt_check=False) - - def setUp(self): - ''' - Setup fsx - ''' - - self.thp_page_cache = self.params.get('thp_page_cache', default=False) - smm = SoftwareManager() - for package in ['gcc', 'make', 'automake']: - if not smm.check_installed(package) and not smm.install(package): - self.cancel(package + ' is needed for the test to be run') - - self.disk = self.params.get('disk', default="none") - if self.thp_page_cache: - self.dir = self.params.get('dir', default=self.workdir) - if self.dir: - self.setup_tmpfs_dir() - self.output = os.path.join(self.dir, 'result') - else: - self.cancel("dir not specified") - else: - self.output = self.params.get('output_file', default=None) - if not self.output: - self.output = os.path.join(self.workdir, "result") - - if not os.path.exists(self.output): - os.makedirs(self.output) - repo = 'https://github.com/linux-test-project/ltp/archive/master.zip' - url = self.params.get('url', default=repo) - match = next((ext for ext in [".zip", ".tar"] if ext in url), None) - tarball = '' - if match: - tarball = self.fetch_asset( - "ltp-master%s" % match, locations=[url], expire='7d') - else: - self.cancel("Provided LTP Url is not valid") - self.ltpdir_parent = os.path.join(self.workdir, '/ltp') - if not os.path.exists(self.ltpdir_parent): - os.mkdir(self.ltpdir_parent) - archive.extract(tarball, self.ltpdir_parent) - self.ltp_dir = os.path.join(self.ltpdir_parent, "ltp-master") - os.chdir(self.ltp_dir) - build.make(self.ltp_dir, extra_args='autotools') - process.system('./configure') - - self.test_file_max_size = self.params.get( - 'test_file_max_size', default='1000000') - self.single_op_max_size = self.params.get( - 'single_op_max_size', default='1000000') - self.total_ops = self.params.get('total_ops', default='1000') - self.num_times = self.params.get('num_times', default='1') - - def test(self): - ''' - Run Fsx test for exercising file system - ''' - - fsx_dir = os.path.join(self.ltp_dir, "testcases/kernel/fs/fsx-linux") - os.chdir(fsx_dir) - build.make(fsx_dir) - - cmd = "TMPDIR=%s ./fsx-linux -l %s -o %s -N %s -i %s -D" \ - % (self.output, self.test_file_max_size, self.single_op_max_size, - self.total_ops, self.num_times) - - results = process.run(cmd, shell=True) - self.parse_results(results) - - def tearDown(self): - if self.thp_page_cache: - if self.dir: - self.device.unmount() diff --git a/fs/fsx.py.data/fsx-mm.yaml b/fs/fsx.py.data/fsx-mm.yaml deleted file mode 100644 index 38bd660d2..000000000 --- a/fs/fsx.py.data/fsx-mm.yaml +++ /dev/null @@ -1,10 +0,0 @@ -url: 'https://github.com/linux-test-project/ltp/archive/master.zip' -thp_page_cache: True -disk: -dir: '/mnt/tmpfs' -#only when mounting is not required -output_file: -test_file_max_size: -single_op_max_size: -total_ops: -num_times: