Skip to content
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

mantle/kola/testiso: support testing coreos.liveiso.fromram installs #3555

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

dustymabe
Copy link
Member

In coreos/fedora-coreos-config#2544 we added a new coreos.liveiso.fromram kernel argument to instruct the ISO image to boot completely from memory in order to facilitate installs back to the same disk the ISO was booted from in iso-as-disk mode (i.e. dd the ISO file to a hard drive or partition on a hard drive).

Let's test here that we can boot completely from memory and that /run/media/iso is not mounted.

Currently this doesn't actually do an install to the same disk that we booted from (actually the iso-as-disk tests don't actually do installs at all, but just verify they can boot), but rather just verifies the ISO isn't mounted after the live system boots up, which should be sufficient.

@dustymabe
Copy link
Member Author

Marking as draft since this needs both #3555 to merge and to be merged into openshift/os as a git submodule bump first.

cgwalters
cgwalters previously approved these changes Aug 14, 2023
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Partially superficial review, but CI should cover things.

mantle/cmd/kola/qemuexec.go Show resolved Hide resolved
RemainAfterExit=yes
# Would like to use SuccessExitStatus but it doesn't support what
# we want: https://github.com/systemd/systemd/issues/10297#issuecomment-1672002635
ExecStart=bash -c "mountpoint /run/media/iso && exit 1 || exit 0"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ExecStart=bash -c "mountpoint /run/media/iso && exit 1 || exit 0"
ExecStart=bash -c "if mountpoint /run/media/iso 2>/dev/null; then exit 1; fi"

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -738,7 +767,18 @@ func testLiveIso(ctx context.Context, inst platform.Install, outdir string, mini
liveConfig.AddFile(nmstateConfigFile, nmstateConfig, 0644)
}

mach, err := inst.InstallViaISOEmbed(nil, liveConfig, targetConfig, outdir, isOffline, minimal)
if isISOFromRAM {
isoKernelArgs = append(isoKernelArgs, "coreos.liveiso.fromram")
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps worthy of elevating to a const somewhere, and also link to the PR introducing the code and in the future the docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

elevated to const

// When you are debugging earlyboot/initramfs issues this can be
// problematic. If you find yourself wanting more logging uncomment
// out the following to get it all on the console of the machine.
// isoKernelArgs = append(isoKernelArgs, "systemd.log_color=0 systemd.log_level=debug systemd.log_target=console")
Copy link
Member

Choose a reason for hiding this comment

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

We could make this a CLI or environment variable too.

Copy link
Member Author

Choose a reason for hiding this comment

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

made it a env var

@dustymabe
Copy link
Member Author

going to wait until coreos/fedora-coreos-config#2544 merges to run CI on this.

@dustymabe
Copy link
Member Author

This can merge now that f-c-c has been updated in openshift/os.

@dustymabe dustymabe marked this pull request as ready for review August 16, 2023 18:52
@dustymabe dustymabe enabled auto-merge (rebase) August 16, 2023 18:52
@dustymabe
Copy link
Member Author

@cgwalters - mind another stamp since I rebased?

We've supported this for a while in coreos-installer upstream and we
even already use it in the NM keyfile code paths in this function.
Let's modify our test framework to support it more generically now too.
Most of the time people probably want to test an install workflow
and they can't really do that if only the ISO is attached to the
VM via a CDROM drive (read only media). Let's add a disk by default
for convenience.
In coreos/fedora-coreos-config#2544 we added
a new `coreos.liveiso.fromram` kernel argument to instruct the ISO
image to boot completely from memory in order to facilitate installs
back to the same disk the ISO was booted from in iso-as-disk mode
(i.e. dd the ISO file to a hard drive or partition on a hard drive).

Let's test here that we can boot completely from memory and that
/run/media/iso is not mounted.

Currently this doesn't actually do an install to the same disk that
we booted from (actually the iso-as-disk tests don't actually do
installs at all, but just verify they can boot), but rather just
verifies the ISO isn't mounted after the live system boots up, which
should be sufficient.
coreos#3554

This comment will help anyone browsing the code or viewing the error
in the log to understand more.
This will be useful in the future when trying to debug earlyboot testiso
issues further.
Copy link
Member

@travier travier left a comment

Choose a reason for hiding this comment

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

This LGTM but I didn't really have time for a real review so not approving. Sorry.

@dustymabe dustymabe merged commit 5a6cbe3 into coreos:main Aug 17, 2023
2 checks passed
@dustymabe dustymabe deleted the dusty-testiso-fromram branch August 17, 2023 18:42
@jlebon
Copy link
Member

jlebon commented Sep 15, 2023

Follow-up in #3621.

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