(t *testing.T)
| 3175 | } |
| 3176 | |
| 3177 | func TestRemoteDialIPForLocalInterface(t *testing.T) { |
| 3178 | t.Run("adds local zone for zone-less link-local IPv6", func(t *testing.T) { |
| 3179 | remote := netip.MustParseAddr("fe80::1234") |
| 3180 | local := netip.MustParseAddr("fe80::1%eth0") |
| 3181 | |
| 3182 | got := remoteDialIPForLocalInterface(remote, local) |
| 3183 | require.Equal(t, netip.MustParseAddr("fe80::1234%eth0"), got) |
| 3184 | }) |
| 3185 | |
| 3186 | t.Run("keeps existing remote zone", func(t *testing.T) { |
| 3187 | remote := netip.MustParseAddr("fe80::1234%eth9") |
| 3188 | local := netip.MustParseAddr("fe80::1%eth0") |
| 3189 | |
| 3190 | got := remoteDialIPForLocalInterface(remote, local) |
| 3191 | require.Equal(t, remote, got) |
| 3192 | }) |
| 3193 | |
| 3194 | t.Run("does not modify global IPv6", func(t *testing.T) { |
| 3195 | remote := netip.MustParseAddr("2001:db8::1234") |
| 3196 | local := netip.MustParseAddr("fe80::1%eth0") |
| 3197 | |
| 3198 | got := remoteDialIPForLocalInterface(remote, local) |
| 3199 | require.Equal(t, remote, got) |
| 3200 | }) |
| 3201 | |
| 3202 | t.Run("does not modify zone-less link-local when local has no zone", func(t *testing.T) { |
| 3203 | remote := netip.MustParseAddr("fe80::1234") |
| 3204 | local := netip.MustParseAddr("2001:db8::1") |
| 3205 | |
| 3206 | got := remoteDialIPForLocalInterface(remote, local) |
| 3207 | require.Equal(t, remote, got) |
| 3208 | }) |
| 3209 | } |
| 3210 | |
| 3211 | func TestMDNSQueryTimeout(t *testing.T) { |
| 3212 | t.Run("falls back to default when unset", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…