Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install dependencies
run: |
sudo apt update
Expand Down
40 changes: 25 additions & 15 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ QEMU_BASEARGS=(
-chardev null,id=serial,logfile=/dev/stdout,logappend=on -serial chardev:serial -monitor none
-virtfs "local,path=${tmpdir},mount_tag=tmpdir,security_model=none")

KERNEL_BASEARGS=(
root=LABEL=ROOT
console=ttyS0
# In TW, SELinux needs to be enabled explicitly
security=selinux selinux=1
# Configure output and logging logging
quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1
# Make sure to fail fast
rd.emergency=poweroff rd.shell=0)

# Prepare the temporary dir: Install combustion and copy resources.
testdir="$(dirname "$0")"
make -C "${testdir}/.." install "DESTDIR=${tmpdir}/install"
Expand Down Expand Up @@ -96,7 +106,7 @@ cp config.ign configdrv/ignition/config.ign
/sbin/mkfs.ext4 -F -d configdrv -L ignition combustion.raw 16M

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz -initrd initrd -append "root=LABEL=ROOT console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0" \
-kernel vmlinuz -initrd initrd -append "${KERNEL_BASEARGS[*]}" \
-drive if=virtio,file=combustion.raw

if ! [ -e "${tmpdir}/done" ]; then
Expand All @@ -109,7 +119,7 @@ rm -f "${tmpdir}/done"
qemu-img snapshot -a initial openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz -initrd initrd -append "root=LABEL=ROOT console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0" \
-kernel vmlinuz -initrd initrd -append "${KERNEL_BASEARGS[*]}" \
-fw_cfg name=opt/org.opensuse.combustion/script,file=testscript

if ! [ -e "${tmpdir}/done" ]; then
Expand All @@ -121,20 +131,20 @@ fi
rm -f "${tmpdir}/done"

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz -initrd initrd -append "root=LABEL=ROOT console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0" \
-fw_cfg name=opt/org.opensuse.combustion/script,file=combustion-secondboot
-kernel vmlinuz -initrd initrd -append "${KERNEL_BASEARGS[*]}" \
-fw_cfg name=opt/org.opensuse.combustion/script,file=combustion-secondboot

if ! [ -e "${tmpdir}/done" ]; then
echo "Test failed"
exit 1
echo "Test failed"
exit 1
fi

# Test combustion.url using QEMU's builtin tftp server
rm -f "${tmpdir}/done"
qemu-img snapshot -a initial openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz -initrd initrd -append "root=LABEL=ROOT console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0 combustion.url=tftp://10.0.2.2/testscript" \
-kernel vmlinuz -initrd initrd -append "${KERNEL_BASEARGS[*]} combustion.url=tftp://10.0.2.2/testscript" \
-nic "user,tftp=$tmpdir"

if ! [ -e "${tmpdir}/done" ]; then
Expand All @@ -147,7 +157,7 @@ rm -f "${tmpdir}/done"
qemu-img snapshot -a initial openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz -initrd initrd-noignition -append "root=LABEL=ROOT console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0 combustion.url=tftp://10.0.2.2/testscript" \
-kernel vmlinuz -initrd initrd-noignition -append "${KERNEL_BASEARGS[*]} combustion.url=tftp://10.0.2.2/testscript" \
-nic "user,tftp=$tmpdir"

if ! [ -e "${tmpdir}/done" ]; then
Expand All @@ -159,10 +169,10 @@ fi

# Download latest Minimal-VM image
if ! [ -f openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2 ]; then
wget --progress=bar:force:noscroll https://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
qemu-img snapshot -c initial openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
wget --progress=bar:force:noscroll https://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
qemu-img snapshot -c initial openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
else
qemu-img snapshot -a initial openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
qemu-img snapshot -a initial openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2
fi

# Use combustion in the downloaded image to generate an initrd with the new combustion.
Expand Down Expand Up @@ -199,7 +209,7 @@ rm -f "${tmpdir}/done"
qemu-img snapshot -a initial openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz-minimal -initrd initrd-minimal -append "root=LABEL=ROOT rw console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0 combustion.url=tftp://10.0.2.2/testscript" \
-kernel vmlinuz-minimal -initrd initrd-minimal -append "${KERNEL_BASEARGS[*]} rw combustion.url=tftp://10.0.2.2/testscript" \
-nic "user,tftp=$tmpdir"

if ! [ -e "${tmpdir}/done" ]; then
Expand All @@ -211,11 +221,11 @@ fi
rm -f "${tmpdir}/done"

timeout 300 qemu-system-x86_64 "${QEMU_BASEARGS[@]}" -drive if=virtio,file=openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen.qcow2 \
-kernel vmlinuz-minimal -initrd initrd-minimal -append "root=LABEL=ROOT rw console=ttyS0 quiet systemd.show_status=1 systemd.log_target=console systemd.journald.forward_to_console=1 rd.emergency=poweroff rd.shell=0 combustion.url=tftp://10.0.2.2/combustion-secondboot" \
-kernel vmlinuz-minimal -initrd initrd-minimal -append "${KERNEL_BASEARGS[*]} rw combustion.url=tftp://10.0.2.2/combustion-secondboot" \
-nic "user,tftp=$tmpdir"

if ! [ -e "${tmpdir}/done" ]; then
echo "Test failed"
exit 1
echo "Test failed"
exit 1
fi

Loading