diff --git a/sdk/core/perf/inc/azure/perf/base_test.hpp b/sdk/core/perf/inc/azure/perf/base_test.hpp index cf9ecac329..19816c332e 100644 --- a/sdk/core/perf/inc/azure/perf/base_test.hpp +++ b/sdk/core/perf/inc/azure/perf/base_test.hpp @@ -51,7 +51,15 @@ namespace Azure { namespace Perf { * * @param proxy A test-proxy server url. */ - void SetTestProxy(std::string const& proxy) { m_proxy = proxy; } + void SetTestProxy(std::string const& proxy) + { + if (!proxy.empty()) + { + // we need to allow for certificate verification failures due to presence of test proxy. + m_isInsecureEnabled = true; + m_proxy = proxy; + } + } /** * @brief Set the performance test to run insecure. diff --git a/sdk/core/perf/src/base_test.cpp b/sdk/core/perf/src/base_test.cpp index c0695cb716..4a74f180f5 100644 --- a/sdk/core/perf/src/base_test.cpp +++ b/sdk/core/perf/src/base_test.cpp @@ -137,7 +137,6 @@ namespace Azure { namespace Perf { void BaseTest::PostSetUp() { - if (!m_proxy.empty()) { Azure::Core::_internal::ClientOptions clientOp; @@ -192,7 +191,6 @@ namespace Azure { namespace Perf { Azure::Core::Http::Request request(Azure::Core::Http::HttpMethod::Post, startPlayback); request.SetHeader("x-recording-id", m_recordId); auto response = pipeline.Send(request, ctx); - auto const& headers = response->GetHeaders(); auto findHeader = std::find_if( headers.begin(), diff --git a/sdk/core/perf/src/options.cpp b/sdk/core/perf/src/options.cpp index 59fad4ebde..44921c84dc 100644 --- a/sdk/core/perf/src/options.cpp +++ b/sdk/core/perf/src/options.cpp @@ -65,6 +65,7 @@ std::vector Azure::Perf::GlobalTestOptions::GetOptionMe {"-d", "--duration"}, "Duration of the test in seconds. Default to 10 seconds.", 1}, + {"help", {"-h", "--help"}, "Display help information.", 0}, {"Host", {"--host"}, "Host to redirect HTTP requests. No redirection by default.", 1}, {"Insecure", {"--insecure"}, "Allow untrusted SSL certs. Default to false.", 0}, {"Iterations", @@ -83,8 +84,9 @@ std::vector Azure::Perf::GlobalTestOptions::GetOptionMe 1}, {"Port", {"--port"}, "Port to redirect HTTP requests. Default to no redirection.", 1}, {"Rate", {"-r", "--rate"}, "Target throughput (ops/sec). Default to no throughput.", 1}, - {"Warmup", {"-w", "--warmup"}, "Duration of warmup in seconds. Default to 5 seconds.", 1}, + + {"Sync", {"-y", "--sync"}, "Runs sync version of test, not implemented", 0}, {"TestProxies", {"-x", "--test-proxies"}, "URIs of TestProxy Servers (separated by ';')", 1}, - {"help", {"-h", "--help"}, "Display help information.", 0}, - {"Sync", {"-y", "--sync"}, "Runs sync version of test, not implemented", 0}}; + {"Warmup", {"-w", "--warmup"}, "Duration of warmup in seconds. Default to 5 seconds.", 1}, + }; } diff --git a/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential_test.hpp b/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential_test.hpp index 3dde3e470e..581b032201 100644 --- a/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential_test.hpp +++ b/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential_test.hpp @@ -41,6 +41,10 @@ namespace Azure { namespace Identity { namespace Test { m_clientId = m_options.GetMandatoryOption("ClientId"); m_secret = m_options.GetMandatoryOption("Secret"); m_tokenRequestContext.Scopes.push_back(m_options.GetMandatoryOption("Scope")); + if (!m_options.GetOptionOrDefault("Cache", false)) + { + m_tokenRequestContext.MinimumExpiration = std::chrono::hours(1000000); + } m_credential = std::make_unique( m_tenantId, m_clientId, @@ -73,10 +77,11 @@ namespace Azure { namespace Identity { namespace Test { std::vector GetTestOptions() override { return { - {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, + {"Cache", {"--cache"}, "Use credential cache.", 1, false}, {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, + {"Scope", {"--scope"}, "One scope to request access to.", 1, true}, {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}, - {"Scope", {"--scope"}, "One scope to request access to.", 1, true}}; + {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}}; } /**