Commit e9f979cf authored by Lars Wirzenius's avatar Lars Wirzenius

Add: UEFI smoke test

parent 3c9219f3
steps:
- mkimg: "{{ output }}"
size: 4G
- mklabel: gpt
device: "{{ output }}"
- mkpart: primary
device: "{{ output }}"
start: 0%
end: 1G
tag: efifs
- mkpart: primary
device: "{{ output }}"
start: 1G
end: 100%
tag: rootfs
- kpartx: "{{ output }}"
- mkfs: vfat
partition: efifs
- mkfs: ext4
partition: rootfs
label: smoke
- mount: rootfs
- unpack-rootfs: rootfs
- debootstrap: stretch
mirror: http://deb.debian.org/debian
target: rootfs
unless: rootfs_unpacked
- apt: install
packages:
- linux-image-amd64
tag: rootfs
unless: rootfs_unpacked
- cache-rootfs: rootfs
unless: rootfs_unpacked
- chroot: rootfs
shell: |
sed -i '/^root:[^:]*:/s//root::/' /etc/passwd
echo pc-vmdb2 > /etc/hostname
- grub: uefi
tag: rootfs
efi: efifs
console: serial
......@@ -23,7 +23,10 @@ testing multiple time much faster.
SCENARIO smoke test image
WHEN user runs vmdb smoke-pc.vmdb --output smoke-pc.img
THEN user can boot smoke-pc.img and power it off from root shell
THEN user can BIOS boot smoke-pc.img and power it off from root shell
WHEN user runs vmdb smoke-uefi.vmdb --output smoke-uefi.img
THEN user can UEFI boot smoke-uefi.img and power it off from root shell
IMPLEMENTS WHEN user runs vmdb (\S+) --output (\S+)
"$SRCDIR/vmdb2" --no-default-config "$SRCDIR/$MATCH_1" \
......@@ -32,7 +35,7 @@ testing multiple time much faster.
--verbose \
--rootfs-tarball "$ROOTFS_TARBALL"
IMPLEMENTS THEN user can boot (\S+) and power it off from root shell
IMPLEMENTS THEN user can BIOS boot (\S+) and power it off from root shell
cd "$DATADIR"
img="$MATCH_1"
cat << EOF > run.sh
......@@ -59,3 +62,37 @@ testing multiple time much faster.
expect eof
EOF
expect -d expect.txt > expect.out
IMPLEMENTS THEN user can UEFI boot (\S+) and power it off from root shell
cd "$DATADIR"
img="$MATCH_1"
cat << EOF > run.sh
cp /usr/share/OVMF/OVMF_VARS.fd .
qemu-system-x86_64 \
-m 1024 \
-drive if=pflash,format=raw,unit=0,file=/usr/share/ovmf/OVMF.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-drive format=raw,file="$img" \
-nographic
EOF
chmod a+rx run.sh
cat << EOF > expect.txt
set timeout 300
proc abort {} {
puts "ERROR ERROR\n"
exit 1
}
spawn ./run.sh
expect "login: "
send "root\n"
expect "# "
send "poweroff\r"
set timeout 5
expect {
"reboot: Power down" {puts poweroffing\n}
eof abort
timeout abort
}
expect eof
EOF
expect -d expect.txt > expect.out
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment