From a8d9fdce3c6e2bf4966841f46c9fa8fe04d1e0e8 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 13 Aug 2021 11:01:23 +0100 Subject: [PATCH] Uncomment ping test --- integration_test.go | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/integration_test.go b/integration_test.go index c920a7e9..dd96fb82 100644 --- a/integration_test.go +++ b/integration_test.go @@ -286,30 +286,30 @@ func (s *IntegrationTestSuite) TestStatus() { } } -// func (s *IntegrationTestSuite) TestPingAllPeers() { -// ips, err := getIPs() -// assert.Nil(s.T(), err) -// -// for hostname, tailscale := range tailscales { -// for peername, ip := range ips { -// s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) { -// // We currently cant ping ourselves, so skip that. -// if peername != hostname { -// command := []string{"tailscale", "ping", "--timeout=1s", "--c=1", ip.String()} -// -// fmt.Printf("Pinging from %s (%s) to %s (%s)\n", hostname, ips[hostname], peername, ip) -// result, err := executeCommand( -// &tailscale, -// command, -// ) -// assert.Nil(t, err) -// fmt.Printf("Result for %s: %s\n", hostname, result) -// assert.Contains(t, result, "pong") -// } -// }) -// } -// } -// } +func (s *IntegrationTestSuite) TestPingAllPeers() { + ips, err := getIPs() + assert.Nil(s.T(), err) + + for hostname, tailscale := range tailscales { + for peername, ip := range ips { + s.T().Run(fmt.Sprintf("%s-%s", hostname, peername), func(t *testing.T) { + // We currently cant ping ourselves, so skip that. + if peername != hostname { + command := []string{"tailscale", "ping", "--timeout=1s", "--c=1", ip.String()} + + fmt.Printf("Pinging from %s (%s) to %s (%s)\n", hostname, ips[hostname], peername, ip) + result, err := executeCommand( + &tailscale, + command, + ) + assert.Nil(t, err) + fmt.Printf("Result for %s: %s\n", hostname, result) + assert.Contains(t, result, "pong") + } + }) + } + } +} func getIPs() (map[string]netaddr.IP, error) { ips := make(map[string]netaddr.IP)