改用ps-ef识别部署进程

This commit is contained in:
wkc
2026-04-01 10:49:25 +08:00
parent f8b2bf2afc
commit 3a8f37f547
3 changed files with 48 additions and 5 deletions

View File

@@ -204,8 +204,19 @@ test_netstat_fallback_should_work() {
cleanup_release_dir "$release_dir"
}
test_should_use_ps_ef_for_process_detection() {
if rg -n 'pgrep' "$SCRIPT_UNDER_TEST" >/dev/null 2>&1; then
fail "expected deploy_from_package.sh not to depend on pgrep"
fi
if ! rg -n 'ps -ef' "$SCRIPT_UNDER_TEST" >/dev/null 2>&1; then
fail "expected deploy_from_package.sh to use ps -ef for process detection"
fi
}
main() {
[ -f "$SCRIPT_UNDER_TEST" ] || fail "script under test not found: $SCRIPT_UNDER_TEST"
test_should_use_ps_ef_for_process_detection
test_deploy_success
test_multiple_release_zip_should_fail
test_netstat_fallback_should_work