Revert MultipleCrlOperations test to the previous version (#4238)
* Experiment with CI and MultipleCrlOperations test * Switch to an older, less failure-proof version of the test from yesterday * Switch Ubuntu18 to Azure Pipelines as well * Undo CI changes just to make sure it fails * Apply CI machine pool changes * Move Ubuntu20 to general pool * Move Ubuntu20 to general pool * Move Ubuntu20 to perf pool * Revert all changes in platform-matrix.json Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com> Co-authored-by: Mike Harder <mharder@microsoft.com>
This commit is contained in:
parent
ff53067dd3
commit
fe29302583
@ -524,20 +524,16 @@ namespace Azure { namespace Core { namespace Test {
|
||||
#endif
|
||||
}
|
||||
|
||||
// This test started to fail consistently in CI on Linux.
|
||||
// It should be fixed, but to unblock CI, there is a workaround below.
|
||||
#if !defined(AZ_PLATFORM_LINUX)
|
||||
TEST_F(TransportAdapterOptions, MultipleCrlOperations)
|
||||
{
|
||||
// LetsEncrypt certificates don't contain a distribution point URL extension. While this seems
|
||||
// to work when run locally, it fails in the CI pipeline. "https://www.wikipedia.org" uses a
|
||||
// LetsEncrypt certificate, so when testing manually, it is important to add it to the list.
|
||||
std::vector<std::pair<std::string, bool>> testUrls{
|
||||
{AzureSdkHttpbinServer::Get(), true}, // Uses a Microsoft/DigiCert certificate.
|
||||
{"https://aws.amazon.com", true}, // Uses a Amazon/Starfield Technologies certificate.
|
||||
// {"https://www.example.com/", true}, // Uses a DigiCert certificate. Does not work
|
||||
// correctly from Linux as of 2023-01-09.
|
||||
{"https://www.google.com/", true}, // Uses a google certificate.
|
||||
std::vector<std::string> testUrls{
|
||||
AzureSdkHttpbinServer::Get(), // Uses a Microsoft/DigiCert certificate.
|
||||
"https://aws.amazon.com", // Uses a Amazon/Starfield Technologies certificate.
|
||||
"https://www.example.com/", // Uses a DigiCert certificate.
|
||||
"https://www.google.com/", // Uses a google certificate.
|
||||
};
|
||||
|
||||
GTEST_LOG_(INFO) << "Basic test calls.";
|
||||
@ -548,27 +544,17 @@ namespace Azure { namespace Core { namespace Test {
|
||||
transportOptions.EnableCertificateRevocationListCheck = false;
|
||||
HttpPipeline pipeline(CreateHttpPipeline(transportOptions));
|
||||
|
||||
for (auto& target : testUrls)
|
||||
for (auto const& target : testUrls)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "Test " << target.first;
|
||||
Azure::Core::Url url(target.first);
|
||||
GTEST_LOG_(INFO) << "Test " << target;
|
||||
Azure::Core::Url url(target);
|
||||
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url);
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> response;
|
||||
try
|
||||
EXPECT_NO_THROW(
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext));
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext);
|
||||
}
|
||||
catch (Azure::Core::Http::TransportException& ex)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "Error " << ex.what() << " accessing site " << target.first;
|
||||
target.second = false;
|
||||
}
|
||||
if (target.second)
|
||||
{
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -585,19 +571,15 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
for (auto const& target : testUrls)
|
||||
{
|
||||
// Only try to access the server if we were able to contact it earlier.
|
||||
if (target.second)
|
||||
GTEST_LOG_(INFO) << "Test " << target;
|
||||
Azure::Core::Url url(target);
|
||||
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url);
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> response;
|
||||
EXPECT_NO_THROW(
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext));
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "Test " << target.first;
|
||||
Azure::Core::Url url(target.first);
|
||||
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url);
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> response;
|
||||
EXPECT_NO_THROW(
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext));
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -614,23 +596,19 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
for (auto const& target : testUrls)
|
||||
{
|
||||
if (target.second)
|
||||
GTEST_LOG_(INFO) << "Test " << target;
|
||||
Azure::Core::Url url(target);
|
||||
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url);
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> response;
|
||||
EXPECT_NO_THROW(
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext));
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "Test " << target.first;
|
||||
Azure::Core::Url url(target.first);
|
||||
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url);
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> response;
|
||||
EXPECT_NO_THROW(
|
||||
response = pipeline.Send(request, Azure::Core::Context::ApplicationContext));
|
||||
if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found)
|
||||
{
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_F(TransportAdapterOptions, TestRootCertificate)
|
||||
{
|
||||
@ -937,4 +915,5 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
EXPECT_THROW(proxyServer.IsAlive(), Azure::Core::Http::TransportException);
|
||||
}
|
||||
|
||||
}}} // namespace Azure::Core::Test
|
||||
|
||||
Loading…
Reference in New Issue
Block a user