From 0eb4efd85ca586c8a326c28bc019435ff7e84548 Mon Sep 17 00:00:00 2001 From: Thierry Date: Mon, 13 Jan 2020 08:57:15 +0100 Subject: [PATCH 1/2] python3 startswith, endswith needs bytes Convert string to bytes for startswith and endswith in valgring.py Add debian dependency Signed-off-by: Thierry --- toolchain/valgrind.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/valgrind.py b/toolchain/valgrind.py index 44af6bc2c..90a2fcc33 100755 --- a/toolchain/valgrind.py +++ b/toolchain/valgrind.py @@ -37,7 +37,7 @@ def setUp(self): dist = distro.detect() deps = ['gcc', 'make'] - if dist.name == 'Ubuntu': + if dist.name in ['Ubuntu', 'debian']: deps.extend(['g++']) # FIXME: "redhat" as the distro name for RHEL is deprecated # on Avocado versions >= 50.0. This is a temporary compatibility @@ -73,7 +73,7 @@ def get_results(self, cmd): self.sourcedir, extra_args=cmd, process_kwargs={'ignore_status': True}).stdout for line in results.splitlines(): - if line.startswith('==') and line.endswith('=='): + if line.startswith(b'==') and line.endswith(b'=='): flag = True if flag: summary += '%s\n' % line From 04bf68047c2f5e7e873ddf6386774c3fae2405e2 Mon Sep 17 00:00:00 2001 From: Thierry Date: Mon, 13 Jan 2020 19:01:24 +0100 Subject: [PATCH 2/2] More debian dependencies Add or update debian/Ubuntu distro dependencies Signed-off-by: Thierry --- generic/stress-ng.py | 2 +- io/disk/fiotest.py | 10 +++++++--- io/disk/lvsetup.py | 16 ++++++++++------ perf/perfmon.py | 9 +++++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/generic/stress-ng.py b/generic/stress-ng.py index 557230834..68585434c 100644 --- a/generic/stress-ng.py +++ b/generic/stress-ng.py @@ -66,7 +66,7 @@ def setUp(self): if 'Ubuntu' in detected_distro.name: deps.extend([ 'libaio-dev', 'libapparmor-dev', 'libattr1-dev', 'libbsd-dev', - 'libcap-dev', 'libgcrypt11-dev', 'libkeyutils-dev', + 'libcap-dev', 'libgcrypt20-dev', 'libkeyutils-dev', 'libsctp-dev', 'zlib1g-dev']) else: deps.extend(['libattr-devel', 'libcap-devel', diff --git a/io/disk/fiotest.py b/io/disk/fiotest.py index 821848edf..2525a855c 100755 --- a/io/disk/fiotest.py +++ b/io/disk/fiotest.py @@ -60,7 +60,6 @@ def setUp(self): self.sourcedir = os.path.join(self.teststmpdir, "fio") build.make(self.sourcedir) - pkg_list = ['libaio', 'libaio-devel'] smm = SoftwareManager() if fstype == 'btrfs': ver = int(distro.detect().version) @@ -69,8 +68,13 @@ def setUp(self): if (ver == 7 and rel >= 4) or ver > 7: self.cancel("btrfs is not supported with \ RHEL 7.4 onwards") - if distro.detect().name == 'Ubuntu': - pkg_list.append('btrfs-tools') + + 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): diff --git a/io/disk/lvsetup.py b/io/disk/lvsetup.py index 157e5823d..2b9b1bdef 100755 --- a/io/disk/lvsetup.py +++ b/io/disk/lvsetup.py @@ -48,14 +48,14 @@ def setUp(self): """ Check existence of input PV,VG, LV and snapshots prior to Test. """ - pkg = "" + pkgs = [""] smm = SoftwareManager() self.disk = self.params.get('lv_disks', default=None) self.vg_name = self.params.get('vg_name', default='avocado_vg') self.lv_name = self.params.get('lv_name', default='avocado_lv') self.fs_name = self.params.get('fs', default='ext4').lower() if self.fs_name == 'xfs': - pkg = 'xfsprogs' + pkgs = ['xfsprogs'] if self.fs_name == 'btrfs': ver = int(distro.detect().version) rel = int(distro.detect().release) @@ -63,11 +63,15 @@ def setUp(self): if (ver == 7 and rel >= 4) or ver > 7: self.cancel("btrfs is not supported with RHEL 7.4 onwards") if distro.detect().name == 'SuSE': - pkg = 'btrfsprogs' + pkgs = ['btrfsprogs'] else: - pkg = 'btrfs-progs' - if pkg and not smm.check_installed(pkg) and not smm.install(pkg): - self.cancel("Package %s could not be installed" % pkg) + pkgs = ['btrfs-progs'] + if distro.detect().name in ['Ubuntu', 'debian']: + pkgs.extend(['lvm2']) + + for pkg in pkgs: + if pkg and not smm.check_installed(pkg) and not smm.install(pkg): + self.cancel("Package %s could not be installed" % pkg) self.lv_snap_name = self.params.get( 'lv_snapshot_name', default='avocado_sn') diff --git a/perf/perfmon.py b/perf/perfmon.py index aba53e378..6d3826ab4 100644 --- a/perf/perfmon.py +++ b/perf/perfmon.py @@ -19,7 +19,7 @@ from avocado import Test from avocado import main -from avocado.utils import process, build, git +from avocado.utils import process, build, git, distro from avocado.utils.software_manager import SoftwareManager @@ -34,8 +34,13 @@ def setUp(self): # Check for basic utilities smm = SoftwareManager() + dist = distro.detect() - for package in ("gcc", "make"): + deps = ["gcc", "make"] + if dist.name in ['Ubuntu', 'debian']: + deps.extend(['libncurses-dev']) + + 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)