dm/003: fix readonly variable conflict by renaming TO_SKIP to SKIP_VAL#204
Closed
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
Closed
dm/003: fix readonly variable conflict by renaming TO_SKIP to SKIP_VAL#204yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
Conversation
The TO_SKIP variable was declared as readonly but conflicts with an
existing readonly variable in nvme/065, causing "readonly variable"
errors when running tests in certain orders. Rename TO_SKIP to SKIP_VAL
to avoid the naming conflict.
$ ./check dm/003 nvme/065
tests/nvme/065: line 23: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.790s ... 5.839s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.534s ... 9.619s
$ ./check nvme/065 dm/003
tests/dm/003: line 18: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.839s ... 5.728s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.619s ... 9.546s
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
kawasaki
added a commit
to kawasaki/blktests
that referenced
this pull request
Sep 18, 2025
TO_SKIP is defined as readonly at two places in dm/003 and nvme/065. When these two test cases are run at once, bash complains that the readonly value is assigned twice. To avoid the error, do not declare the value as readonly. Also, move the declarations of TO_SKIP to common/rc to avoid the duplicated declarations. Link: linux-blktests#204 Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
kawasaki
added a commit
to kawasaki/blktests
that referenced
this pull request
Sep 18, 2025
TO_SKIP is defined as readonly at two places in dm/003 and nvme/065. When these two test cases are run at once, bash complains that the readonly value is assigned twice. To avoid the error, do not declare the value as readonly. Also, move the declarations of TO_SKIP to common/rc to avoid the duplicated declarations. Reported-by: Yi Zhang <yi.zhang@redhat.com> Link: linux-blktests#204 Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Collaborator
|
@yizhanglinux Thank you for catching this. As to the fix approach, I think it's the better to avoid the duplication. So how about moving the TO_SKIP declarations to common/rc. I created a patch to do it. If you don't mind, I will apply this fix. |
Contributor
Author
Yeah, I agree, your approach looks better, thanks. :) |
Collaborator
|
@yizhanglinux Thanks for the comment. I have applied the patch. |
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.
The TO_SKIP variable was declared as readonly but conflicts with an existing readonly variable in nvme/065, causing "readonly variable" errors when running tests in certain orders. Rename TO_SKIP to SKIP_VAL to avoid the naming conflict.
$ ./check dm/003 nvme/065
tests/nvme/065: line 23: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.790s ... 5.839s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.534s ... 9.619s
$ ./check nvme/065 dm/003
tests/dm/003: line 18: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.839s ... 5.728s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.619s ... 9.546s