From 76edeb887c6a5db890c9ae56cdaee33ba8be7161 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 31 Mar 2024 10:56:18 -0400 Subject: [PATCH] double $ and show expected --- test/iso/install_hash.sh | 9 ++++++++- test/vm/Makefile | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/test/iso/install_hash.sh b/test/iso/install_hash.sh index 7cdd708..416769d 100644 --- a/test/iso/install_hash.sh +++ b/test/iso/install_hash.sh @@ -3,4 +3,11 @@ set -ex checkisomd5 ../../${ISO_NAME} -cd $(dirname ../../${ISO_NAME}) && sha256sum -c $(basename ${ISO_NAME})-CHECKSUM \ No newline at end of file +cd $(dirname ../../${ISO_NAME}) && sha256sum -c $(basename ${ISO_NAME})-CHECKSUM +if [[ $? != 0 ]] +then + echo "Found:" + checkisomd5 --md5sumonly ../../${ISO_NAME} + echo "Expected:" + implantisomd5 --force base-39.iso +fi \ No newline at end of file diff --git a/test/vm/Makefile b/test/vm/Makefile index 2be7bb3..5ceef09 100644 --- a/test/vm/Makefile +++ b/test/vm/Makefile @@ -83,11 +83,11 @@ files/disk.qcow2: .PHONY: install_os install_os: files/install.iso files/disk.qcow2 - timeout 1h qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom files/install.iso -smp 2 -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & QEMU_PID=$! - echo "PID: $QEMU_PID" + timeout 1h qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom files/install.iso -smp 2 -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & QEMU_PID=$$! + echo "PID: $$QEMU_PID" timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done" (nc localhost 4321 | tee vm.stdout) & - wait $QEMU_PID + wait $$QEMU_PID .ONESHELL: @@ -98,21 +98,21 @@ start_vm: install_os -m 4096 -cpu qemu64 -display none -smp 2 \ -chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \ -device e1000,netdev=net0 \ - -netdev user,id=net0,hostfwd=tcp::${VM_PORT}-:22 \ + -netdev user,id=net0,hostfwd=tcp::$(VM_PORT)-:22 \ -device virtio-serial \ -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ - -boot c -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & export QEMU_PID=$! - echo "PID: $QEMU_PID" + -boot c -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & export QEMU_PID=$$! + echo "PID: $$QEMU_PID" timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done" (tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) & - timeout 30m bash -c "while ! (echo > /dev/tcp/${VM_IP}/${VM_PORT}); do sleep 1; done" + timeout 30m bash -c "while ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT)); do sleep 1; done" - if ! (echo > /dev/tcp/${VM_IP}/${VM_PORT}) + if ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT)) then echo "SSH must be installed and enabled inside the container" fi - echo "VM ready for tests at IP ${VM_IP}:${VM_PORT}" - $(MAKE) ansible_inventory VM_IP=${VM_IP} VM_PORT=${VM_PORT} VM_USER=core VM_PASS=foobar \ No newline at end of file + echo "VM ready for tests at IP $(VM_IP):$(VM_PORT)" + $(MAKE) ansible_inventory VM_IP=$(VM_IP) VM_PORT=$(VM_PORT) VM_USER=core VM_PASS=foobar \ No newline at end of file