Fixed AV in attestation tests (#4480)

* Fixed AV in attestation tests

* Fixed another test AV
This commit is contained in:
Larry Osterman 2023-04-06 11:03:39 -07:00 committed by GitHub
parent 779c268a7f
commit b4be76fec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View File

@ -53,7 +53,10 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {
virtual void TearDown() override
{
// Reset the attestation policy for this instance back to the default.
m_adminClient->ResetAttestationPolicy(AttestationType::Tpm);
if (m_adminClient)
{
m_adminClient->ResetAttestationPolicy(AttestationType::Tpm);
}
// Make sure you call the base classes TearDown method to ensure recordings are made.
TestBase::TearDown();

View File

@ -16,12 +16,15 @@ void Azure::Core::Test::TestBase::TearDown()
{
return;
}
if (m_testProxy->IsRecordMode())
if (m_testProxy)
{
m_testProxy->StopPlaybackRecord(TestMode::RECORD);
}
if (m_testProxy->IsPlaybackMode())
{
m_testProxy->StopPlaybackRecord(TestMode::PLAYBACK);
if (m_testProxy->IsRecordMode())
{
m_testProxy->StopPlaybackRecord(TestMode::RECORD);
}
if (m_testProxy->IsPlaybackMode())
{
m_testProxy->StopPlaybackRecord(TestMode::PLAYBACK);
}
}
}

View File

@ -268,8 +268,11 @@ namespace Azure { namespace Core { namespace Test {
auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext);
checkResponseCode(response->GetStatusCode());
auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length"));
CheckBodyFromStream(*response, expectedResponseBodySize);
if (response->GetStatusCode() == Http::HttpStatusCode::Ok)
{
auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length"));
CheckBodyFromStream(*response, expectedResponseBodySize);
}
}
TEST_P(TransportAdapter, getChunkWithStream)