From ff4451f6b6317c3271ba81867d7adf4ba20b01c2 Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Mon, 26 Dec 2022 19:43:25 +0100 Subject: [PATCH] github: Resize image to 8 GB before running test --- .github/workflows/ci.yml | 1 + .github/workflows/prebuilt.yml | 3 ++- test/qemu.sh | 35 ++++++++++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5afbf78..fee9f7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,7 @@ jobs: debian-archive-keyring \ debootstrap \ e2fsprogs \ + parted \ pigz \ pwgen \ qemu-system-x86 \ diff --git a/.github/workflows/prebuilt.yml b/.github/workflows/prebuilt.yml index 068cb81..b5f5d60 100644 --- a/.github/workflows/prebuilt.yml +++ b/.github/workflows/prebuilt.yml @@ -56,7 +56,8 @@ jobs: sudo apt-get update sudo apt-get --assume-yes \ --no-install-recommends \ - install pigz \ + install parted \ + pigz \ qemu-system-x86 \ qemu-system-arm \ ssh \ diff --git a/test/qemu.sh b/test/qemu.sh index b75654c..bfd6f35 100755 --- a/test/qemu.sh +++ b/test/qemu.sh @@ -20,8 +20,11 @@ echo "Using password ${SSHPASS}" # Build image zcat "${BOOT}" "${DEBIAN}" > image.bin -# Assume 4GB virtual disk -fallocate -l 4GB image.bin +# Assume 8GB virtual disk +fallocate -l 8GB image.bin + +# Extend second partition +parted -s -a opt image.bin "resizepart 2 100%" # Extract U-Boot (u-boot.rom in x86 case) dd if=image.bin of=bios.bin count=2048 skip=16 @@ -78,15 +81,39 @@ sleep 15 # Pass password to sshpass export SSHPASS -# SSH into QEMU and shut it down +# Wait for start up until sshpass -e ssh -o "ConnectTimeout=5" \ -o "StrictHostKeyChecking=no" \ -o "UserKnownHostsFile=/dev/null" \ -p 5555 \ -q \ - root@localhost "sleep 5 && apt-get update && poweroff"; do + root@localhost /bin/true; do sleep 1 done +sleep 5 + +# Run test +sshpass -e ssh -o "ConnectTimeout=5" \ + -o "StrictHostKeyChecking=no" \ + -o "UserKnownHostsFile=/dev/null" \ + -p 5555 \ + -q \ + root@localhost <