mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-24 16:58:05 +00:00
Add checks to see if we can fetch the ip from map, remove possible null assignment
This commit is contained in:
parent
772541afab
commit
931ef9482b
@ -345,15 +345,16 @@ func (s *IntegrationTestSuite) TestGetIpAddresses() {
|
|||||||
|
|
||||||
for hostname := range scales.tailscales {
|
for hostname := range scales.tailscales {
|
||||||
s.T().Run(hostname, func(t *testing.T) {
|
s.T().Run(hostname, func(t *testing.T) {
|
||||||
ip := ips[hostname]
|
ip, ok := ips[hostname]
|
||||||
|
|
||||||
|
assert.True(t, ok)
|
||||||
|
assert.NotNil(t, ip)
|
||||||
|
|
||||||
fmt.Printf("IP for %s: %s\n", hostname, ip)
|
fmt.Printf("IP for %s: %s\n", hostname, ip)
|
||||||
|
|
||||||
// c.Assert(ip.Valid(), check.IsTrue)
|
// c.Assert(ip.Valid(), check.IsTrue)
|
||||||
assert.True(t, ip.Is4())
|
assert.True(t, ip.Is4())
|
||||||
assert.True(t, ipPrefix.Contains(ip))
|
assert.True(t, ipPrefix.Contains(ip))
|
||||||
|
|
||||||
ips[hostname] = ip
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user