# devvm stop: stops the folder's VM and its proxy, then checks .git as a # launch that finds it stopped does (locking it again on macOS), and drops # the VM from devvm's ssh config. # No VM. project web ! exec devvm stop stderr '^devvm: no_vm dir=\S*/web$' # A running VM with network policy: it stops, then its proxy. (Its # hostagent here: the test's runner, which runs on, so the proxy runs until # stopped; the stub's would be gone after devvm.) exec git init -q exec sh -c 'echo $PPID > "$STUB_DIR/hostagent"' exec devvm --network allowlist catg $DATA/ssh_config stdout '^Host devvm-web devvm-web-[0-9a-f]{14}$' exec sh -c 'cat "$VMS"/*/run/proxy.pid > "$WORK/pid" && kill -0 "$(cat "$WORK/pid")"' stub_reset exec devvm stop stdout '^==> stopped vm=devvm-web-[0-9a-f]{14}$' stub_calls stdout '^limactl stop devvm-web-[0-9a-f]{14}$' [darwin] stdout '^limactl stop devvm-web-[0-9a-f]{14}\n(.*\n)*chflags -R -P uchg /\S*/web/\.git/hooks$' ! stdout 'limactl (start|edit)' ! exec sh -c 'kill -0 "$(cat "$WORK/pid")"' catg $DATA/ssh_config ! stdout devvm-web # Already stopped: said; .git is checked all the same. stub_reset exec devvm stop stdout '^==> already_stopped vm=devvm-web-[0-9a-f]{14}$' ! stdout '==> stopped' stub_calls ! stdout 'limactl stop' # A VM made for an earlier folder at this path isn't stopped. cd $WORK rm web mkdir web cd web stub_reset ! exec devvm stop stderr '^devvm: vm_other_folder vm=devvm-web-[0-9a-f]{14} was=/\S*/web$' stub_calls ! stdout 'limactl stop'