convert inout test to use uevent-watch

This commit is contained in:
Daniel Barlow 2024-04-15 22:15:27 +01:00
parent 41a4b1f7ef
commit a5f16dfa81
3 changed files with 26 additions and 15 deletions

View file

@ -13,13 +13,15 @@ in pkgs.runCommand "check" {
socat
e2fsprogs
util-linux # for sfdisk, fallocate
parted
] ;
} ''
mkdir vm
dd if=/dev/zero of=./vm/stick.e2fs bs=1M count=32
mkfs.ext2 -L backup-disk ./vm/stick.e2fs
cat <(dd if=/dev/zero bs=512 count=4) ./vm/stick.e2fs > ./vm/stick.img
echo '4,-,L,*' | sfdisk ./vm/stick.img
dd if=/dev/zero of=./vm/stick.img bs=1M count=38
dd if=./vm/stick.e2fs of=./vm/stick.img bs=512 seek=34 conv=notrunc
parted -s ./vm/stick.img -- mklabel gpt mkpart backup-disk ext2 34s -0M
${img}/run.sh --background ./vm --flag -device --flag usb-ehci,id=xhci --flag -drive --flag if=none,id=usbstick,format=raw,file=$(pwd)/vm/stick.img
expect ${./script.expect} | tee $out