Skip to content

Commit

Permalink
connectivity: Extend PingCommand to accept extra args
Browse files Browse the repository at this point in the history
To pass "do not fragment" and to specify ping payload size in a
subsequent commit.

Signed-off-by: Martynas Pumputis <[email protected]>
  • Loading branch information
brb committed Jun 25, 2024
1 parent 99169ea commit c4d9fd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ func (ct *ConnectivityTest) CurlCommandParallelWithOutput(peer TestPeer, ipFam f
return cmd
}

func (ct *ConnectivityTest) PingCommand(peer TestPeer, ipFam features.IPFamily) []string {
func (ct *ConnectivityTest) PingCommand(peer TestPeer, ipFam features.IPFamily, extraArgs ...string) []string {
cmd := []string{"ping", "-c", "1"}

if ipFam == features.IPFamilyV6 {
Expand All @@ -1063,7 +1063,10 @@ func (ct *ConnectivityTest) PingCommand(peer TestPeer, ipFam features.IPFamily)
cmd = append(cmd, "-W", strconv.FormatFloat(connectTimeout, 'f', -1, 64))
}

cmd = append(cmd, extraArgs...)

cmd = append(cmd, peer.Address(ipFam))

return cmd
}

Expand Down

0 comments on commit c4d9fd8

Please sign in to comment.