47 Commits
Author SHA1 Message Date
Filip Navara 7ea8460025 Make the DnsTest more resilient to multi-IP DNS results (#13737)
Sometimes Google DNS is/was returning "dns.google" for reverse query of 8.8.8.8 and 8.8.4.4 instead of the expected "google-public-dns-a.google.com" and "google-public-dns-b.google.com". Since "dns.google" resolves to both 8.8.8.8 and 8.8.4.4 in random order the round-trip tests for IP -> hostname -> IP were failing when they got the other IP.

This changes the logic in the hostname -> IP check to check whether the expected IP is any one of the returned ones (ie. non necessarily the first one).
2019-03-29 14:54:49 +01:00
Egor Bogatov cf69b47259 NS2.1: System.IO, System.Reflection.Emit, etc (#12854)
* System.IO, System.Data

* lots of small ns21 improvements

* More changes (System.Reflection.Emit)

* Add IEquatable to S.R.Emit types

* bump corefx

* fix unix build

* more NS21 changes

* more changes

* bump corefx

* Fix failing tests (Sockets)

* bump corefx

* tmp workaround

* move DispatchProxyGenerator to net_4_x

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-14 22:40:58 +01:00
Alexis Christoforides ec4c990af3 [System.Net] Replace use of obsolete SupportsIPv6 property.
The obsolete property was always set to false. Fixes https://github.com/mono/mono/issues/6940
2018-03-16 12:23:45 -04:00
Jonathan Peppers a5248e5e11 [bcl] bringing back InetAccess test category
This partially reverts 9b4b6d6211

Xamarin.Android’s QA team has a need to run on-device tests in cases
where the device does not have an internet connection.

I also marked a few tests with `InetAccess` indicated from a past test
run here:
http://xqa.blob.core.windows.net/gist/log-1481cb7679ce4db0a305a551ff7f4e18.txt
2017-11-14 11:37:12 +01:00
Rodrigo Kumpera 9092eac2ea Improve test assert. 2017-04-05 14:18:26 -07:00
Rodrigo Kumpera 1fb2ab2244 [System] Disable a few tests that don't work on Android. 2017-04-05 14:18:26 -07:00
Rolf Bjarne Kvinge e6536dd5e1 [System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)
* [System] Fix line endings for a few files.

Best reviewed by not showing whitespace changes (should be empty diff in that case).

* [System] Fix potential crash in CookieParserTests.

Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.

* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.

* [System.Net.Http] Tweak tests after watchOS API change.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Extract the HttpListenerResponseHelper class to a separate file.

Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.

* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.

* [System] Tweak tests after watchOS API changes.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Fix potential crash in SocketAcceptAsyncTest.

Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).

* [System] Avoid logic in SetUp attributes in tests.

Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.

This even happens for tests that do not need the logic in the [SetUp]
attribute.

So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.

* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.

* [System] Remove Obsolete attribute on API that throws PNSE.
2016-09-27 13:13:38 +02:00
Rolf Bjarne Kvinge c213a51b70 [System] Rewrite Dns tests so that failures don't cause the process to crash.
Previously the tests were written so that some failures might occur on the
threadpool in methods that did not catch exceptions. In that case the process
would terminate due to an unhandled exception. So rewrite the tests to catch
exceptions in any code that doesn't run on the main thread, and forward those
exceptions to the main thread.

Also wait for async operations to complete on the main thread, and remove
asserts that are not supposed to be hit.
2016-09-14 17:37:42 +02:00
Rolf Bjarne Kvinge 51de6e83eb [System*] Add category for tests that use API that require BSD sockets.
We don't have access to BSD sockets on watchOS, so that API
doesn't work.

With this category we'll be able to exclude these tests.
2016-07-26 13:20:51 +02:00
Sebastien Pouliot 4d3ebc5a19 [System][tests] Make sure Dns tests works in a mixed IPv4/IPv6 network too
Previous tweak could disable some tests in a mixed network, e.g.
if an IPv6 address was first but an IPv4 address was available.
2016-05-11 17:50:01 -04:00
Sebastien Pouliot 2114a13b23 [System][tests] Tweak Dns unit tests so it does not fail on an IPv6 only network
Some existing tests only works when IPv4 is available, which was fine as
it match how we historically ran those tests.

Apple has a new requirement [1] to test under an "IPv6 only network" and
the change facilitate this.

[1] https://developer.apple.com/news/?id=05042016a
2016-05-11 09:11:17 -04:00
Alexander Köplinger 202806306b [System] Switch DNS tests to a more stable domain/IP
info.diku.dk stopped resolving today. Use Google's public DNS server instead which should be much more stable.
2016-03-05 00:09:13 +01:00
Alexander Köplinger 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01:00
Zoltan Varga 03aee949f1 Merge pull request #1200 from akoeplinger/remove-jvm
[Cleanup] Remove TARGET_JVM
2014-08-28 19:17:43 -04:00
Jo Shields 7178ce2c40 Switch to using jenkins.mono-project.com for DNS tests
This test requires a simple single mapping for Hostname<->IP with one IP and reverse DNS. Using EC2-hosted sites doesn't work as they don't have valid reverse DNS. Use the Jenkins subdomain, since that fits the criteria.
2014-08-20 07:20:41 +01:00
Alexander Köplinger a81feba777 [System] Use xamarin.com instead of mono-project.com for DNS tests
The latter is now hosted on a different IP behind a CDN and the IP may change depending on location.
Using xamarin.com instead fixes the tests for now.
2014-08-14 01:21:20 +02:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Jonathan Pryor 365da8343a [System] Fix DnsTest.GetHostByName() test.
Test Case Failures:
	1) MonoTests.System.Net.DnsTest.GetHostByName : Should raise a SocketException (assuming that 'www.unlikely.novell.com' does not exist)
	  at MonoTests.System.Net.DnsTest.GetHostByName () [0x00089] in /Users/jon/Development/mono-HEAD/mono/mcs/class/System/Test/System.Net/DnsTest.cs:212
	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
	  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/jon/Development/mono-HEAD/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230

As it happens, 'www.unlikely.novell.com' DOES exist:

	$ ping www.unlikely.novell.com
	PING www.unlikely.novell.com (199.101.28.20): 56 data bytes
	64 bytes from 199.101.28.20: icmp_seq=0 ttl=57 time=29.399 ms

Apparently it's due to the "www." prefix; remove "www." and the site
isn't found, as expected:

	$ ping unlikely.novell.com
	ping: cannot resolve unlikely.novell.com: Unknown host

Update DnsTest.noneExistingSite so that the DnsTest.GetHostByName()
test passes.
2013-07-25 11:38:09 -04:00
Zoltan Varga 64773d70c5 Fix a DNS test. 2012-08-11 02:20:21 +02:00
Marek Safar 667e99b26f Fix failing dns tests 2012-07-05 09:00:46 +01:00
Martin Baulig a6b9cd4858 DnsTest.cs: Add workaround for t-online.de's DNS server. 2012-07-02 18:42:24 +02:00
Martin Baulig 6a87f40b24 Fix go-mono.com's IP address in DnsTest.cs.
go-mono.com has 50.21.183.68, not 74.208.222.19.
2012-07-02 18:31:56 +02:00
Martin Baulig 504e2341ba Implement Dns.GetHostEntry(string.Empty) on Mac OS.
* configure.in: Add check for getifaddrs().

* socket-io.c: Implement get_local_ips() using getifaddrs()
  if SIOCGIFCONF is not available.

* DnsTest.cs: Add GetHostEmpty_StringEmpty().

* UdpClientTest.cs(): Enable Available(), BeginReceive() and BeginSend()
  on the Mac.
2012-06-27 04:20:04 +02:00
Neil Stalker c28729348c Test passes on Mono and MS, no need to ignore 2012-03-24 16:36:59 +00:00
Neil Stalker 21457db456 Fix test data 2012-03-23 21:50:12 +00:00
Gonzalo Paniagua Javier 22c4252482 fix test
svn path=/trunk/mcs/; revision=132956
2009-04-29 05:41:25 +00:00
Gonzalo Paniagua Javier 35c3b48ade 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* DnsTest.cs: new IP for go-mono and fix AsyncResolve test.


svn path=/trunk/mcs/; revision=132294
2009-04-21 17:01:42 +00:00
Gert Driesen 7cbe766dac * DnsTest.cs: Use Assert syntax, and spaces to tabs. Added tests
for argument checks.
* Dns.cs: BeginGetHostAddresses - renamed argument to match MS,
reject "any" IP addresses. BeginGetHostEntry - renamed argument
to match MS, reject "any" IP addresses. GetHostEntry - reject
"any" IP addresses. GetHostAddresses - reject "any" IP addresses.
GetHostByName - use "hostName" as paramname in ANE.

svn path=/trunk/mcs/; revision=126281
2009-02-08 19:43:44 +00:00
Paolo Molaro f51d258fc9 www.go-mono.com changed ip address.
svn path=/trunk/mcs/; revision=89456
2007-11-12 10:50:55 +00:00
Konstantin Triger 57c46b8f0e TARGET_JVM: ignore failures in Sys.Net
svn path=/trunk/mcs/; revision=76626
2007-05-03 16:34:41 +00:00
Dick Porter c76e1d8426 2006-11-07 Dick Porter <[email protected]>
* DnsTest.cs: GetHostByAddressString5() should only throw
        SocketException on pre-2.0 profiles



svn path=/trunk/mcs/; revision=67498
2006-11-07 21:26:42 +00:00
Dick Porter d842bc4e62 2006-11-03 Dick Porter <[email protected]>
* DnsTest.cs: Re-enable GetHostEntry



svn path=/trunk/mcs/; revision=67314
2006-11-03 16:34:03 +00:00
Zoltan Varga 0e0cebc85a 2006-10-22 Zoltan Varga <[email protected]>
* DnsTest.cs: Disable GetHostEntry test as it currently fails.

svn path=/trunk/mcs/; revision=66882
2006-10-22 14:17:08 +00:00
Atsushi Eno c6966cfecc 2006-03-28 Atsushi Enomoto <[email protected]>
* Dns.cs : filled missing NET_2_0 members.

	* DnsTest.cs : added test for GetHostEntry.


svn path=/trunk/mcs/; revision=58635
2006-03-28 01:10:54 +00:00
Sebastien Pouliot be4b24991b 2005-05-19 Sebastien Pouliot <[email protected]>
* DnsCas.cs: New. CAS unit tests for Dns.
	* DnsTest.cs: Fixed the wrong End* method being used in AsyncResolve.
	* FileWebRequestCas.cs: New. CAS unit tests for FileWebRequest.
	* HttpWebRequestCas.cs: New. CAS unit tests for HttpWebRequest.
	* WebRequestTest.cs: Added tests to validate exceptions.


svn path=/trunk/mcs/; revision=44754
2005-05-19 15:08:29 +00:00
Nick Drochak c7d6a68aa5 2005-01-28 Nick Drochak <[email protected]>
* DnsTest.cs: Pick a URL we can most likely fail against.

svn path=/trunk/mcs/; revision=39700
2005-01-28 13:31:55 +00:00
David Sheldon 1b346dbec5 2004-10-10 David Sheldon <[email protected]>
* DnsTest.cs: Updated IP for www.go-mono.com.

svn path=/trunk/mcs/; revision=34847
2004-10-10 17:31:01 +00:00
Nick Drochak b59a4cf5c2 2003-12-30 Nick Drochak <[email protected]>
* DnsTest.cs: Update with new IP address for www.go-mono.com and make
	test failure output more informative. All Tests pass for me on
	.NET 1.1.
	* HttpWebRequestTest.cs: Get rid of WriteLines and use Asserts to make
	it a proper unit test.

svn path=/trunk/mcs/; revision=21556
2003-12-30 14:23:49 +00:00
Martin Willemoes Hansen 2320c1fddc * Removed: Old AllTests.cs files
* NUnit20ified the tests.

svn path=/trunk/mcs/; revision=12666
2003-03-18 21:45:41 +00:00
Lawrence Pit 543a620ce4 * Dnstest.cs: added test for asynchronous methods
svn path=/trunk/mcs/; revision=4605
2002-05-13 20:04:19 +00:00
Nick Drochak 4a7a062712 2002-05-05 Nick Drochak <[email protected]>
* AllTests.cs:
	* BasicOperationsTest.cs:
	* DnsTest.cs:
	* NameValueCollectionTest.cs:
	* StringCollectionTest.cs:
	* TheTests.cs:
	* System.Text.RegularExpressions/AllTests.cs:
	* System.Text.RegularExpressions/PerlTest.cs:
	* System.Text.RegularExpressions/PerlTrials.cs:
	* System.Text.RegularExpressions/RegexTrial.cs: Fix Namespace
	inconsistancies.  Use MonoTests instead of Ximian.Mono.Tests

svn path=/trunk/mcs/; revision=4299
2002-05-05 10:14:38 +00:00
Martin Baulig b5189359b3 2002-02-27 Martin Baulig <[email protected]>
* System_test.build: Build new executable RunTests.System.exe which you can
	use to run the tests on Linux.

	* NameValueCollectionTest.cs: Split out BasicOperationTest into
	BasicOperationTest.cs.

	* AllTests.cs: Use namespace Ximian.Mono.Tests.System instead of
	Ximian.Mono.Tests.

	* DnsTest.cs: Put this into namespace Ximian.Mono.Tests.Systeam.
	* NameValueCollectionTest.cs: Likewise.
	* StringCollectionTest.cs: Likewise.

svn path=/trunk/mcs/; revision=2732
2002-02-27 15:00:14 +00:00
Mads Pultz bde18438b4 Added implementation for System.Net.Dns.BeginResolve() and System.Net.Dns.EndResolve(). Test also included.
svn path=/trunk/mcs/; revision=2312
2002-02-11 10:12:25 +00:00
Miguel de Icaza db1bb4f4eb Mostly changes to get System.dll compiling again. Removes a bunch
of excludes, and now we actually build things.

2002-01-17  Miguel de Icaza  <[email protected]>

	* Win32Exception.cs: Add.

2002-01-17  Miguel de Icaza  <[email protected]>

	* TraceListenerCollection.cs: Remove Warnings.

2002-01-17  Miguel de Icaza  <[email protected]>

	* Dns.cs: Updated to API changes.

	* IPAddress.cs: Updated API.  Much left to implement.

	* Dns.cs: Remove IPToString method

2002-01-17  Miguel de Icaza  <[email protected]>

	* SocketException.cs: Reimplemented.

svn path=/trunk/mcs/; revision=2023
2002-01-17 18:51:01 +00:00
Mads Pultz e9f5a497c9 * Dns.cs: Initial work on BeginGetHostByName and EndGetHostByName implemented.
* DnsTest.cs: initial tests of BeginGetHostByName and EndGetHostByName implemented.

svn path=/trunk/mcs/; revision=964
2001-09-26 04:53:42 +00:00
Mads Pultz 6242fd93db * DnsTest.cs: now tests GetHostByAddress, GetHostByName, IpToString and Resolve.
* Dns.cs: Minor changes (some print statements removed).

svn path=/trunk/mcs/; revision=937
2001-09-24 03:40:55 +00:00
Mads Pultz 5223d3f2f0 * DnsTest.cs: Initial work submitted to repository.
* IPHostEntryTest.cs: Initial work submitted to repository.
---------------------------------------------------------------------

svn path=/trunk/mcs/; revision=930
2001-09-23 08:27:17 +00:00