fix(reboot): bound host boot tcp probes

This commit is contained in:
Your Name
2026-07-03 02:00:55 +08:00
parent 1392369e56
commit e8e9bf33a6
5 changed files with 19 additions and 2 deletions

View File

@@ -153,7 +153,8 @@ probe_reachable_only() {
if command -v nc >/dev/null 2>&1; then
for port in ${BOOT_PROBE_TCP_PORTS:-22 80 443 3389 5985 9100}; do
if nc -z -w "${TCP_CONNECT_TIMEOUT_SECONDS:-2}" "$target_host" "$port" >/dev/null 2>&1; then
if run_with_timeout "${TCP_CONNECT_TIMEOUT_SECONDS:-2}" \
nc -z -w "${TCP_CONNECT_TIMEOUT_SECONDS:-2}" "$target_host" "$port" >/dev/null 2>&1; then
emit_boot_row "$alias" "$target" "$unit" 1 "reachable_unknown_boot" "unknown" "tcp_${port}_reachable" "unknown" "unknown"
return 0
fi

View File

@@ -19,6 +19,7 @@ def test_reboot_p0_contract_covers_all_required_hosts_and_vmware_autostart() ->
for host in ["99", "110", "111", "112", "120", "121", "188"]:
assert host in host_probe
assert 'run_with_timeout "${TCP_CONNECT_TIMEOUT_SECONDS:-2}"' in host_probe
assert "AWOOOI-Start-VMware-VMs" in windows99
assert "NoAutoRebootWithLoggedOnUsers" in windows99
assert "Host110Vmx" in windows99