Родитель
6d77ab85dc
Коммит
d609c00412
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче