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: make iscsi tests use virtiofs mounted COSA rootfs #4013

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mantle/cmd/kola/qemuexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func runQemuExec(cmd *cobra.Command, args []string) error {
builder.AppendFirstbootKernelArgs = firstbootkargs
}
builder.AppendKernelArgs = strings.Join(kargs, " ")
builder.Swtpm = kola.QEMUOptions.Swtpm
if kola.QEMUOptions.Firmware != "" {
builder.Firmware = kola.QEMUOptions.Firmware
}
Expand Down
29 changes: 14 additions & 15 deletions mantle/cmd/kola/resources/iscsi_butane_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ storage:
# Will return 0 if the discovery yield a valid portal
iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1 | \
grep iqn.2024-05.com.coreos
- path: /var/boot.ipxe
- path: /srv/boot.ipxe
mode: 0644
contents:
inline: |
Expand Down Expand Up @@ -87,16 +87,6 @@ storage:
-i /var/nested-ign.json
# Unmount the disk
iscsiadm --mode node --logoutall=all
# Use a separate unit to pull the image so it can be downloading
# in the background while the `coreos-installer install` is running.
- path: /etc/containers/systemd/coreos-assembler.image
contents:
inline: |
[Image]
Image=quay.io/coreos-assembler/coreos-assembler
[Service]
# Extend start time. COSA is a large image we are pulling from quay.
TimeoutStartSec=600
- path: /etc/containers/systemd/coreos-iscsi-vm.container
contents:
inline: |
Expand All @@ -108,14 +98,23 @@ storage:
OnFailure=emergency.target
OnFailureJobMode=isolate
[Container]
Image=coreos-assembler.image
ContainerName=iscsiboot
Volume=/var/boot.ipxe:/var/boot.ipxe
Volume=/dev/virtio-ports/testisocompletion:/mnt/serial
# Use the read-only virtiofs shared rootfs from COSA. This
# saves us pulling 4+ GiB COSA container from quay.
# makes it so we don't have to pull down COSA from quay
Rootfs=/var/cosaroot
Volume=/srv/boot.ipxe:/srv/boot.ipxe
AddDevice=/dev/virtio-ports/testisocompletion:/dev/virtio-ports/testisocompletion
# Create a few writable directories from empty volumes. We
# must use named volumes for now so we can pass :nocopy.
# https://github.com/containers/podman/issues/25176
Volume=root:/root/:nocopy
Volume=vartmp:/var/tmp/:nocopy
WorkingDir=/root
PodmanArgs=--privileged
Network=host
LogDriver=passthrough
Exec=shell -- kola qemuexec --netboot /var/boot.ipxe --usernet-addr 10.0.3.0/24 -- -device virtio-serial -chardev file,id=iscsi-completion-virtio,path=/mnt/serial,append=on -device virtserialport,chardev=iscsi-completion-virtio,name=testisocompletion
Exec=kola qemuexec --netboot /srv/boot.ipxe --qemu-swtpm=false --usernet-addr 10.0.3.0/24 -- -device virtio-serial -chardev file,id=iscsi-completion-virtio,path=/dev/virtio-ports/testisocompletion,append=on -device virtserialport,chardev=iscsi-completion-virtio,name=testisocompletion
[Install]
# Start by default on boot
WantedBy=multi-user.target
Expand Down
6 changes: 6 additions & 0 deletions mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,12 @@ func testLiveInstalliscsi(ctx context.Context, inst platform.Install, outdir str

builder.SetConfig(config)

// Bind mount in the COSA rootfs into the VM so we can use it as a
// read-only rootfs for quickly starting the container to kola
// qemuexec the nested VM for the test. See resources/iscsi_butane_setup.yaml
builder.MountHost("/", "/var/cosaroot", true)
config.MountHost("/var/cosaroot", true)

mach, err := builder.Exec()
if err != nil {
return 0, errors.Wrapf(err, "running iso")
Expand Down
Loading