From ea1198acb19aa729eccc9e4e9557313a47ad3cb2 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:17:48 +0100 Subject: [PATCH 01/27] tests: Remove leftover pdb.set_trace() debugger breakpoint Remove forgotten debugger breakpoint in _setup_lvm() that would halt test execution and hang CI pipelines when LV creation fails. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/fs_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/fs_tests/fs_test.py b/tests/fs_tests/fs_test.py index 2a8b8b5d6..97e76d305 100644 --- a/tests/fs_tests/fs_test.py +++ b/tests/fs_tests/fs_test.py @@ -175,7 +175,6 @@ def _setup_lvm(self, vgname, lvname, lvsize="50M"): ret, _out, err = utils.run_command("lvcreate -n %s -L%s %s --config \"devices {use_devicesfile = 0}\"" % (lvname, lvsize, vgname)) if ret != 0: - import pdb; pdb.set_trace() raise RuntimeError("Failed to create LV for fs tests: %s" % err) return "/dev/%s/%s" % (vgname, lvname) From 74397e6c22d0d197519fb78e2343e2005f8b68de Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:21:03 +0100 Subject: [PATCH 02/27] tests: Fix swapped return values in _print_skip_message _split_test_id returns (test_name, test_module) but _print_skip_message was unpacking them in the wrong order, swapping test name and module in all skip messages. Co-Authored-By: Claude Opus 4.6 --- tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 3694c8033..782cfda5d 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -203,7 +203,7 @@ def _split_test_id(test_id): def _print_skip_message(test, skip_tags, missing): test_id = test.id() - test_module, test_name = _split_test_id(test_id) + test_name, test_module = _split_test_id(test_id) if missing: reason = 'skipping test because it is not tagged as one of: ' + ', '.join((t.value for t in skip_tags)) From 6e5f9537ba375fbd51f83fea0a7ff24d8093b653 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:21:38 +0100 Subject: [PATCH 03/27] tests: Fix LvmTestLVcreateType classes inheriting wrong base class LvmCLITestLVcreateType and LvmDBusTestLVcreateType inherited from LvmPVVGLVTestCase (setup/teardown only) instead of LvmTestLVcreateType (which contains the actual test_lvcreate_type method). This meant the tests for creating striped, mirrored, and raid1 LVs were never executed. Co-Authored-By: Claude Opus 4.6 --- tests/lvm_dbus_tests.py | 4 ++-- tests/lvm_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py index 1cf98ec90..4c43c9cf1 100644 --- a/tests/lvm_dbus_tests.py +++ b/tests/lvm_dbus_tests.py @@ -129,10 +129,10 @@ def setUpClass(cls): LvmDBusTestCase.setUpClass() -class LvmDBusTestLVcreateType(_lvm_cases.LvmPVVGLVTestCase, LvmDBusTestCase): +class LvmDBusTestLVcreateType(_lvm_cases.LvmTestLVcreateType, LvmDBusTestCase): @classmethod def setUpClass(cls): - _lvm_cases.LvmPVVGLVTestCase.setUpClass() + _lvm_cases.LvmTestLVcreateType.setUpClass() LvmDBusTestCase.setUpClass() diff --git a/tests/lvm_test.py b/tests/lvm_test.py index bce1ffd5f..f59fa4f70 100644 --- a/tests/lvm_test.py +++ b/tests/lvm_test.py @@ -104,10 +104,10 @@ def setUpClass(cls): LvmTestCase.setUpClass() -class LvmCLITestLVcreateType(_lvm_cases.LvmPVVGLVTestCase, LvmTestCase): +class LvmCLITestLVcreateType(_lvm_cases.LvmTestLVcreateType, LvmTestCase): @classmethod def setUpClass(cls): - _lvm_cases.LvmPVVGLVTestCase.setUpClass() + _lvm_cases.LvmTestLVcreateType.setUpClass() LvmTestCase.setUpClass() From eb0db7614c6fa167d0e39bfdd46e14612437b1cf Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:23:41 +0100 Subject: [PATCH 04/27] tests: Fix wrong variable in _get_lio_dev_path retry call The recursive retry call passed store_wwn as the third argument instead of store_name. On retry failure, _delete_target would be called with the wrong identifier, failing to clean up the backstore properly. Co-Authored-By: Claude Opus 4.6 --- tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index 3cdd0c6d5..f07fad2a3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -151,7 +151,7 @@ def _get_lio_dev_path(store_wwn, tgt_wwn, store_name, retry=True): if retry: time.sleep(3) os.system("udevadm settle") - return _get_lio_dev_path(store_wwn, tgt_wwn, store_wwn, False) + return _get_lio_dev_path(store_wwn, tgt_wwn, store_name, False) else: _delete_target(tgt_wwn, store_name) raise RuntimeError("Failed to identify the resulting device for '%s'" % store_name) From 0f73e72276cb2541322aa2e8c5f0bee059882078 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:24:56 +0100 Subject: [PATCH 05/27] tests: Fix _clean_up iterating range(num_devices) instead of actual list If setUp fails partway through, loop_devs/dev_files have fewer entries than num_devices, causing IndexError in cleanup. This aborts cleanup early, leaking loop devices and temp files. Iterate over the actual lists instead. Co-Authored-By: Claude Opus 4.6 --- tests/crypto_test.py | 8 +++++--- tests/fs_tests/fs_test.py | 8 +++++--- tests/mdraid_test.py | 12 +++++++----- tests/part_test.py | 8 +++++--- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 0c9eba765..3ead29afd 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -80,13 +80,15 @@ def _clean_up(self): except: pass - for i in range(self._num_devices): + for dev in self.loop_devs: try: - delete_lio_device(self.loop_devs[i]) + delete_lio_device(dev) except RuntimeError: # just move on, we can do no better here pass - os.unlink(self.dev_files[i]) + + for dev_file in self.dev_files: + os.unlink(dev_file) os.unlink(self.keyfile) diff --git a/tests/fs_tests/fs_test.py b/tests/fs_tests/fs_test.py index 97e76d305..0e7bd42f3 100644 --- a/tests/fs_tests/fs_test.py +++ b/tests/fs_tests/fs_test.py @@ -131,13 +131,15 @@ def _clean_up(self): except: pass - for i in range(self.num_devices): + for dev in self.loop_devs: try: - utils.delete_lio_device(self.loop_devs[i]) + utils.delete_lio_device(dev) except RuntimeError: # just move on, we can do no better here pass - os.unlink(self.dev_files[i]) + + for dev_file in self.dev_files: + os.unlink(dev_file) self.dev_files.clear() self.loop_devs.clear() diff --git a/tests/mdraid_test.py b/tests/mdraid_test.py index ca5794ac2..a00ebccd9 100644 --- a/tests/mdraid_test.py +++ b/tests/mdraid_test.py @@ -121,9 +121,9 @@ def _clean_up(self): except: pass - for i in range(self._num_devices): + for dev in self.loop_devs: try: - BlockDev.md_destroy(self.loop_devs[i]) + BlockDev.md_destroy(dev) except: pass @@ -136,13 +136,15 @@ def _clean_up(self): except: pass - for i in range(self._num_devices): + for dev in self.loop_devs: try: - delete_lio_device(self.loop_devs[i]) + delete_lio_device(dev) except RuntimeError: # just move on, we can do no better here pass - os.unlink(self.dev_files[i]) + + for dev_file in self.dev_files: + os.unlink(dev_file) self.dev_files.clear() self.loop_devs.clear() diff --git a/tests/part_test.py b/tests/part_test.py index 8f3ad5eae..f87a0a678 100644 --- a/tests/part_test.py +++ b/tests/part_test.py @@ -55,13 +55,15 @@ def setUp(self): raise RuntimeError("Failed to setup loop device for testing: %s" % e) def _clean_up(self): - for i in range(self._num_devices): + for dev in self.loop_devs: try: - delete_lio_device(self.loop_devs[i]) + delete_lio_device(dev) except RuntimeError: # just move on, we can do no better here pass - os.unlink(self.dev_files[i]) + + for dev_file in self.dev_files: + os.unlink(dev_file) self.dev_files.clear() self.loop_devs.clear() From 06ca19004c1ef3f08b3729abc3a2eb88bb66a62e Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:26:17 +0100 Subject: [PATCH 06/27] tests: Fix hardcoded ext4_get_info in parameterized _test_ext_get_info The mounted-filesystem code path hardcoded BlockDev.fs_ext4_get_info() instead of using the info_function parameter. When called for ext2 or ext3 tests, this called the wrong function. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/ext_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fs_tests/ext_test.py b/tests/fs_tests/ext_test.py index b0195ece2..b3e825ace 100644 --- a/tests/fs_tests/ext_test.py +++ b/tests/fs_tests/ext_test.py @@ -251,7 +251,7 @@ def _test_ext_get_info(self, mkfs_function, info_function): self.assertTrue(fi.state, "clean") with mounted(self.loop_devs[0], self.mount_dir): - fi = BlockDev.fs_ext4_get_info(self.loop_devs[0]) + fi = info_function(self.loop_devs[0]) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, self.loop_size / 1024) # at least 50 % should be available, so it should be reported From 21951d96858ccfc3cd5230e38fd90ee8524fb14b Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:27:53 +0100 Subject: [PATCH 07/27] tests: Fix duplicate ONLINE_GROW assertion in BtrfsTestFeatures Both lines tested ONLINE_GROW. Btrfs supports ONLINE_GROW and ONLINE_SHRINK (not OFFLINE_GROW), so the duplicate should test ONLINE_SHRINK which was never verified. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/btrfs_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fs_tests/btrfs_test.py b/tests/fs_tests/btrfs_test.py index d98b1404c..2f621279e 100644 --- a/tests/fs_tests/btrfs_test.py +++ b/tests/fs_tests/btrfs_test.py @@ -37,7 +37,7 @@ def test_btrfs_features(self): self.assertIsNotNone(features) self.assertTrue(features.resize & BlockDev.FSResizeFlags.ONLINE_GROW) - self.assertTrue(features.resize & BlockDev.FSResizeFlags.ONLINE_GROW) + self.assertTrue(features.resize & BlockDev.FSResizeFlags.ONLINE_SHRINK) self.assertTrue(features.mkfs & BlockDev.FSMkfsOptionsFlags.LABEL) self.assertTrue(features.mkfs & BlockDev.FSMkfsOptionsFlags.UUID) From 6a648f3967a4a62434a660bcad986ad4a866d32e Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:31:38 +0100 Subject: [PATCH 08/27] tests: Replace deprecated locale.getdefaultlocale() locale.getdefaultlocale() is deprecated since Python 3.11 and removed in Python 3.15. Use locale.setlocale(locale.LC_ALL) to get the current locale setting instead. Co-Authored-By: Claude Opus 4.6 --- tests/crypto_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 3ead29afd..7369f608f 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -624,7 +624,7 @@ class CryptoTestErrorLocale(CryptoTestCase): def setUp(self): self._orig_loc = None CryptoTestCase.setUp(self) - self._orig_loc = ".".join(locale.getdefaultlocale()) + self._orig_loc = locale.setlocale(locale.LC_ALL) def _clean_up(self): CryptoTestCase._clean_up(self) From fe1e43a4929ffe415e050e0d73662db0135a0501 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:32:21 +0100 Subject: [PATCH 09/27] tests: Fix incorrect locale string format in test_non_en_init "cs.CZ_UTF-8" is not a valid POSIX locale format. The correct format is "cs_CZ.UTF-8" (language_TERRITORY.encoding). Co-Authored-By: Claude Opus 4.6 --- tests/library_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/library_test.py b/tests/library_test.py index c12967985..b6def0f03 100644 --- a/tests/library_test.py +++ b/tests/library_test.py @@ -169,7 +169,7 @@ def test_non_en_init(self): """Verify that the library initializes with lang different from en_US""" orig_lang = os.environ.get("LANG") - os.environ["LANG"] = "cs.CZ_UTF-8" + os.environ["LANG"] = "cs_CZ.UTF-8" self.assertTrue(BlockDev.reinit(self.requested_plugins, True, None)) if orig_lang: os.environ["LANG"] = orig_lang From be4e4c6c181bff33bd4cd660659c2e7333ef9df8 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:32:51 +0100 Subject: [PATCH 10/27] tests: Fix unescaped dot in regex for targetcli output The trailing '.' in r'Created target (.*).' matches any character. Due to greedy matching the captured target WWN could be truncated by one character. Escape as '\.' to match a literal period. Co-Authored-By: Claude Opus 4.6 --- tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index f07fad2a3..49d4123a3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -200,7 +200,7 @@ def create_lio_device(fpath, block_size=0): # create a new loopback device out = subprocess.check_output(["targetcli", "/loopback create"]) out = out.decode("utf-8") - match = re.match(r'Created target (.*).', out) + match = re.match(r'Created target (.*)\.', out) if match: tgt_wwn = match.groups()[0] else: From 18f4231e12dbdf843cf04369ecb9a3e2aea32b65 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:35:52 +0100 Subject: [PATCH 11/27] tests: Rename test_vgtags to test_lvtags in LvmTestLVs The method tests LV tags (lvm_add_lv_tags/lvm_delete_lv_tags) but was named test_vgtags, which is misleading in test reports. Co-Authored-By: Claude Opus 4.6 --- tests/_lvm_cases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_lvm_cases.py b/tests/_lvm_cases.py index 770d37ff8..87a09fc03 100644 --- a/tests/_lvm_cases.py +++ b/tests/_lvm_cases.py @@ -1347,7 +1347,7 @@ def test_thinpool_cache_get_stats(self): self.assertEqual(stats.md_size, 8 * 1024**2) self.assertEqual(stats.mode, BlockDev.LVMCacheMode.WRITETHROUGH) - def test_vgtags(self): + def test_lvtags(self): """Verify that it's possible to set and get info about LV tags""" succ = BlockDev.lvm_pvcreate(self.loop_dev, 0, 0, None) From 52beb6ef81b3815fa3c09cf446bc2af7659c9432 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:36:53 +0100 Subject: [PATCH 12/27] tests: Fix assertGreater to assertGreaterEqual in test_lvs_all The comment says "at least 3 LVs" but assertGreater requires strictly more than 3. Use assertGreaterEqual to match the intended check. Co-Authored-By: Claude Opus 4.6 --- tests/_lvm_cases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_lvm_cases.py b/tests/_lvm_cases.py index 87a09fc03..a8733054b 100644 --- a/tests/_lvm_cases.py +++ b/tests/_lvm_cases.py @@ -1618,7 +1618,7 @@ def test_lvs_all(self): # there should be at least 3 LVs -- testPool, [testPool_tdata], [testPool_tmeta] (plus probably some spare LVs) lvs = BlockDev.lvm_lvs("testVG") - self.assertGreater(len(lvs), 3) + self.assertGreaterEqual(len(lvs), 3) @tag_test(TestTags.CORE) def test_thpoolcreate(self): From 111d76a21e281813aceb147539acc16de78aa5f4 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:38:09 +0100 Subject: [PATCH 13/27] tests: Fix copy-paste method name test_vfat_features in NILFS2TestFeatures The method was named test_vfat_features (copied from vfat_test.py) but is inside NILFS2TestFeatures and tests nilfs2 features. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/nilfs_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fs_tests/nilfs_test.py b/tests/fs_tests/nilfs_test.py index eaac6a300..ed2afaf11 100644 --- a/tests/fs_tests/nilfs_test.py +++ b/tests/fs_tests/nilfs_test.py @@ -68,7 +68,7 @@ def test_nilfs2_available(self): class NILFS2TestFeatures(NILFS2NoDevTestCase): - def test_vfat_features(self): + def test_nilfs2_features(self): features = BlockDev.fs_features("nilfs2") self.assertIsNotNone(features) From ed44eec526fe943afd4b85dcd79a6983770d771a Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:41:39 +0100 Subject: [PATCH 14/27] tests: Use integer division where values are passed to C functions Float division (/) produces float values that are passed to C functions expecting integer (guint64) parameters. Use integer division (//) instead. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/f2fs_test.py | 10 +++++----- tests/fs_tests/xfs_test.py | 4 ++-- tests/swap_test.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/fs_tests/f2fs_test.py b/tests/fs_tests/f2fs_test.py index b09eceeb3..2d6f328bb 100644 --- a/tests/fs_tests/f2fs_test.py +++ b/tests/fs_tests/f2fs_test.py @@ -238,15 +238,15 @@ def test_f2fs_resize(self): # shrink without the safe option -- should fail with self.assertRaises(GLib.GError): - BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 / 512, False) + BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 // 512, False) # if we can't shrink we'll just check it returns some sane error if not _can_resize_f2fs(): with self.assertRaisesRegex(GLib.GError, "Too low version of resize.f2fs. At least 1.12.0 required."): - BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 / 512, True) + BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 // 512, True) return - succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 / 512, True) + succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 // 512, True) self.assertTrue(succ) fi = BlockDev.fs_f2fs_get_info(self.loop_devs[0]) @@ -258,14 +258,14 @@ def test_f2fs_resize(self): self.assertEqual(fi.sector_count * fi.sector_size, 100 * 1024**2) # grow - succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 120 * 1024**2 / 512, True) + succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 120 * 1024**2 // 512, True) self.assertTrue(succ) fi = BlockDev.fs_f2fs_get_info(self.loop_devs[0]) self.assertEqual(fi.sector_count * fi.sector_size, 120 * 1024**2) # shrink again - succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 / 512, True) + succ = BlockDev.fs_f2fs_resize(self.loop_devs[0], 100 * 1024**2 // 512, True) self.assertTrue(succ) fi = BlockDev.fs_f2fs_get_info(self.loop_devs[0]) diff --git a/tests/fs_tests/xfs_test.py b/tests/fs_tests/xfs_test.py index 7a8e97c95..13a4a8f28 100644 --- a/tests/fs_tests/xfs_test.py +++ b/tests/fs_tests/xfs_test.py @@ -252,7 +252,7 @@ def test_xfs_resize(self): if xfs_version < Version("5.12"): with mounted(lv, self.mount_dir): with self.assertRaises(GLib.GError): - succ = BlockDev.fs_xfs_resize(self.mount_dir, 40 * 1024**2 / fi.block_size, None) + succ = BlockDev.fs_xfs_resize(self.mount_dir, 40 * 1024**2 // fi.block_size, None) self._lvresize("libbd_fs_tests", "xfs_test", "400M") # should grow to 400 MiB (full size of the LV) @@ -267,7 +267,7 @@ def test_xfs_resize(self): self._lvresize("libbd_fs_tests", "xfs_test", "450M") # grow just to 430 MiB with mounted(lv, self.mount_dir): - succ = BlockDev.fs_xfs_resize(self.mount_dir, 430 * 1024**2 / fi.block_size, None) + succ = BlockDev.fs_xfs_resize(self.mount_dir, 430 * 1024**2 // fi.block_size, None) self.assertTrue(succ) with mounted(lv, self.mount_dir): fi = BlockDev.fs_xfs_get_info(lv) diff --git a/tests/swap_test.py b/tests/swap_test.py index c59f64bb1..c10faf1c1 100644 --- a/tests/swap_test.py +++ b/tests/swap_test.py @@ -149,7 +149,7 @@ def test_swapon_wrong_size(self): """Verify that activating swap with a wrong size fails with expected exception""" # create swap bigger than the device (twice as big in 1024 sectors) - ret, out, err = run_command("mkswap -f %s %d" % (self.loop_dev, (self.dev_size * 2) / 1024)) + ret, out, err = run_command("mkswap -f %s %d" % (self.loop_dev, (self.dev_size * 2) // 1024)) if ret != 0: self.fail("Failed to prepare swap for wrong size test: %s %s" % (out, err)) From 2917e199f32d605986a0c657ca2d87187c526013 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 14:59:08 +0100 Subject: [PATCH 15/27] tests: Check exFAT availability before creating LIO devices Move the skipTest check before super().setUp() to avoid needlessly creating LIO devices for tests that will be skipped anyway. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/exfat_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fs_tests/exfat_test.py b/tests/fs_tests/exfat_test.py index cc8f5c6ac..6df5dcba1 100644 --- a/tests/fs_tests/exfat_test.py +++ b/tests/fs_tests/exfat_test.py @@ -19,11 +19,11 @@ def setUp(self): class ExfatTestCase(FSTestCase): def setUp(self): - super(ExfatTestCase, self).setUp() - if not self.exfat_avail: self.skipTest("skipping exFAT: not available") + super(ExfatTestCase, self).setUp() + self.mount_dir = tempfile.mkdtemp(prefix="libblockdev.", suffix="exfat_test") From 7dae0cef9c2ca27c8475711397a929b4b54821a2 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:01:06 +0100 Subject: [PATCH 16/27] tests: Fix wrong variable in partition start calculation ps5.start + ps4.size should be ps5.start + ps5.size when calculating the start of ps6. This worked by coincidence because ps4 and ps5 are the same size (10 MiB). Co-Authored-By: Claude Opus 4.6 --- tests/part_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/part_test.py b/tests/part_test.py index f87a0a678..9f52f22f3 100644 --- a/tests/part_test.py +++ b/tests/part_test.py @@ -689,7 +689,7 @@ def test_create_part_next_gpt(self): self.assertEqual(ps5.size, 10 * 1024**2) # we should get just next primary partition (GPT) - ps6 = BlockDev.part_create_part (self.loop_devs[0], BlockDev.PartTypeReq.NEXT, ps5.start + ps4.size + 1, + ps6 = BlockDev.part_create_part (self.loop_devs[0], BlockDev.PartTypeReq.NEXT, ps5.start + ps5.size + 1, 10 * 1024**2, BlockDev.PartAlign.OPTIMAL) self.assertTrue(ps6) self.assertEqual(ps6.path, self.loop_devs[0] + "6") From 28029b99158ee20e1f44fb2727d49954c4c1f306 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:01:46 +0100 Subject: [PATCH 17/27] tests: Fix copy-paste sparse file name "crypto_test" in fs_test.py The sparse temp file was named "crypto_test" (copy-pasted from crypto_test.py). Rename to "fs_test" to match the actual test module. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/fs_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fs_tests/fs_test.py b/tests/fs_tests/fs_test.py index 0e7bd42f3..e49873f0c 100644 --- a/tests/fs_tests/fs_test.py +++ b/tests/fs_tests/fs_test.py @@ -116,7 +116,7 @@ def setUp(self): self.addCleanup(self._clean_up) for i in range(self.num_devices): - dev_file = utils.create_sparse_tempfile("crypto_test", self.loop_size) + dev_file = utils.create_sparse_tempfile("fs_test", self.loop_size) self.dev_files.append(dev_file) try: From 02d37172ae034ba7c06edb1c067cabae30e1ea1a Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:03:00 +0100 Subject: [PATCH 18/27] tests: Rename label_function parameter to uuid_function in ExtSetUUID The parameter was named label_function but always receives set_uuid functions. Rename to uuid_function to match its actual purpose. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/ext_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/fs_tests/ext_test.py b/tests/fs_tests/ext_test.py index b3e825ace..990453dbc 100644 --- a/tests/fs_tests/ext_test.py +++ b/tests/fs_tests/ext_test.py @@ -409,33 +409,33 @@ class ExtSetUUID(ExtTestCase): test_uuid = "4d7086c4-a4d3-432f-819e-73da03870df9" - def _test_ext_set_uuid(self, mkfs_function, info_function, label_function, check_function): + def _test_ext_set_uuid(self, mkfs_function, info_function, uuid_function, check_function): succ = mkfs_function(self.loop_devs[0], None) self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) - succ = label_function(self.loop_devs[0], self.test_uuid) + succ = uuid_function(self.loop_devs[0], self.test_uuid) self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) self.assertEqual(fi.uuid, self.test_uuid) - succ = label_function(self.loop_devs[0], "clear") + succ = uuid_function(self.loop_devs[0], "clear") self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) self.assertEqual(fi.uuid, "") - succ = label_function(self.loop_devs[0], "random") + succ = uuid_function(self.loop_devs[0], "random") self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) self.assertNotEqual(fi.uuid, "") random_uuid = fi.uuid - succ = label_function(self.loop_devs[0], "time") + succ = uuid_function(self.loop_devs[0], "time") self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) @@ -444,7 +444,7 @@ def _test_ext_set_uuid(self, mkfs_function, info_function, label_function, check time_uuid = fi.uuid # no UUID -> random - succ = label_function(self.loop_devs[0], None) + succ = uuid_function(self.loop_devs[0], None) self.assertTrue(succ) fi = info_function(self.loop_devs[0]) self.assertTrue(fi) @@ -461,19 +461,19 @@ def test_ext2_set_uuid(self): """Verify that it is possible to set UUID of an ext2 file system""" self._test_ext_set_uuid(mkfs_function=BlockDev.fs_ext2_mkfs, info_function=BlockDev.fs_ext2_get_info, - label_function=BlockDev.fs_ext2_set_uuid, + uuid_function=BlockDev.fs_ext2_set_uuid, check_function=BlockDev.fs_ext2_check_uuid) def test_ext3_set_uuid(self): """Verify that it is possible to set UUID of an ext3 file system""" self._test_ext_set_uuid(mkfs_function=BlockDev.fs_ext3_mkfs, info_function=BlockDev.fs_ext3_get_info, - label_function=BlockDev.fs_ext3_set_uuid, + uuid_function=BlockDev.fs_ext3_set_uuid, check_function=BlockDev.fs_ext3_check_uuid) def test_ext4_set_uuid(self): """Verify that it is possible to set UUID of an ext4 file system""" self._test_ext_set_uuid(mkfs_function=BlockDev.fs_ext4_mkfs, info_function=BlockDev.fs_ext4_get_info, - label_function=BlockDev.fs_ext4_set_uuid, + uuid_function=BlockDev.fs_ext4_set_uuid, check_function=BlockDev.fs_ext4_check_uuid) From 2bf9fd3bbf590f00fe5716256017d733017de25e Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:03:19 +0100 Subject: [PATCH 19/27] tests: Rename test_luks2_integrity to test_luks2_token_info The method tests LUKS2 token info, not integrity. The name was misleading in test reports. Co-Authored-By: Claude Opus 4.6 --- tests/crypto_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 7369f608f..5653362a6 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -1474,7 +1474,7 @@ def _verify_token_info (self, info): self.assertEqual(info[0].keyslot, 0) @tag_test(TestTags.SLOW) - def test_luks2_integrity(self): + def test_luks2_token_info(self): """Verify that we can get information about LUKS2 tokens""" # the simple case with password From d72b9f6f0442bdc7b2926e7ae0ca6e0995bc5e52 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:06:15 +0100 Subject: [PATCH 20/27] tests: Fix various comments, docstrings, and typos - part_test.py: Comment says "GPT" but code creates MSDOS table - generic_test.py: Docstring says "ext4" but tests xfs - generic_test.py: Comment says "375 MiB" but code uses 380M - generic_test.py: get_free_space docstrings say "resize" - crypto_test.py: Comment says "keyfile" but creates passphrase context - nvdimm_test.py: Comment says "skip if fake" but logic skips if NOT fake - btrfs_test.py: Typo "foundin" (missing space) Co-Authored-By: Claude Opus 4.6 --- tests/btrfs_test.py | 2 +- tests/crypto_test.py | 2 +- tests/fs_tests/generic_test.py | 20 ++++++++++---------- tests/nvdimm_test.py | 2 +- tests/part_test.py | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/btrfs_test.py b/tests/btrfs_test.py index 9fc3e6d15..da3d1f39a 100644 --- a/tests/btrfs_test.py +++ b/tests/btrfs_test.py @@ -33,7 +33,7 @@ def setUpClass(cls): raise unittest.SkipTest('Btrfs kernel module not available, skipping.') if not shutil.which("btrfs"): - raise unittest.SkipTest("btrfs executable not foundin $PATH, skipping.") + raise unittest.SkipTest("btrfs executable not found in $PATH, skipping.") if not BlockDev.is_initialized(): BlockDev.init(cls.requested_plugins, None) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 5653362a6..03a24bc73 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -232,7 +232,7 @@ def test_luks2_format(self): succ = BlockDev.crypto_luks_format(self.loop_devs[0], "aes-xts-plain64", 0, pw_ctx, 0) self.assertTrue(succ) - # create with a keyfile + # create with a passphrase context kf_ctx = BlockDev.CryptoKeyslotContext(passphrase=PASSWD) succ = BlockDev.crypto_luks_format(self.loop_devs[0], "aes-xts-plain64", 0, kf_ctx, 0) self.assertTrue(succ) diff --git a/tests/fs_tests/generic_test.py b/tests/fs_tests/generic_test.py index c08d03caa..f4ea37608 100644 --- a/tests/fs_tests/generic_test.py +++ b/tests/fs_tests/generic_test.py @@ -673,7 +673,7 @@ def test_ext4_progress_check(self): succ = BlockDev.utils_init_prog_reporting(None) def test_xfs_generic_check(self): - """Test generic check function with an ext4 file system""" + """Test generic check function with an xfs file system""" self._test_generic_check(mkfs_function=BlockDev.fs_xfs_mkfs, fstype="xfs") def test_ntfs_generic_check(self): @@ -1097,7 +1097,7 @@ def _test_xfs_generic_resize(self, mount): succ = BlockDev.fs_resize(lv, 40 * 1024**2) self._lvresize("libbd_fs_tests", "generic_test", "380M") - # should grow to 375 MiB (full size of the LV) + # should grow to 380 MiB (full size of the LV) if mount: with mounted(lv, self.mount_dir): succ = BlockDev.fs_resize(lv, 0) @@ -1304,25 +1304,25 @@ def _test_get_free_space(self, mkfs_function, fstype, size_delta=0): self.assertLessEqual(free, size) def test_ext2_get_free_space(self): - """Test generic resize function with an ext2 file system""" + """Test generic get_free_space function with an ext2 file system""" self._test_get_free_space(mkfs_function=BlockDev.fs_ext2_mkfs, fstype="ext2") def test_ext3_check_get_free_space(self): - """Test generic resize function with an ext3 file system""" + """Test generic get_free_space function with an ext3 file system""" self._test_get_free_space(mkfs_function=BlockDev.fs_ext3_mkfs, fstype="ext3") def test_ext4_get_free_space(self): - """Test generic resize function with an ext4 file system""" + """Test generic get_free_space function with an ext4 file system""" self._test_get_free_space(mkfs_function=BlockDev.fs_ext4_mkfs, fstype="ext4") def test_ntfs_get_free_space(self): - """Test generic resize function with an ntfs file system""" + """Test generic get_free_space function with an ntfs file system""" if not self.ntfs_avail: self.skipTest("skipping NTFS: not available") self._test_get_free_space(mkfs_function=BlockDev.fs_ntfs_mkfs, fstype="ntfs") def test_vfat_get_free_space(self): - """Test generic resize function with a vfat file system""" + """Test generic get_free_space function with a vfat file system""" def mkfs_vfat(device, options=None): if self._vfat_version >= Version("4.2"): if options: @@ -1335,19 +1335,19 @@ def mkfs_vfat(device, options=None): self._test_get_free_space(mkfs_function=mkfs_vfat, fstype="vfat") def test_nilfs2_get_free_space(self): - """Test generic resize function with an nilfs2 file system""" + """Test generic get_free_space function with an nilfs2 file system""" if not self.nilfs2_avail: self.skipTest("skipping NILFS2: not available") self._test_get_free_space(mkfs_function=BlockDev.fs_nilfs2_mkfs, fstype="nilfs2") def test_btrfs_get_free_space(self): - """Test generic resize function with an btrfs file system""" + """Test generic get_free_space function with a btrfs file system""" if not self.btrfs_avail: self.skipTest("skipping Btrfs: not available") self._test_get_free_space(mkfs_function=BlockDev.fs_btrfs_mkfs, fstype="btrfs") def test_udf_get_free_space(self): - """Test generic resize function with an udf file system""" + """Test generic get_free_space function with a udf file system""" if not self.udf_avail: self.skipTest("skipping UDF: not available") diff --git a/tests/nvdimm_test.py b/tests/nvdimm_test.py index 281ca8336..93f4ce879 100644 --- a/tests/nvdimm_test.py +++ b/tests/nvdimm_test.py @@ -63,7 +63,7 @@ def setUp(self): # get the dict for the first nvdimm device self.sys_info = self.sys_info[0] - # skip the tests if the nvdimm is a 'fake' one + # skip the tests if the nvdimm is not a 'fake' one cmdline = read_file("/proc/cmdline") if "memmap=" not in cmdline: self.skipTest("NVDIMM device found, but not created by the 'memmap' kernel command-line option.") diff --git a/tests/part_test.py b/tests/part_test.py index 9f52f22f3..ef99a13fa 100644 --- a/tests/part_test.py +++ b/tests/part_test.py @@ -762,7 +762,7 @@ def test_get_disk_free_regions(self): self.assertGreaterEqual(fi.start, 80 * 1024**2) self.assertGreaterEqual(fi.size, 19 * 1024**2) - # now something simple with GPT + # now something simple with MSDOS succ = BlockDev.part_create_table (self.loop_devs[0], BlockDev.PartTableType.MSDOS, True) self.assertTrue(succ) From ad312cff4cca9869dc438f9eaf866a2f63527c09 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:07:52 +0100 Subject: [PATCH 21/27] tests: Remove unused imports Remove unused TestTags/tag_test imports from vfat_test.py, exfat_test.py, ntfs_test.py, nilfs_test.py, udf_test.py, and unused fake_path import from library_test.py. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/exfat_test.py | 1 - tests/fs_tests/nilfs_test.py | 1 - tests/fs_tests/ntfs_test.py | 1 - tests/fs_tests/udf_test.py | 1 - tests/fs_tests/vfat_test.py | 1 - tests/library_test.py | 2 +- 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/fs_tests/exfat_test.py b/tests/fs_tests/exfat_test.py index 6df5dcba1..48a9db481 100644 --- a/tests/fs_tests/exfat_test.py +++ b/tests/fs_tests/exfat_test.py @@ -4,7 +4,6 @@ import overrides_hack import utils -from utils import TestTags, tag_test from gi.repository import BlockDev, GLib diff --git a/tests/fs_tests/nilfs_test.py b/tests/fs_tests/nilfs_test.py index ed2afaf11..d73f5e238 100644 --- a/tests/fs_tests/nilfs_test.py +++ b/tests/fs_tests/nilfs_test.py @@ -4,7 +4,6 @@ import overrides_hack import utils -from utils import TestTags, tag_test from gi.repository import BlockDev, GLib diff --git a/tests/fs_tests/ntfs_test.py b/tests/fs_tests/ntfs_test.py index 55234bff2..fd3b74f85 100644 --- a/tests/fs_tests/ntfs_test.py +++ b/tests/fs_tests/ntfs_test.py @@ -4,7 +4,6 @@ from .fs_test import FSTestCase, FSNoDevTestCase, mounted import utils -from utils import TestTags, tag_test from gi.repository import BlockDev, GLib diff --git a/tests/fs_tests/udf_test.py b/tests/fs_tests/udf_test.py index 0a2109f7e..f449ec173 100644 --- a/tests/fs_tests/udf_test.py +++ b/tests/fs_tests/udf_test.py @@ -4,7 +4,6 @@ import overrides_hack import utils -from utils import TestTags, tag_test from gi.repository import BlockDev, GLib diff --git a/tests/fs_tests/vfat_test.py b/tests/fs_tests/vfat_test.py index 744c12d68..ea093b94f 100644 --- a/tests/fs_tests/vfat_test.py +++ b/tests/fs_tests/vfat_test.py @@ -7,7 +7,6 @@ import overrides_hack import utils -from utils import TestTags, tag_test from gi.repository import BlockDev, GLib diff --git a/tests/library_test.py b/tests/library_test.py index b6def0f03..6fd68035c 100644 --- a/tests/library_test.py +++ b/tests/library_test.py @@ -2,7 +2,7 @@ import unittest import re import overrides_hack -from utils import fake_path, TestTags, tag_test, required_plugins +from utils import TestTags, tag_test, required_plugins import gi gi.require_version('GLib', '2.0') From 30ec700f5d8178fa9a200be51d27cac3fff49f6f Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:08:16 +0100 Subject: [PATCH 22/27] tests: Fix cleanup using device name without /dev/ prefix in mount_test The addCleanup call used 'dev' (basename like "loop0") instead of 'loop_dev' ("/dev/loop0") for the umount cleanup. Co-Authored-By: Claude Opus 4.6 --- tests/fs_tests/mount_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fs_tests/mount_test.py b/tests/fs_tests/mount_test.py index a72f7148d..478b83469 100644 --- a/tests/fs_tests/mount_test.py +++ b/tests/fs_tests/mount_test.py @@ -120,7 +120,7 @@ def test_mount_ro_device(self): loop_dev = "/dev/" + dev # without any options, the mount should fall back to RO self.assertTrue(BlockDev.fs_mount(loop_dev, tmp_dir, None, None, None)) - self.addCleanup(utils.umount, dev) + self.addCleanup(utils.umount, loop_dev) self.assertTrue(os.path.ismount(tmp_dir)) succ = BlockDev.fs_unmount(tmp_dir, False, False, None) From aa2f471cc7d21dcc965ab23165d1150014d3676d Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:08:35 +0100 Subject: [PATCH 23/27] tests: Use created LIO device instead of hardcoded /dev/loop0 in mpath test test_is_mpath_member used hardcoded /dev/loop0 instead of the LIO device created in setUp (self.loop_dev). Co-Authored-By: Claude Opus 4.6 --- tests/mpath_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mpath_test.py b/tests/mpath_test.py index b9db34b4c..91147f7d8 100644 --- a/tests/mpath_test.py +++ b/tests/mpath_test.py @@ -46,7 +46,7 @@ def test_is_mpath_member(self): # just test that some non-mpath is not reported as a multipath member # device and no error is reported - self.assertFalse(BlockDev.mpath_is_mpath_member("/dev/loop0")) + self.assertFalse(BlockDev.mpath_is_mpath_member(self.loop_dev)) def test_flush_mpaths(self): """ Verify that mpath_flush_mpaths can be called """ From 5a81baf9c19199f1e92dc0151c1b863adc60753e Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:09:06 +0100 Subject: [PATCH 24/27] tests: Rename local variable that shadows imported json module Local variable 'json' in setup_nvme_target shadows the imported json module. Rename to 'json_str'. Co-Authored-By: Claude Opus 4.6 --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 49d4123a3..847415fca 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -453,7 +453,7 @@ def setup_nvme_target(dev_paths, subnqn): }} """.format(nguid=uuid.uuid4(), path=dev_path, nsid=i) for i, dev_path in enumerate(dev_paths, start=1)]) - json = """ + json_str = """ { "ports": [ { @@ -484,7 +484,7 @@ def setup_nvme_target(dev_paths, subnqn): ] } """ - tmp.write(json % (subnqn, namespaces, subnqn)) + tmp.write(json_str % (subnqn, namespaces, subnqn)) # export the loop device on the target ret, out, err = run_command("nvmetcli restore %s" % tcli_json_file) From 3ea69654ad29a2cff9b5b9177aaaa8d2856efa71 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:09:30 +0100 Subject: [PATCH 25/27] tests: Remove stale assertTrue(succ) after assertRaisesRegex block The assertTrue(succ) after the assertRaisesRegex block was testing a 'succ' value from a previous statement, not from the expected-to-fail call. Remove the dead assertion. Co-Authored-By: Claude Opus 4.6 --- tests/crypto_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 03a24bc73..32ba07e04 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -293,7 +293,6 @@ def test_luks1_format_pbkdf_options(self): with self.assertRaisesRegex(GLib.GError, "Invalid pbkdf specified"): BlockDev.crypto_luks_format(self.loop_devs[0], "aes-xts-plain64", 0, ctx, 0, BlockDev.CryptoLUKSVersion.LUKS1, extra) - self.assertTrue(succ) @tag_test(TestTags.SLOW, TestTags.CORE) def test_luks2_format_pbkdf_options(self): From 0e9683cf46931b4c98d3d392c6fda02b8ea5349d Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:09:59 +0100 Subject: [PATCH 26/27] tests: Fix inconsistent LVM version string format Use "2.03.07" format consistent with all other LVM version comparisons in the file, instead of "2.3.07". Co-Authored-By: Claude Opus 4.6 --- tests/_lvm_cases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/_lvm_cases.py b/tests/_lvm_cases.py index a8733054b..b8ebc86c6 100644 --- a/tests/_lvm_cases.py +++ b/tests/_lvm_cases.py @@ -1937,8 +1937,8 @@ def setUpClass(cls): if "File exists" not in e.message: raise unittest.SkipTest("cannot load VDO kernel module, skipping.") - if LVM_VERSION < Version("2.3.07"): - raise unittest.SkipTest("LVM version 2.3.07 or newer needed for LVM VDO.") + if LVM_VERSION < Version("2.03.07"): + raise unittest.SkipTest("LVM version 2.03.07 or newer needed for LVM VDO.") if not shutil.which("vdoformat"): raise unittest.SkipTest("vdoformat executable not found in $PATH, skipping.") From b25943d3dda0c8f00741105df1aa2a87b5e5e080 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 13 Mar 2026 15:51:41 +0100 Subject: [PATCH 27/27] tests: Fix assert in ExtGetInfo._test_ext_get_info assertTrue never actually checked the state which we don't want anyway, we just need to make sure it is not empty, we can't expect the filesystem to be in some specific state in the test. --- tests/fs_tests/ext_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fs_tests/ext_test.py b/tests/fs_tests/ext_test.py index 990453dbc..a6d981aeb 100644 --- a/tests/fs_tests/ext_test.py +++ b/tests/fs_tests/ext_test.py @@ -248,7 +248,7 @@ def _test_ext_get_info(self, mkfs_function, info_function): self.assertEqual(fi.label, "") # should be an non-empty string self.assertTrue(fi.uuid) - self.assertTrue(fi.state, "clean") + self.assertTrue(fi.state) with mounted(self.loop_devs[0], self.mount_dir): fi = info_function(self.loop_devs[0]) @@ -259,7 +259,7 @@ def _test_ext_get_info(self, mkfs_function, info_function): self.assertEqual(fi.label, "") # should be an non-empty string self.assertTrue(fi.uuid) - self.assertTrue(fi.state, "clean") + self.assertTrue(fi.state) @tag_test(TestTags.CORE) def test_ext2_get_info(self):