Skip to content

Commit

Permalink
feat: add ipv6 test to optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Apr 2, 2023
1 parent a20883e commit b583bf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dummy-iface:
sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
sudo ip link add dev dummy0 type dummy
sudo ip addr add dev dummy0 192.0.2.1/24
sudo ip addr add dev dummy0 2001:db8::1/64
sudo ip link set dev dummy0 up

peeringdb-test-harness:
Expand Down
5 changes: 2 additions & 3 deletions pkg/optimizer/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ func sendPing(source string, target string, count int, timeout int, udp bool) (*
pinger.SetPrivileged(!udp)

// Run the ping
err = pinger.Run()
if err != nil {
return &ping.Statistics{}, err
if err = pinger.Run(); err != nil {
return &ping.Statistics{}, fmt.Errorf("ping: %s", err)
}

return pinger.Statistics(), nil // nil error
Expand Down
1 change: 1 addition & 0 deletions tests/probe-simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ optimizer:
cache-size: 3
targets:
- 192.0.2.2
- 2001:db8::2
alert-script: ../tests/alert-test.sh

peers:
Expand Down

0 comments on commit b583bf1

Please sign in to comment.