Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Therning <niklas@therning.org>2016-11-22 16:27:59 +0300
committerNiklas Therning <niklas@therning.org>2016-11-22 16:27:59 +0300
commit39c699b54a54012554001ec3896092d7e74dfbd3 (patch)
tree1ef8fb437d82bf9e5b8e56ea1bed2c6bf15aa30d /mcs/class/System/Test
parent3592a79dc8bcd50d166d9fc8fc589fde3005f999 (diff)
Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal
This test creates an HttpListener for every IP address of all network interfaces. On Windows disconnected network interfaces have unroutable IP addresses (169.254.XXX.XXX) and this test fails when it tries to listen to such an IP address. This patch adds a check to the test to ignore network interfaces which don't have OperationalStatus == Up.
Diffstat (limited to 'mcs/class/System/Test')
-rw-r--r--mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs b/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs
index d782103f33e..18dedcae32d 100644
--- a/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs
+++ b/mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs
@@ -211,6 +211,8 @@ namespace MonoTests.System.Net
var ips = new List<IPAddress> ();
ips.Add (IPAddress.Loopback);
foreach (var adapter in NetworkInterface.GetAllNetworkInterfaces ()) {
+ if (adapter.OperationalStatus != OperationalStatus.Up)
+ continue;
foreach (var ip in adapter.GetIPProperties ().UnicastAddresses) {
ips.Add (ip.Address);
}