Feat: HEALTH_ADDRESS_TO_PING variable
- Defaults to `1.1.1.1` - Add more Ping integration tests with different addresses - Add unit test pinging 127.0.0.1 - Add comment explaining why we need to use ICMP instead of UDP
This commit is contained in:
@@ -9,11 +9,10 @@ type Pinger interface {
|
||||
Stop()
|
||||
}
|
||||
|
||||
func newPinger() (pinger *ping.Pinger) {
|
||||
const addrToPing = "1.1.1.1"
|
||||
func newPinger(addrToPing string) (pinger *ping.Pinger) {
|
||||
const count = 1
|
||||
pinger = ping.New(addrToPing)
|
||||
pinger.Count = count
|
||||
pinger.SetPrivileged(true)
|
||||
pinger.SetPrivileged(true) // see https://github.com/go-ping/ping#linux
|
||||
return pinger
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user