-
Notifications
You must be signed in to change notification settings - Fork 184
kola/testiso: make volume ID test arch-independent #4283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly makes the volume ID test architecture-independent by using findmnt
to locate the backing device for /run/media/iso
. The addition of RequiresMountsFor=/run/media/iso
is also a good improvement to the systemd unit. I have one suggestion to make the shell command in ExecStart
more robust.
mantle/cmd/kola/testiso.go
Outdated
RemainAfterExit=yes | ||
ExecStart=bash -c "[[ $(lsblk -no LABEL /dev/sr0) == %s-* ]]" | ||
# the backing device name is arch-dependent, but we know it's mounted on /run/media/iso | ||
ExecStart=bash -c "[[ $(lsblk -no LABEL $(findmnt -no SOURCE /run/media/iso)) == %s-* ]]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command can be made more robust. The current version has a potential issue with word splitting if the device label returned by lsblk
contains spaces, as the output of the command substitution is not quoted. Using intermediate variables for the device and label, and enabling set -e
, would make the script safer and clearer against such edge cases.
ExecStart=bash -c "[[ $(lsblk -no LABEL $(findmnt -no SOURCE /run/media/iso)) == %s-* ]]" | |
ExecStart=bash -c "set -euo pipefail; dev=$(findmnt -no SOURCE /run/media/iso); label=$(lsblk -no LABEL \"$dev\"); [[ \"$label\" == %s-* ]]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI failure due to
#4254 - This issue is planned to be addressed this sprint. |
Looks like this caused other testiso tests to fail. |
The actual backing device used for the live ISO is arch-dependent. For example on aarch64, it actually just looks like another virtio disk (e.g. `/dev/vdb`). But we know that it must be mounted at `/run/media/iso`, so key off of that instead to find the backing device. While we're here, constrain this check to tests that actually mount the live ISO. Fixes 06da492 ("kola/testiso: test volume ID has OS name prefix").
6488b2a
to
6b8ce23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The actual backing device used for the live ISO is arch-dependent. For example on aarch64, it actually just looks like another virtio disk (e.g.
/dev/vdb
).But we know that it must be mounted at
/run/media/iso
, so key off of that instead to find the backing device.Fixes 06da492 ("kola/testiso: test volume ID has OS name prefix").