diff --git a/rescue-objects.tar b/rescue-objects.tar new file mode 100644 index 0000000..efee8e1 Binary files /dev/null and b/rescue-objects.tar differ diff --git a/tests/proxmox/create-vm.sh b/tests/proxmox/create-vm.sh index d41f0be..c33938b 100755 --- a/tests/proxmox/create-vm.sh +++ b/tests/proxmox/create-vm.sh @@ -179,20 +179,29 @@ runcmd: ' # --- INSTALL CONVENIENCE COMMAND ------------------------------------------- + # NOTE: heredoc inside cloud-init runcmd must NOT be indented or the + # shebang gets leading spaces and the script won't execute properly. - | cat > /usr/local/bin/darkforge-test << 'DTEOF' - #!/bin/bash - SCRIPT="/home/darkforge/darkforge/tests/proxmox/run-in-vm.sh" - if [ ! -f "$SCRIPT" ]; then - echo "ERROR: Test script not found. Is the repo cloned?" - echo " git clone --recurse-submodules https://git.dannyhaslund.dk/danny8632/darkforge.git ~/darkforge" - exit 1 - fi - ARGS="$*" - exec tmux new-session -d -s darkforge \ - "bash ${SCRIPT} --tmux ${ARGS}; echo ''; echo 'Tests finished. Press Enter to close.'; read" \; \ - attach-session -t darkforge - DTEOF +#!/bin/bash +SCRIPT="/home/darkforge/darkforge/tests/proxmox/run-in-vm.sh" +if [ ! -f "$SCRIPT" ]; then + echo "ERROR: Test script not found at: $SCRIPT" + echo "" + echo "The git clone probably failed during provisioning." + echo "Clone manually:" + echo " git clone --recurse-submodules https://git.dannyhaslund.dk/danny8632/darkforge.git ~/darkforge" + echo "" + echo "Then run: darkforge-test" + exit 1 +fi +ARGS="$*" +# Kill any existing tmux session first +tmux kill-session -t darkforge 2>/dev/null || true +exec tmux new-session -d -s darkforge \ + "bash ${SCRIPT} --tmux ${ARGS}; echo ''; echo 'Tests finished. Press Enter to close.'; read" \; \ + attach-session -t darkforge +DTEOF chmod +x /usr/local/bin/darkforge-test # --- SIGNAL DONE -----------------------------------------------------------