Commit Graph
288 Commits
Author SHA1 Message Date
Marcos Henrich 36c9c006bc Merge pull request #1298 from esdrubal/uploadfileasync
Fixes missing ContentType on WebClient.UploadFileTaskAsync
2014-10-28 18:21:22 +00:00
Zoltan Varga 6e27f984ab [bcl] Use random ports for the HttpListener tests. 2014-10-02 23:29:53 -04:00
Miguel de Icaza c6ab899595 [System] Fix most warnings on the System test suite 2014-09-24 10:43:46 -04:00
Marcos Henrich b89b5c46d6 Test WebClient.UploadFileTaskAsync ContentType. Covers 19529. 2014-09-23 15:30:50 +01:00
Alexander Köplinger ddcfc42070 Cleanup namespace names of class lib tests to follow convention
A couple of the test suites didn't follow the MonoTests.<namespace of class under test> naming convention for the namespace.
2014-09-04 18:55:58 +02: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
Alexander Köplinger 2bacb92d36 [System] Fixed HttpWebRequest test that sometimes failed
The TestTimeoutPropertyWithServerThatDoesntExist test sometimes failed with a 'ConnectFailure' instead of a 'Timeout'.
As per the discussion in PR #1145, the test should actually check that a ConnectFailure is thrown before the timeout is reached.
This proved unreliable with the 10.128.200.100 IP address, as it was up to the networking stack to decide whether the endpoint can be reached,
which can take quite a long time (sometimes >100secs).

Instead, we now use the loopback address with a port where no service listens, which should be equivalent.

Additionally, the assert which checks for the correct exception switched the 'expected' and 'actual' parameter, which resulted in the wrong output, this is fixed as well.
2014-07-07 23:53:50 +02:00
Alexander Köplinger 4d93cac6d7 [System] Make tests more descriptive on failure
By using StringAssert we get a more descriptive error message when the test fails, i.e. the expected vs. the actual string value instead of just true/false.
2014-06-26 20:58:15 +02:00
Alexander Köplinger 7b5f4a511f [System] Use the same port number instead of a random port in HttpWebRequestTest
A random port doesn't add any value and resulted in at least one port conflict on monojenkins:
http://monojenkins.cloudapp.net/job/Mono/243/testReport/MonoTests.System.Net/HttpWebRequestTest/BeginGetRequestStreamCancelIfNotAllBytesWritten/
2014-06-22 20:10:17 +02:00
Alexander Köplinger f396d37c54 [System.ServiceModel] Changed test port from 8080 to 30158
Port 8080 is widely used and resulted in address conflicts on monojenkins, so we use a different port instead.

Commit licensed under MIT/X11.
2014-06-17 23:00:42 +02:00
Marek Safar 22ca1862ee Fixes build 2014-06-04 19:02:40 +02:00
Alex Rønne Petersen a0064f9d5a [System] Fix WebClientTest build in net_2_0.
CancellationTokenSource is a 4.0 thing.
2014-06-03 23:33:30 +02:00
marcos henrich 0b1ea4edc9 Test WebClient asynchronous uploads cancellation.
Tests that UploadStringAsync triggers UploadStringCompleted with Cancelled == true.
Tests that UploadDataAsync triggers UploadDataCompleted with Cancelled == true.
Tests that UploadValuesAsync triggers UploadValuesCompleted with Cancelled == true.
Tests that UploadFileAsync triggers UploadFileCompleted with Cancelled == true.
2014-06-02 19:04:43 +01:00
Miguel de Icaza ec3fb70d33 [System] Fix parsing of IPv6 addresses (bug #18574)
From Dick Porter:

The IPv6 address parser misses some syntax errors, and can become confused by
addresses that at first glance look IPv4 compatible.  The attach patch contains
the following fixes:

Don't fail to parse an address if we mistakenly thought it was IPv4 compatible
or mapped, just treat it as IPv6.

Fix IPv4-compatible and mapped address formatting in ToString().

Fix parsing of colons - specifically occurrences of ':::'.

Make sure blocks of digits are no longer than 4 characters.

Add some more parsing tests to Mono's NUnit test suite.

Add a NUnit test for bogus IPv6 addresses.
2014-05-23 11:05:09 -04:00
Zoltan Varga 2c64ed7866 [bcl] Fix System tests. 2014-02-26 12:00:48 -05:00
Alexander Köplinger b0032294da [Test] Cleaned up how a bunch of tests were ignored
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
2014-02-23 19:44:21 +01:00
Miguel de Icaza c86473c2ba Work around DNS problem on the build hosts 2014-02-21 18:09:36 -05:00
Marek Safar 657b95a863 Merge pull request #891 from DavidKarlas/listenerprefix
HttpListener now listens on default ports if not specified instead of random
2014-02-17 11:12:04 +01:00
David Karlaš eaed50c0a2 HttpListener now listens on default ports if not specified instead of random 2014-02-16 04:58:32 -08:00
Miguel de Icaza a2339679bc [HttpListener] Only bind to the specified hosts (and support '*' as Any), fixes #17204, #10818 2014-02-12 12:08:10 -05:00
Marek Safar 1a33c018d1 [system] Updates to WebUtility decoders and encoders 2014-02-11 16:50:14 +01:00
Alexander Köplinger daf2340d47 [System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
The property was introduced with PR #870 but it missed to convert network byte order to host byte order, so the comparison
wasn't working correctly and the corresponding unit test failed. @marek-safar erroneously "fixed" the test in 27e07c7.

This is the corrected implementation and the original test now works as intended.
2014-02-01 22:02:27 +01:00
Marek Safar 27e07c76d8 Fixes failing test 2014-01-14 14:45:38 +01:00
Fredrick Galoso d27abb23af [system] Add IsIPv6Teredo to System.Net.IpAddress
Adds support for checking for an IPv6 Teredo address, introduced in
.NET Framework 4.
2014-01-11 21:23:50 -06: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
Jonathan Pryor f9d78260db [System] Support FTP download where PWD starts with '\'.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=13343

There are some Industrial Automation Hardware devices which return a
'\'-prefixed path to the FTP PWD command, which would break:

	System.UriFormatException: Invalid URI: The hostname could not be parsed.
	  at System.Uri.Parse (UriKind kind, System.String uriString)
	  at System.Uri.ParseUri (UriKind kind)
	  at System.Uri..ctor (System.String uriString, Boolean dontEscape)
	  at System.Uri..ctor (System.String uriString) [0x0000
	  at System.Net.FtpWebRequest.GetRemoteFolderPath (System.Uri uri)
	  at System.Net.FtpWebRequest.CWDAndSetFileName (System.Uri uri)
	  at System.Net.FtpWebRequest.ProcessMethod ()
	  at System.Net.FtpWebRequest.ProcessRequest ()
	There was an error connecting to the FTP Server.

The problem was this statement:

	Uri initial = new Uri ("ftp://dummy-host" + initial_path);

Since the FTP server was returning "\" to the PWD command,
`initial_path` was "\", and the above was equivalent to:

	Uri initial = new Uri (@"ftp://dummy-host\");

This results in the UriFormatException.

The solution is to not assume that `initial_path` will start with '/',
and instead use UriBuilder.
2013-07-25 11:38:09 -04:00
Rodrigo Kumpera e0f26cc241 Fix the build. 2013-06-26 14:59:45 -04:00
Martin Baulig e181a1a44d [System]: Partially fix #12393. 2013-06-26 01:35:28 +02:00
Andres G. Aragoneses 84202a68bb [HttpWebRequest] Assertion message nitpicks in new timeout tests
The timeout tests I added recently* had a missing assertion message and
one with a couple of typos.

* https://github.com/mono/mono/commit/96be7828510a1fb14dab07eed1e93dc1a3a7dd84
2013-05-17 00:48:10 +01:00
Marek Safar 0e5dd1f51a Merge pull request #617 from knocte/httpwebrequest_playground
[HttpWebRequest] Add timeout tests that cover BNC#317553 (ximian#74177)
2013-04-22 01:23:44 -07:00
Andres G. Aragoneses 96be782851 [HttpWebRequest] Add timeout tests that cover BNC#317553 (ximian #74177)
The pull-request that was merged [1] intending to fix BXC#1183 [2] was
later reverted [3] because it broke a scenario that wasn't covered by tests.

This commits creates a couple of tests that cover this scenario (which was
implemented back in 2005 [4]) so that we are sure that any further proposed
fixes for bug 1183 [2] don't cause any regression in this area.

[1] https://github.com/mono/mono/commit/8c2167d52cb9acf9582647ebb5f99c92d9127fbd
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=11833
[3] https://github.com/mono/mono/commit/14f0405443693ec2586e73e4b3746134046210d5
[4] https://bugzilla.novell.com/show_bug.cgi?id=317553
2013-04-20 14:29:37 +01:00
Miguel de Icaza 77e58567c1 Add a test for the WebUtility.HtmlEncode bits 2013-03-24 19:18:51 -04:00
Sebastien Pouliot b43764a214 Do not assume the unit tests can write in the application directory (e.g. iOS devices) 2013-03-18 21:30:47 -04:00
Sebastien Pouliot 105f2bd164 Disable CAS permission tests for MOBILE profile 2013-03-18 21:30:29 -04:00
Marek Safar caeba062fd Test clean up 2013-02-26 14:47:39 +01:00
Marek Safar 101a454dfa Fix mobile test 2013-02-26 10:37:02 +01:00
Marek Safar 510f20d376 Fix failing mobile tests 2013-02-26 10:37:01 +01:00
Marek Safar f0ad346fb6 Mobile tests update 2013-02-22 21:41:19 +01:00
Martin Baulig 3a7a355522 [#7637][Web]: This is supposed to fail prior to .NET 4.0.
Fixes my previous commit 1ccb01e.
2012-10-29 15:47:49 +01:00
Martin Baulig 1ccb01e108 [#7637][Web]: Support empty write streams. 2012-10-27 01:15:21 +02:00
Martin Baulig 544176c35e Fix CookieParserTest.TestExpires().
DateTime.MinValue.ToUniversalTime() != DateTime.MinValue
if you're living east of Greenwich.
2012-10-23 07:26:42 +02:00
Martin Baulig 12fccdd7aa Test; testing test failure on buildbot. 2012-10-23 02:43:17 +02:00
Martin Baulig 68b64e775a Test; testing buildbot. 2012-10-23 00:51:22 +02:00
Marek Safar 4a8ffc8023 Merge pull request #456 from strawd/bug7079
Don't decode raw URL path for HTTP request URI
2012-09-13 07:46:37 -07:00
Martin Baulig cabf7d1f13 Fixed and improved Mono's Cookie implementation.
* Updated the tests to reflect .NET 4.5's new improved behavior.
* Fixed subdomain matching rules.
* Added some very simple sanity checks, such as same origin and
  public suffixes.

This is far from perfect, but the tests now pass with .NET 4.5
and this also fixes a Monotouch bug from one of our customers.

TODO:

* Using 'Cookie.Version = 1' (RFC 2109 compliance) apparently got
  broken in .NET 4.5; I disabled the corresponding tests / made
  them use the default 'Version = 0' where possible.

* Same origin has not been tested for security (it previously
  didn't exist at all) and we should probably use the list at
  publicsuffix.org; but .NET 4.5 also allows you to set a cookie
  .co.uk (haven't tested their web stack, thoug - it's possible
  that they have additional checks there).
2012-09-13 02:00:56 +02:00
David Straw ead7975580 Added unit test for HTTP request URL decode 2012-09-12 16:30:14 -06:00
Zoltan Varga 64773d70c5 Fix a DNS test. 2012-08-11 02:20:21 +02:00