From 74f107d662e316810e6f3fba3994439c43ec47ea Mon Sep 17 00:00:00 2001 From: Sachin Sant Date: Wed, 20 Mar 2024 12:12:45 +0530 Subject: [PATCH 1/4] fs/xfstests: Add inih devel dependency for xfsprog Using upstream as a target to compile xfsprogs code, following failure is encountered: Command 'make' failed.\nstdout: b"libtoolize -c -i -f\nlibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.\nlibtoolize: copying file './config.guess'\nlibtoolize: copying file './config.sub'\nlibtoolize: copying file './install-sh'\nlibtoolize: ... (5.46 s) Add inih-devel package as dependency so that this package will be installed. Signed-off-by: Sachin Sant --- fs/xfstests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfstests.py b/fs/xfstests.py index e6de6756d..5e6652def 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -182,6 +182,9 @@ def __setUp_packages(self): 'e2fsprogs-devel', 'asciidoc', 'xmlto', 'libzstd-devel', 'systemd-devel', 'meson', 'gcc-c++']) + if self.detected_distro.name == 'rhel' and ( + self.detected_distro.version.startswith('9')): + packages.extend(['inih-devel']) if self.detected_distro.name == 'SuSE': packages.extend(['libbtrfs-devel', 'libcap-progs', From 8948eff2c9a393d20ace0d56457009a05bb8a1ce Mon Sep 17 00:00:00 2001 From: Sachin Sant Date: Wed, 20 Mar 2024 12:22:41 +0530 Subject: [PATCH 2/4] fs/xfstests: Move local.config copy operation With upstream as a target, xfstest test fails to copy local.config (1/1) fs/xfstests.py:Xfstests.test;run-disk_type-fs_type-fs_xfs_4k-run_type-upstream-8eea: ERROR: stat: path should be string, bytes, os.PathLike or integer, not NoneType (23.60 s) This happens since teststmpdir directory is changed during compilation of upstream code (various progs). Move the stub before the upstream as a target check stanza to avoid this failure. Signed-off-by: Sachin Sant --- fs/xfstests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfstests.py b/fs/xfstests.py index 5e6652def..6c7a0311e 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -246,6 +246,9 @@ def setUp(self): if os.path.exists(f"{self.teststmpdir}/results"): shutil.rmtree(f"{self.teststmpdir}/results") + shutil.copyfile(self.get_data('local.config'), + os.path.join(self.teststmpdir, 'local.config')) + self.devices = [] self.part = None @@ -351,9 +354,6 @@ def setUp(self): if self.fs_to_test == "btrfs": self.num_loop_dev = 5 - shutil.copyfile(self.get_data('local.config'), - os.path.join(self.teststmpdir, 'local.config')) - if self.dev_type == 'loop': loop_size = self.params.get('loop_size', default='7GiB') if not self.base_disk: From 144455c7e09116e848ca3330f3da1f2aac1593f2 Mon Sep 17 00:00:00 2001 From: Sachin Sant Date: Wed, 27 Mar 2024 19:51:11 +0530 Subject: [PATCH 3/4] fs/xfstests: Move package installation after variable initialization In case a certain package install operation fails, the test fails with a completely different message ERROR: 'Xfstests' object has no attribute 'scratch_mnt' (15.37 s) The package install function is called before various variable initialization. In case of install fail, test errors out due to usage of uniniitalized variables in teardown. Move the package install function call post variable initialization Signed-off-by: Sachin Sant --- fs/xfstests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/xfstests.py b/fs/xfstests.py index 6c7a0311e..324c7ee2b 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -221,9 +221,6 @@ def setUp(self): self.use_dd = True self.dev_type = self.params.get('type', default='loop') - - self.__setUp_packages() - self.logflag = self.params.get('logdev', default=False) self.fs_to_test = self.params.get('fs', default='ext4') self.args = self.params.get('args', default='-g quick') @@ -252,6 +249,8 @@ def setUp(self): self.devices = [] self.part = None + self.__setUp_packages() + if self.run_type == 'upstream': prefix = "/usr/local" bin_prefix = "/usr/local/bin" From 3fc8e18d30aa939eccbec6021b3a1bfdafa7414a Mon Sep 17 00:00:00 2001 From: Sachin Sant Date: Wed, 27 Mar 2024 20:03:16 +0530 Subject: [PATCH 4/4] fs/xfstests: Update package dependency On SUSE some of the packages used by xfstest script are available with a different name. Update the __setUp_packages function accordingly to use the correct package names. Signed-off-by: Sachin Sant --- fs/xfstests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/xfstests.py b/fs/xfstests.py index 324c7ee2b..e08b33c69 100644 --- a/fs/xfstests.py +++ b/fs/xfstests.py @@ -177,20 +177,21 @@ def __setUp_packages(self): packages.extend(['acl', 'bc', 'indent', 'libtool', 'lvm2', 'xfsdump', 'psmisc', 'sed', 'libacl-devel', 'libattr-devel', 'libaio-devel', 'libuuid-devel', - 'openssl-devel', 'xfsprogs-devel', 'gettext', 'libblkid-devel', 'lzo-devel', 'zlib-devel', 'e2fsprogs-devel', 'asciidoc', 'xmlto', 'libzstd-devel', 'systemd-devel', 'meson', - 'gcc-c++']) + 'xfsprogs-devel', 'gcc-c++']) if self.detected_distro.name == 'rhel' and ( self.detected_distro.version.startswith('9')): packages.extend(['inih-devel']) if self.detected_distro.name == 'SuSE': packages.extend(['libbtrfs-devel', 'libcap-progs', - 'liburcu-devel', 'libinih-devel']) + 'liburcu-devel', 'libinih-devel', + 'libopenssl-devel', 'gettext-tools']) else: - packages.extend(['btrfs-progs-devel', 'userspace-rcu-devel']) + packages.extend(['btrfs-progs-devel', 'userspace-rcu-devel' + 'openssl-devel', 'gettext']) packages_remove = ['indent', 'btrfs-progs-devel'] if self.detected_distro.name == 'rhel' and (