Skip to content

Various test issues fixes#1500

Merged
vojtechtrefny merged 18 commits intostoraged-project:masterfrom
vojtechtrefny:master_claude-tests-issues
Apr 8, 2026
Merged

Various test issues fixes#1500
vojtechtrefny merged 18 commits intostoraged-project:masterfrom
vojtechtrefny:master_claude-tests-issues

Conversation

@vojtechtrefny
Copy link
Copy Markdown
Member

No description provided.

vojtechtrefny and others added 18 commits April 7, 2026 15:06
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]>
@vojtechtrefny vojtechtrefny force-pushed the master_claude-tests-issues branch from 34acc6c to e49e3f7 Compare April 7, 2026 15:22
Copy link
Copy Markdown
Member

@tbzatek tbzatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@vojtechtrefny vojtechtrefny merged commit 4320ed1 into storaged-project:master Apr 8, 2026
19 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants