Various test issues fixes#1500
Merged
vojtechtrefny merged 18 commits intostoraged-project:masterfrom Apr 8, 2026
Merged
Conversation
test_offline_grow was calling _test_grow(True) instead of _test_grow(False), making it identical to test_online_grow. The offline filesystem grow code path was never being tested. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The closing parenthesis of len() was misplaced, causing the optional message string to be passed as a second argument to len() instead of being part of the outer format string. This would raise TypeError whenever the assertion message was actually triggered. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The '%' operators bound left-to-right before the ternary conditional, causing double string formatting which would raise TypeError when msg was provided, or produce an empty AssertionError when msg was None. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…iable _split_test_id() accepted test_id as a parameter but used test.id() from the caller's scope instead. This would cause a NameError when called from a context where 'test' is not in scope. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The format string had no %s placeholder but applied % self.dev_name, which would raise TypeError instead of producing the intended failure message. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Exception.message was removed in Python 3. Using e.message would raise AttributeError instead of properly skipping the test. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…path The tearDown wait loop used os.path.exists(device) where device was just the basename (e.g. "sr0"), checking for ./sr0 in CWD instead of /sys/block/sr0. The loop condition was always False, so modprobe -r could run before the device was fully removed from the kernel. Co-Authored-By: Claude Opus 4.6 <[email protected]>
RuntimeError() does not perform printf-style formatting. Using a comma instead of the % operator passed a tuple as the error argument, so the error message would display as a raw tuple instead of the intended formatted string. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The comment said "disable compression" but the code passes True to EnableCompression(), which re-enables it. Copy-paste error from the actual disable block above. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The error message in UdisksEncryptedTestLUKS1._get_metadata_size_from_dump said "LUKS 2" but the method is specifically for LUKS 1. Copy-paste error from the LUKS2 variant. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The second mkfs.ext4 call stored output in _out but the error message referenced out from the first mkfs call, which would show misleading output on failure. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Bare except clauses catch KeyboardInterrupt and SystemExit in addition to regular exceptions, which can mask critical errors and make tests impossible to interrupt cleanly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The assertIsNone(mnt_path) calls after disk.Mount() inside assertRaisesRegex blocks were dead code: if Mount raises the expected exception, the assertion is never reached; if it doesn't raise, the assertRaisesRegex itself fails. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Rename _force_lougout to _force_logout and _read_initator_name to _read_initiator_name. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Calling tearDownClass() from instance test methods before skipTest() caused double teardown since the framework also calls tearDownClass() at the end of the test class. The skipTest() alone is sufficient to skip the test. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The local variable 'json' in setup_nvme_target shadowed the imported json module, which could cause confusing errors if the module was used later in the same scope. Co-Authored-By: Claude Opus 4.6 <[email protected]>
test_resize and test_subvolume_mount both used the label 'test_snapshot' copied from the snapshot test. Use labels matching the actual test names for clarity. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The comment was copied from test_20_create_with_offset but this test (test_50_create_no_part_scan) has no offset, so the comment about "except for the first 4096 bytes" was incorrect. Co-Authored-By: Claude Opus 4.6 <[email protected]>
34acc6c to
e49e3f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.