Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add HttpClient test with IPv6 Uris #8467

Merged
merged 2 commits into from
May 12, 2016

Conversation

stephentoub
Copy link
Member

Adds support to the loopback server for binding to IPv6 local addresses, then adds a test that uses both ::1 and a link-local address for the current machine.

cc: @davidsh, @ericeil, @mellinoe, @mikeharder
(Relies on #8462; won't pass on Unix until that's merged.)

{
if (t.IsFaulted) tcs.SetException(t.Exception.InnerExceptions);
else if (t.IsCanceled) tcs.SetCanceled();
else if (Interlocked.Decrement(ref remaining) == 0) tcs.SetResult(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Our coding guidelines currently don't permit these single line if/else statements but rather require braces, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll expand it.

@davidsh
Copy link
Contributor

davidsh commented May 12, 2016

LGTM

@stephentoub
Copy link
Member Author

Test Innerloop OSX Debug Build and Test please (build machine went offline)
Test Innerloop OSX Release Build and Test please (build machine went offline)

@stephentoub
Copy link
Member Author

@mmitche, do our Ubuntu VMs have IPv6 enabled? These tests pass for me locally, but when trying to bind to an IPv6 address, it's failing in the lab:

System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_IPv6Uri_Success(address: fe80::20d:3aff:fe32:2f5d) [FAIL]
        System.Net.Sockets.SocketException : Invalid argument
        Stack Trace:
              at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
              at System.Net.Sockets.Socket.Bind(EndPoint localEP)
              at System.Net.Http.Functional.Tests.LoopbackServer.CreateServerAsync(Func`3 funcAsync, IPEndPoint& localEndPoint, Options options)

@davidsh
Copy link
Contributor

davidsh commented May 12, 2016

do our Ubuntu VMs have IPv6 enabled? These tests pass for me locally, but when trying to bind to an IPv6 address, it's failing in the lab

This brings up an interesting issue. In the past, we (networking team) had to deal with IPv4 and/or IPv6 being disabled/un-installed when doing networking things in .NET Framework. The current version of Windows, for example, can probably still disable (not un-install) IPv6 protocol bindings. Sounds like you can do similar in *Nix.

So, we should make sure our code is resilient to this and add tests for it. I suggest "unit" tests and not functional tests because then you can easily simulate a machine with only IPv4 and no IPv6 and v.v.

@davidsh
Copy link
Contributor

davidsh commented May 12, 2016

cc: @CIPop

@mmitche
Copy link
Member

mmitche commented May 12, 2016

How would I find out?

@mmitche
Copy link
Member

mmitche commented May 12, 2016

@dotnet-bot test this please

@stephentoub
Copy link
Member Author

Oh, nevermind, it is enabled. The problem is that the fix I made yesterday to ensure that the scope ID is included in an IPAddress isn't yet in the package for System.Net.NetworkInformation being used by this test suite. Once we move to the newer packages, this should be fixed.

Adds support to the loopback server for binding to IPv6 local addresses, then adds a test that uses both ::1 and a link-local address for the current machine.
@stephentoub stephentoub merged commit 0b51fd2 into dotnet:master May 12, 2016
@stephentoub stephentoub deleted the linklocal_uri_test branch May 13, 2016 10:42
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…test

Add HttpClient test with IPv6 Uris

Commit migrated from dotnet/corefx@0b51fd2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants