* redo PR

* fdedws

* added logging
This commit is contained in:
George Arama 2024-08-15 16:13:21 -07:00 коммит произвёл GitHub
Родитель 6d77ab85dc
Коммит d609c00412
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 81 добавлений и 6 удалений

Просмотреть файл

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/keyvault",
"Tag": "cpp/keyvault_e1582c490f"
"Tag": "cpp/keyvault_ae1c1474ad"
}

Просмотреть файл

@ -572,7 +572,33 @@ TEST_F(KeyVaultCertificateClientTest, BackupRestoreCertificate)
auto result = response.PollUntilDone(m_defaultWait);
EXPECT_EQ(result.Value.Name(), certificateName);
client.PurgeDeletedCertificate(certificateName);
std::this_thread::sleep_for(m_defaultWait);
TestSleep(m_defaultWait);
}
{
int retries = 15;
// before we restore we need to ensure the certificate is purged.
// since we have no visibility into the purge status we will just wait and check for a few
// seconds
while (retries > 0)
{
try
{
client.GetDeletedCertificate(certificateName);
}
catch (Azure::Core::RequestFailedException const&)
{
std::cout << std::endl << "- Certificate is gone";
break;
}
TestSleep(m_defaultWait);
retries--;
}
if (retries == 0)
{
std::cout << std::endl << "retries reached 0";
EXPECT_TRUE(false);
}
}
{
auto responseRestore = client.RestoreCertificateBackup(certBackup.Value.Certificate);

Просмотреть файл

@ -49,10 +49,33 @@ TEST_F(KeyVaultKeyClient, BackupKey)
auto response = client.PurgeDeletedKey(keyName);
CheckValidResponse(response, Azure::Core::Http::HttpStatusCode::NoContent);
// Purge can take up to 2 min
TestSleep(4min);
TestSleep(m_testPollingIntervalMs);
}
{ // Check key is gone
EXPECT_THROW(client.GetKey(keyName), Azure::Core::RequestFailedException);
{
int retries = 15;
// before we restore we need to ensure the key is purged.
// since we have no visibility into the purge status we will just wait and check for a few
// seconds
while (retries > 0)
{
try
{
client.GetDeletedKey(keyName);
}
catch (Azure::Core::RequestFailedException const&)
{
std::cout << std::endl << "- Key is gone";
break;
}
TestSleep(m_testPollingIntervalMs);
retries--;
}
if (retries == 0)
{
std::cout << std::endl << "retries reached 0";
EXPECT_TRUE(false);
}
}
{
// Restore

Просмотреть файл

@ -184,7 +184,33 @@ TEST_F(KeyVaultSecretClientTest, BackupRestore)
{
auto purgedResponse = client.PurgeDeletedSecret(secretName);
CheckValidResponse(purgedResponse, Azure::Core::Http::HttpStatusCode::NoContent);
TestSleep(4min);
TestSleep(m_defaultWait);
}
{
int retries = 15;
// before we restore we need to ensure the secret is purged.
// since we have no visibility into the purge status we will just wait and check for a few
// seconds
while (retries > 15)
{
try
{
client.GetDeletedSecret(secretName);
}
catch (Azure::Core::RequestFailedException const&)
{
std::cout << std::endl << "- Secret is gone";
break;
}
TestSleep(m_defaultWait);
retries--;
}
if (retries == 0)
{
std::cout << std::endl << "retries reached 0";
EXPECT_TRUE(false);
}
}
{
auto restore = client.RestoreSecretBackup(backupData);