Re: [PATCH 2/2] CI: Check save/restore of PV domain as part of qemu-alpine-x86_64
Marek Marczykowski-Górecki <[email protected]> Tue, 4 Aug 2026 19:57:01 +0200
| Newsgroups | gmane.comp.emulators.xen.devel |
|---|---|
| Message-ID | <anIn7VAt2oQJ90Js@mail-itl> |
--TDtZEqwh2qedq+2U Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 4 Aug 2026 19:57:01 +0200 From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <[email protected]> To: Frediano Ziglio <[email protected]> Cc: [email protected], Frediano Ziglio <[email protected]>, Doug Goldstein <[email protected]>, Stefano Stabellini <[email protected]>, Jan Beulich <[email protected]>, Andrew Cooper <[email protected]> Subject: Re: [PATCH 2/2] CI: Check save/restore of PV domain as part of qemu-alpine-x86_64 On Tue, Aug 04, 2026 at 06:42:18PM +0100, Frediano Ziglio wrote: > Make sure that save/restore continue to work. > The check save and restore twice to check for corrupted status. > Also a command is launched in the guest to make sure that the > machine is not crashed but working. >=20 > Signed-off-by: Frediano Ziglio <[email protected]> > --- > automation/scripts/console.exp | 8 +++++ > automation/scripts/qemu-alpine-x86_64.sh | 40 ++++++++++++++++++++++-- > 2 files changed, 46 insertions(+), 2 deletions(-) >=20 > diff --git a/automation/scripts/console.exp b/automation/scripts/console.= exp > index e27886bbef..ff58ed29b8 100755 > --- a/automation/scripts/console.exp > +++ b/automation/scripts/console.exp > @@ -58,6 +58,14 @@ if {[info exists env(WAKEUP_CMD)]} { > system "$env(WAKEUP_CMD)" > } > =20 > +if {[info exists env(EXPECT_TEXTS)]} { > + set lines [split "$env(EXPECT_TEXTS)" "\n"] > + foreach {exp snd} $lines { > + expect -re "$exp" > + send "$snd\n" > + } > +} > + > if {[info exists env(LOG_MSG)]} { > expect { > -notransfer -re "$env(PASSED)" { > diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/script= s/qemu-alpine-x86_64.sh > index 60f5cc49fc..409a601c34 100755 > --- a/automation/scripts/qemu-alpine-x86_64.sh > +++ b/automation/scripts/qemu-alpine-x86_64.sh > @@ -48,6 +48,28 @@ xl -vvv create -c /root/domU.cfg > =20 > " > etc/local.d/xen.start > chmod +x etc/local.d/xen.start > + > +# Script to test save and restore. > +# It saves and restores domU domain twice to check if the domain was cor= rupted > +# during the first sequence. > +# At the end open the console to check if the domain is working. > +cat > root/save_restore_test << "EOF" > +#!/bin/sh > +set -ex > +xl list | grep -q domU > +rm -f save.dat > +xl save "$(xl list | awk '$1=3D=3D"domU" { print $2 }')" save.dat /root/= domU.cfg > +xl restore /root/domU.cfg save.dat > +xl list | grep -q domU > +rm -f save.dat > +xl save "$(xl list | awk '$1=3D=3D"domU" { print $2 }')" save.dat /root/= domU.cfg > +xl restore /root/domU.cfg save.dat > +xl list | grep -q domU > +rm -f save.dat > +xl console "$(xl list | awk '$1=3D=3D"domU" { print $2 }')" > +EOF > +chmod +x root/save_restore_test > + > find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz > cd ../.. > =20 > @@ -70,9 +92,23 @@ export TEST_CMD=3D"qemu-system-x86_64 \ > -device virtio-net-pci,netdev=3Dn0 \ > -netdev user,id=3Dn0,tftp=3Dbinaries,bootfile=3D/pxelinux.0" > =20 > +# Sequence of expect/send strings: > +# 1. wait domain start and close console; > +# 2. wait login prompt and login as root > +# 3. wait login and launch save/restore test; > +# 4. wait restore from domain console and send a command. Why doing this interactively over serial, instead of adding to etc/local.d/xen.start and then printing test result at the end? > +gs=3D$'\x1d' > +export EXPECT_TEXTS=3D"BusyBox > +$gs $gs > +login: > +root > +login on > +/root/save_restore_test > +Restarting tasks > +dmesg | grep suspending | tr o 0" > + > export TEST_LOG=3D"smoke.serial" > export BOOT_MSG=3D"Latest ChangeSet: " > -export LOG_MSG=3D"Domain-0" > -export PASSED=3D"BusyBox" > +export PASSED=3D"suspending xenst0re" > =20 > ./automation/scripts/console.exp |& sed 's/\r\+$//' > --=20 > 2.43.0 >=20 --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --TDtZEqwh2qedq+2U Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpyJ+0ACgkQ24/THMrX 1yy04Qf/fuaUVKZY9577YfoGDDwlo7DXrIjWgmukGdGCrtup38i8D6Mu4m0ME0s3 vTO/fPgEzFhH1D3Jeusu8CUA4XBoC3jcQl+4Sq6h9/ESP0qPS95o/jbQVnLA5wt7 qOSgHiaHxBgtkv7w6qFNqEANHuUk0L+8ARi6Yqr2ILhEwyK9Qu7bo+rCpkwVdgmp mFxyJknlRbmZVumbdEzKHk+C8GDrkZ4SvnQ50U5/xAhIkxu6PJ6uDg4Tv+oDB9tq 0ofwAFVf7NiNqkal8KfkdeiMUNGWD3eiB4kebncPueNSKVh/3GQjERb+XPIInCfF yMH/UVS0dsAPyFbl2JQrO/JKkzOzkQ== =qhiS -----END PGP SIGNATURE----- --TDtZEqwh2qedq+2U--