Skip to content

check_port: cover the Globalping verdict with tests - #3249

Merged
xirvik merged 1 commit into
Novik:masterfrom
xirvik:fix/globalping-verdict-tests
Sep 2, 2026
Merged

check_port: cover the Globalping verdict with tests#3249
xirvik merged 1 commit into
Novik:masterfrom
xirvik:fix/globalping-verdict-tests

Conversation

@xirvik

@xirvik xirvik commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

The Globalping provider added in #3245 read an open port out of rawOutput. Before it was corrected, the rule matched the tcp_conn=N attempt counter anywhere in the output, and Globalping prints that counter on its "No reply" lines too, so every port came back open -- including ports that never answered at all. Because Globalping runs last in the failover chain, that verdict reached the user exactly when no other provider could answer.

Nothing held the corrected rule in place: the verdict was inline in check_port_globalping(), next to the HTTP call, so no test could reach it without the network.

Move it to check_port_parse_globalping() in parse.php, beside check_port_parse_yougetsignal(), and cover it with the two rawOutput shapes the API actually returns -- a reply on 8.8.8.8:53 and no reply on 8.8.8.8:81 -- plus a refusal, an empty body, and output in an unfamiliar shape. Silence stays "unknown" rather than "closed": a probe that heard nothing cannot tell a filtered port from a closed one.

Also check the shipped configuration against the provider registry. action.php skips any provider that is unknown or that does not claim the address family being checked, so a name that does not line up costs no error -- the provider is simply never tried, and the chain is quietly shorter than the comment in conf.php reads.

Each case was confirmed to fail with the check it guards removed.

The Globalping provider added in Novik#3245 read an open port out of
rawOutput. Before it was corrected, the rule matched the tcp_conn=N
attempt counter anywhere in the output, and Globalping prints that
counter on its "No reply" lines too, so every port came back open --
including ports that never answered at all. Because Globalping runs
last in the failover chain, that verdict reached the user exactly when
no other provider could answer.

Nothing held the corrected rule in place: the verdict was inline in
check_port_globalping(), next to the HTTP call, so no test could reach
it without the network.

Move it to check_port_parse_globalping() in parse.php, beside
check_port_parse_yougetsignal(), and cover it with the two rawOutput
shapes the API actually returns -- a reply on 8.8.8.8:53 and no reply
on 8.8.8.8:81 -- plus a refusal, an empty body, and output in an
unfamiliar shape. Silence stays "unknown" rather than "closed": a probe
that heard nothing cannot tell a filtered port from a closed one.

Also check the shipped configuration against the provider registry.
action.php skips any provider that is unknown or that does not claim
the address family being checked, so a name that does not line up costs
no error -- the provider is simply never tried, and the chain is
quietly shorter than the comment in conf.php reads.

Each case was confirmed to fail with the check it guards removed.
@xirvik
xirvik merged commit ca62b04 into Novik:master Sep 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant