spawn/sh
Ahmed Abushagur c71f01725b
test: unit tests for openclaw gateway resilience config (#2224)
* test(e2e): add openclaw gateway kill/restart resilience test

Verifies that the openclaw gateway auto-restarts after being killed
with SIGKILL, validating the systemd Restart=always supervision.

The test runs as part of verify_openclaw:
1. Confirms gateway is listening on :18789
2. Kills it with SIGKILL (simulates a hard crash)
3. Waits up to 30s for systemd to auto-restart it
4. Verifies port 18789 comes back online

If the gateway isn't running (e.g. non-systemd env), the test is
skipped gracefully. On failure, dumps systemd status and gateway
logs for diagnostics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert "test(e2e): add openclaw gateway kill/restart resilience test"

This reverts commit 39b79d5c12.

* test: add unit tests for openclaw gateway resilience config

Verifies that startGateway() produces correct systemd and cron
configuration for auto-restart after a gateway crash:

- Restart=always and RestartSec=5 in the systemd unit
- Cron heartbeat checks port 18789 and restarts if dead
- Wrapper script sources .spawnrc and execs openclaw gateway
- Multiple port-check fallbacks (ss, /dev/tcp, nc)
- Non-systemd fallback to setsid/nohup
- 300s startup timeout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(e2e): add openclaw gateway kill/restart resilience test

Kills the gateway with SIGKILL during verify_openclaw and verifies
systemd Restart=always brings it back within 30s. Skips gracefully
on non-systemd environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
2026-03-05 19:38:10 -05:00
..
aws fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
cli feat: migrate to openrouter.ai/labs/spawn CDN + release artifact version checks (#2178) 2026-03-03 23:34:58 -08:00
daytona fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
digitalocean refactor: convert hermes scripts to thin-wrapper pattern (#2094) 2026-03-01 20:27:59 -08:00
docker fix(docker): add xz-utils to Hermes Dockerfile for Node.js extraction (#2217) 2026-03-05 13:41:53 -05:00
e2e test: unit tests for openclaw gateway resilience config (#2224) 2026-03-05 19:38:10 -05:00
gcp fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
hetzner fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
local fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
shared security: fix checksum grep anchoring and tar path traversal in github-auth.sh (#2213) 2026-03-05 05:41:48 -08:00
sprite fix(security): add --proto '=https' to all curl executable downloads (#2160) 2026-03-03 23:38:03 -05:00
test refactor: Remove dead code and stale references (#2062) 2026-03-01 11:45:24 -05:00