#!/bin/sh # node-reset_test.sh — tests the QEMU process match node-reset.sh uses to stop # guests before it deletes Viperblock state, against real processes. # # Each fake guest is a copy of sleep named like a QEMU binary, so the kernel # gives it the same comm, including the 15-character truncation. set -eu SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd) TMP=$(mktemp -d) pids="" cleanup() { for pid in $pids; do kill "$pid" 2>/dev/null || true; done rm -rf "$TMP" } trap cleanup EXIT fails=0 pass() { echo " ok - $1"; } fail() { echo " FAIL - $1"; fails=$((fails + 1)); } echo "-- node-reset.sh QEMU process match" # pattern_in