Skip to content

Make corrupt_geometry test continue to work with in-kernel formatting. - #2

Closed
bmarzins wants to merge 2 commits into
device-mapper-utils:mainfrom
bmarzins:vdo_fix
Closed

Make corrupt_geometry test continue to work with in-kernel formatting.#2
bmarzins wants to merge 2 commits into
device-mapper-utils:mainfrom
bmarzins:vdo_fix

Conversation

@bmarzins

@bmarzins bmarzins commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

The vdo/load_failure/corrupt_geometry test broke when the in-kernel formatting was added to vdo. The test previously corrupted the geometry block by using dd to fill it with 0s. Loading a table with a zeroed geometry block now triggers in-kernel formatting. Instead, the test now uses dt to fill the geometry block with all 1s.

dt_device() was only using its rseed argument (which is the only
argument that current callers actually set). Make it correctly
handle all of its arguments to enable other users.
@raeburn
raeburn self-requested a review April 24, 2026 21:37
@bmarzins

Copy link
Copy Markdown
Collaborator Author

@fsuba Just a heads-up that the RHEL-113137 (and the associated MR https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/2442) broke a vdo test for dmtest-python. This fixes it to work both before and after the change.

@bmarzins
bmarzins requested a review from bjohnsto April 24, 2026 21:54

@lorelei-sakai lorelei-sakai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks pretty reasonable to me. The only concern is checking for "Bad magic number": that string will happen any time we return the VDO_BAD_MAGIC error code, not just in this specific operation. In practice, though, we don't produce that error anywhere else.

message = get_dmesg_log(start_time)
log.info(message)
assert_string_in(message, "Could not load geometry block")
assert_string_in(message, "VDO Status: Bad magic number")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you sure this is correct. I believe it should look for either "Could not load geometry block" for older kernels or "Could not parse geometry block" for newer vdoformat in kernel ones.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If you're getting bad magic number back, then this concerns me. It could be that we need to check for all three messages.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was getting both messages: "VDO Status: Bad magic number" and either "Could not load geometry block" or "Could not parse geometry block". The Bad magic number was the one that was constant between releases. I assume that's because it checks the magic number first when reading the block, and both all 0s and all 1s falis that check. At any rate, your version will work fine, and has the benefit of being an easier drop-in test fix, since it doesn't require a different helper program.

Now that the kernel will format a device with a zeroed geometry block,
calling wipe_device() won't actually work to corrupt the device anymore.
It will just trigger in-kernel formatting. Instead write all 1s to the
geometry block.
@bmarzins

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #3

@bmarzins bmarzins closed this Apr 25, 2026
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.

4 participants