keepReproInact.
Added functionality to keep the VMs after test is finished. So even if test gets PASS, VMs will be kept there. [Requested by Test Team.]
This commit is contained in:
Родитель
892ed8942a
Коммит
f20831687e
|
@ -104,9 +104,15 @@ try
|
|||
else
|
||||
{
|
||||
Set-Variable -Name EconomyMode -Value $false -Scope Global
|
||||
Set-Variable -Name keepReproInact -Value $false -Scope Global
|
||||
if($keepReproInact)
|
||||
{
|
||||
Set-Variable -Name keepReproInact -Value $true -Scope Global
|
||||
}
|
||||
else
|
||||
{
|
||||
Set-Variable -Name keepReproInact -Value $false -Scope Global
|
||||
}
|
||||
}
|
||||
|
||||
$AzureSetup = $xmlConfig.config.Azure.General
|
||||
LogMsg ("Info : AzureAutomationManager.ps1 - LIS on Azure Automation")
|
||||
LogMsg ("Info : Created test results directory:", $testDir)
|
||||
|
@ -150,6 +156,10 @@ try
|
|||
{
|
||||
LogMsg "*************AZURE SERVICE MANAGEMENT MODE****************"
|
||||
}
|
||||
if($keepReproInact)
|
||||
{
|
||||
LogMsg "PLEASE NOTE: keepReproInact is set. VMs will not be deleted after test is finished even if, test gets PASS."
|
||||
}
|
||||
}
|
||||
if($upload)
|
||||
{
|
||||
|
|
|
@ -2486,16 +2486,22 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
|
|||
$isVMLogsCollected = $true }
|
||||
else
|
||||
{
|
||||
LogMsg "Cleaning up deployed test virtual machines."
|
||||
$isClened = DeleteService -serviceName $hsDetails.ServiceName
|
||||
|
||||
if ($isClened -contains "False")
|
||||
if ( $keepReproInact )
|
||||
{
|
||||
LogMsg "Skipping cleanup due to 'keepReproInact' flag is set."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "CleanUP unsuccessful for $($hsDetails.ServiceName).. Please delete the services manually."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "CleanUP Successful for $($hsDetails.ServiceName).."
|
||||
LogMsg "Cleaning up deployed test virtual machines."
|
||||
$isClened = DeleteService -serviceName $hsDetails.ServiceName
|
||||
if ($isClened -contains "False")
|
||||
{
|
||||
LogMsg "CleanUP unsuccessful for $($hsDetails.ServiceName).. Please delete the services manually."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "CleanUP Successful for $($hsDetails.ServiceName).."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2567,16 +2573,23 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
|
|||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Cleaning up deployed test virtual machines."
|
||||
$isClened = DeleteResourceGroup -RGName $group
|
||||
if (!$isClened)
|
||||
{
|
||||
LogMsg "CleanUP unsuccessful for $group.. Please delete the services manually."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "CleanUP Successful for $group.."
|
||||
}
|
||||
if ( $keepReproInact )
|
||||
{
|
||||
LogMsg "Skipping cleanup due to 'keepReproInact' flag is set."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Cleaning up deployed test virtual machines."
|
||||
$isClened = DeleteResourceGroup -RGName $group
|
||||
if (!$isClened)
|
||||
{
|
||||
LogMsg "CleanUP unsuccessful for $group.. Please delete the services manually."
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "CleanUP Successful for $group.."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче