diff --git a/test/towerops/monitoring/executors/ping_executor_test.exs b/test/towerops/monitoring/executors/ping_executor_test.exs index 472ce180..0a620a67 100644 --- a/test/towerops/monitoring/executors/ping_executor_test.exs +++ b/test/towerops/monitoring/executors/ping_executor_test.exs @@ -62,6 +62,16 @@ defmodule Towerops.Monitoring.Executors.PingExecutorTest do assert is_binary(reason) end + test "exercises run_ping path against loopback (no network required)" do + # 127.0.0.1 is always reachable via loopback; this drives the + # System.cmd/Task.async/Task.yield branches that the :network- + # tagged tests cover but which CI excludes by default. + config = %{"host" => "127.0.0.1", "count" => 1} + + result = PingExecutor.execute(config, 2000) + assert match?({:ok, _, _}, result) or match?({:error, _}, result) + end + test "clamps count to range [1, 10]" do # Verified indirectly via build_args: clamp to 10 when given 999 args_high = PingExecutor.build_args("127.0.0.1", 10, 5000)