Skip to content

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Aug 25, 2025

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").

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

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-* ]]"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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-* ]]"

marmijo
marmijo previously approved these changes Aug 25, 2025
Copy link
Member

@marmijo marmijo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

dustymabe
dustymabe previously approved these changes Aug 25, 2025
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@aaradhak
Copy link
Member

aaradhak commented Aug 25, 2025

CI failure due to aws-sdk-go , may be it can be waived here?

Error: SA1019: "github.com/aws/aws-sdk-go/aws" is deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.

#4254 - This issue is planned to be addressed this sprint.

@aaradhak aaradhak enabled auto-merge (rebase) August 25, 2025 20:10
@dustymabe
Copy link
Member

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").
@jlebon jlebon dismissed stale reviews from dustymabe and marmijo via 6b8ce23 August 26, 2025 02:03
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@travier travier disabled auto-merge August 26, 2025 07:15
@travier travier merged commit f6371b6 into coreos:main Aug 26, 2025
5 of 6 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.

5 participants