Commit Graph
28 Commits
Author SHA1 Message Date
David Shulman 087e92da43 Add DefaultCredentials scenario tests
These tests require the client and server to be on a Windows Active Directory domain. These tests are Windows specific. Currently this cannot be done in the CI system. So, these tests are only enabled when an environment variable is set which points to the test server.

There is a separate todo item dotnet/corefx#4989 to provide more automated scripts for setting up the test server. For now, there is a readme file with some details.

These tests will help support fixes for dotnet/corefx#8176 and related bugs.


Commit migrated from https://github.com/dotnet/corefx/commit/4739da8c8d4965fdaf2fc45ae915297208672d15
2016-05-03 15:53:33 -07:00
Eric St. John b1119fb4ef Cleanup usage of Linux/OSX
We've standardized on using Unix in most cases where we only cross-
compile once for Unix.  This change cleans up mentions of Linux/OSX when
we aren't actually cross-compiling for those OSes.

The remaining projects that still cross-compile for Linux/OSX are:
  System.Diagnostics.Process
  System.IO.FileSystem.Watcher
  System.Net.NetworkInformation

The System.Net.Security functional tests seem to still have a distinct
difference in functional behavior on OSX so I have also left these
configured to cross-compile for Linux/OSX.


Commit migrated from https://github.com/dotnet/corefx/commit/16ee317fa4e194ff7cf61e923caf103909e391f1
2016-04-26 14:37:21 -07:00
stephentoub 6c4c36cd4d Add several outerloop HttpClient tests
Several "mini-stress" tests that verify HttpClient doesn't completely fall over under some load:
- Use one HttpClient instance to make many requests serially and in parallel
- Use multiple HttpClient instances to make many requests serially and in parallel
- Ensure that HttpResponseMessages can be GCd even if the associated response hasn't been fully drained.  This one fails right now on unix due to an open issue.


Commit migrated from https://github.com/dotnet/corefx/commit/4358712d3db870725a394478702e643018af52bf
2016-04-22 18:22:41 -04:00
David Shulman dbbd669af6 Initial System.Net.Http 4.1 contract
To support important customer scenarios for CoreFx RTM, we will be updating the System.Net.Http contract from 4.0 to 4.1. We are focusing on HttpClientHandler enhancements.

We will be submitting the final proposed list of additions as part of issue dotnet/corefx#7623. As part of updating the contract to 4.1, we are also OOB'ing the Desktop (net46 Windows) implementation so that the package won't be a facade over Desktop but rather a full implementation. This is possible since System.Net.Http has always been a standalone dll in the .NET Framework. As part of this, we are changing the implementation for Desktop from the legacy HttpWebRequest sockets stack to the WinHttpHandler stack based on native WinHTTP. This will give us a good path forward as WinHttpHandler stack will be getting HTTP/2.0 support with newer versions of Windows 10.

This initial PR has a few API additions that we are definitely going to be adding. It's important to get these changes into the builds so that we can fully bake the OOB Http.dll assembly on all the platforms and continue package testing.

There is an existing System.Net.Http.WebRequestHandler class in the .NET Framework located in System.Net.Http.WebRequest.dll. This class is a subclass of HttpClientHandler. Due to this, we are being careful not to cause collisions with some of these added properties. WebRequestHandler has a 'ClientCertificates' property and a 'ServerCertificateValidationCallback' property. So, we are aligning/renaming the properties as we add them to HttpClientHandler OOB assembly. This may get altered slightly as we finalize the 4.1 System.Net.Http API.


Commit migrated from https://github.com/dotnet/corefx/commit/97c940eec1f6afe3e4af31e72d79c3a11e7b1ff1
2016-04-13 09:50:34 -07:00
Stephen Toub d3980a698e Merge pull request dotnet/corefx#7523 from ellismg/run-tests
Remove "UnsupportedPlatforms" metadata

Commit migrated from https://github.com/dotnet/corefx/commit/0cdc8e39f80a749bfa25eb559ab014be4f7ec557
2016-04-06 09:21:15 -04:00
Matt Ellis e631e1c680 Remove UnsupportedPlatforms metadata
Commit migrated from https://github.com/dotnet/corefx/commit/f5252c0c0d19622132e0edcf0b64783b798e3bbf
2016-04-05 14:38:52 -07:00
stephentoub 8b16b341a4 Add CurlHandler.MaxResponseHeadersLength
Adds the MaxResponseHeadersLength property.


Commit migrated from https://github.com/dotnet/corefx/commit/8840bc7b3961cbaae547da068bd47d452a8a5dfe
2016-04-05 09:53:41 -04:00
stephentoub bf66904b51 Add CurlHandler.MaxConnectionsPerServer option
Adds MaxConnectionsPerServer to CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/cf89034e4425fcd5bc4d00819e29c8c06a47d954
2016-04-04 22:18:07 -04:00
Stephen Toub 4b74e9a08a Merge pull request dotnet/corefx#7503 from stephentoub/curlhandler_defaultproxycredentials
Add CurlHandler.DefaultProxyCredentials

Commit migrated from https://github.com/dotnet/corefx/commit/4bd8d0fcacce9a49a44c9b32022e892c109c7e15
2016-04-04 20:08:20 -04:00
stephentoub 15ccbd065a Add CurlHandler.ConnectTimeout
Adds a timeout to the connection phase of CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/6880dca258fa33448983f6046b5b727ad1d56c27
2016-04-04 18:30:10 -04:00
stephentoub 63e8f36b90 Add CurlHandler.DefaultProxyCredentials
Commit migrated from https://github.com/dotnet/corefx/commit/256ecaf347b5e2b809722d1acbfb7bff1902bf06
2016-04-04 18:26:44 -04:00
Stephen Toub ba8bf6c2cd Add CurlHandlers.SslProtocols option
Add CurlHandlers.SslProtocols option

With libcurl on the OpenSSL backend (the recommended configuration), we can provide full-fidelity for this option.  With libcurl on another SSL backend, we can allow choosing all three TLS protcols or just one TLS protocol, but we can't support selecting two of the three.

Commit migrated from https://github.com/dotnet/corefx/commit/bd79e80f25923e0f2e29e07aba60b03070596bb4
2016-04-04 17:27:18 -04:00
stephentoub 436bbdf105 Add HttpClientHandler tests for server certificates
Commit migrated from https://github.com/dotnet/corefx/commit/65a4486bfe44c633c2e4dad6dabc6688bea16cc2
2016-03-23 14:10:19 -04:00
Kevin Jones c428584581 Fix typo in file name.
Commit migrated from https://github.com/dotnet/corefx/commit/af8c01f507c9227a8a11fb752c7df2142f7b4044
2016-03-18 12:45:24 -04:00
stephentoub 6154fe40a2 Add HttpClientHandler test for proxies
We don't currently have any functional tests in the repo for using HTTP proxies.  This commit adds a very simple loopback GET request proxy server, just enough to verify that HttpClient does go through the specified proxy and pass credentials if requested.  If/when we get better infrastructure in place for this kind of thing, we can remove the proxy implementation and replace the test, but for now, this at least provides some automated verification cross-platform.


Commit migrated from https://github.com/dotnet/corefx/commit/db2d84b0bb4032ca21b8e7c9cfd96056ffddbab2
2016-03-03 08:23:57 -05:00
David Shulman 1127bdc413 Add more Http response stream tests
Building on PR dotnet/corefx#6250, added more response stream tests dealing with
invalid response body transfer semantics.


Commit migrated from https://github.com/dotnet/corefx/commit/42e5f468e86f7d62fe1c62194bfd473d30cf06b7
2016-02-20 19:21:10 -08:00
nbilling 4401926ae3 Http request/response DiagnosticSource logging.
- Added logging to WinHttpHandler, CurlHandler, and HttpHandlerToFilter
  for HTTP request/response.
- Added functional tests for HttpClient (WinHttpHandler is exercised by
  these tests on desktop).


Commit migrated from https://github.com/dotnet/corefx/commit/edbd7ba720699bbe20753872ac430f0b3fdaf3a9
2016-02-16 15:57:17 -05:00
stephentoub fd5d04a4d4 Remove "workaround" P2P TODOs from .csproj files
In the past we've added some temporary P2P references to workaround lack of bug fixes in packages.  Removing them as they're no longer needed.


Commit migrated from https://github.com/dotnet/corefx/commit/ba939973c07af13b01fe3b4f34e0a31eac6f90c7
2016-01-25 14:41:34 -05:00
stephentoub 1c94eb73f6 Workaround bugs until new packages are available
Several bugs are causing tests to fail.  Those bugs have been fixed, but the fixes aren't yet available in the packages being targeted by other test libraries breaking because of the bugs. This temporarily works around it by using a P2P reference to skip the packages.


Commit migrated from https://github.com/dotnet/corefx/commit/5eb4a0405e16f1cc7d2488f9106f644141f62de5
2016-01-23 11:37:09 -05:00
Wes Haggard f27c7dc024 Update project files adding default configurations
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.

Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.

Removed OutputType=Library property as it isn't necessary.


Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
2016-01-02 23:50:21 -08:00
David Shulman df05d9fc0f Rename HttpTestServers2.cs to HttpTestServers.cs
Commit migrated from https://github.com/dotnet/corefx/commit/36acb05abd55f62aad0c18bc6ede2cef1c58628e
2015-11-09 11:20:41 -08:00
David Shulman b14cd70e12 Cleanup System.Net.Http tests
* Move more tests to the new test server
* Cleanup 'var' coding patterns
* Remove duplicate tests (*Content clas related) that are already covered with the *Content class tests
* Utiilize the newer test server VerifyUpload endpoint which does 'Content-MD5' verification of transmitted payload to the server
as well as payload from the server
* Add GZip related tests in addition to Deflate compression schemes


Commit migrated from https://github.com/dotnet/corefx/commit/773c8ae1db5aa7e5d695a74fb63968382f8529da
2015-11-09 07:05:24 -08:00
David Shulman c8432253b4 Add HttpClient tests to support all HTTP verbs
Added tests for validating against all standard and custom HTTP verbs. These tests use the new networking test server.

Cosolidated some existing tests that were duplicative. More test porting and reorganzing will be done in later PRs.


Commit migrated from https://github.com/dotnet/corefx/commit/057f0a9bc938606f9e3a24a51f64f3a4fd9bbb55
2015-10-27 15:03:29 -07:00
David Shulman 779afbe587 Fix hang when writing request stream in WinHttpHandler
WinHttpHandler was hanging due to blocking on the WinHTTP status callback thread. The blocking was coming from a task continuation resuming on the same thread and subsequently calling a blocking Stream.Write method in a custom HttpContent class being written onto the request stream.

Blocking is not allowed on the WinHTTP callback thread. So any task continuations need to occur on a different thread. The fix is to create the TaskCompletionSources to use RunContinuationsAsynchronously. This allows them to unblock the WinHTTP thread. Additionally, I added some missing ConfigureAwait(false) settings to some await'd operations.

Added a new test which uses a custom HttpContent class that uses a blocking Write() call when serializing onto the request stream.

Fix dotnet/corefx#4077


Commit migrated from https://github.com/dotnet/corefx/commit/babb7c6c65bf1e02dab667cbda80f0e24af21ed8
2015-10-22 16:44:06 -07:00
stephentoub ba9fea449f Reorganize src\Common\tests
Our common tests folder has gotten a bit unwieldy in its organization.  This change simply moves files around to better map to how src\Common\src is organized.  Files are now stored in a path based on functionality/namespace.

I mostly kept groups of functionality together and did not attempt to reorganize at that level, e.g. I moved the src\Common\tests\System.Xml.XPath\ folder to be src\Common\tests\System\Xml\XPath\ and did not further reorganize all of the folders/files it contains.  Such cleanup can be done separately on each individual area.

Some of the files also need to be cleaned up internally, e.g. the namespace (or lack thereof), so I put such things in a path that I thought made sense even if it differs from the current namespace in the file; I wanted this change to be relatively simple and just be about moving files around to clean up the main hierarchy.


Commit migrated from https://github.com/dotnet/corefx/commit/9a5546c439f7700d3462564678aa4206c7fbf4f1
2015-10-11 15:44:39 -04:00
David Shulman d27860b628 Add more tests for System.Net.Http library
Ported more HTTP related tests.  These tests focus mostly on POST
scenarios mixed with authentication, pre-authentication, and the
"rewind-ability" of content if it needs to be re-POST'd due to AUTH
challeges by the server.

Added a new HttpTestServers2 class to Common/tests/System/Net. This is a
point-in-time thing as we improve the test infrastructure capability. In
particular, we are moving away from the use of the "httpbin.org" server.
Our new networking test server that we are bringing up has more features
than httpbin.org. It can support all the main HTTP verbs when doing "echo"
of request headers. It includes a "Content-MD5" HTTP response header. This
contains a hash of the response body. This makes it easier to validate the
returned payloads. The "httpbin.org" server also has a bug where it does
not properly echo chunked upload headers which was causing issues when
trying to port these tests.

I did not change other networking tests still using "httpbin.org" and the
Common HttpTestServers class. I will be doing that later as we finalize
the test infrastructure.


Commit migrated from https://github.com/dotnet/corefx/commit/f14225a7355bdae2468bb3c28562da0a0976f206
2015-10-07 10:49:56 -07:00
David Shulman a6002ce802 Add more HTTP tests
* Add more tests ported from the internal ToF tests.
* Cleanup existing tests to be consistent in style and format as it has
drifted due to many different people working on the tests.
* Disposing the HttpClient object will dispose the handler as well so we
don't need multiple 'using' statements unless we are explicitly testing
dispose ordering semantics.


Commit migrated from https://github.com/dotnet/corefx/commit/ad55c1d5685afc4009cb2481fcc7c5e4f4a551f8
2015-09-30 20:11:07 -07:00
David Shulman 9d997536f4 Port additional System.Net.Http tests to CoreFx
Added more http tests to open source from the original internal ToF tests. Some of
the tests should be refactored in the future to avoid Assert'ing multiple
logical things.

Fixed up test namespaces for System.Net.Http and
System.Net.Http.WinHttpHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/e5a017cb6ca01e99b1f1462298bc0cbf60c06ee0
2015-09-21 11:48:34 -07:00