This commit is contained in:
Shital Savekar 2018-05-17 18:52:43 -07:00
Родитель f86a32aaf3
Коммит 69a3709433
8 изменённых файлов: 217 добавлений и 158 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -6,3 +6,4 @@ iamshital.code-workspace
TestConfiguration.xml
Temp*
report*
UploadStatusFile*

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

@ -25,13 +25,13 @@ param (
[string] $TestPriority,
[string] $osImage,
[switch] $EconomyMode,
[switch] $keepReproInact,
[switch] $KeepReproInact,
[string] $DebugDistro,
[switch] $UseAzureResourceManager,
[string] $OverrideVMSize,
[switch] $EnableAcceleratedNetworking,
[string] $customKernel,
[string] $customLIS,
[string] $CustomKernel,
[string] $CustomLIS,
[string] $customLISBranch,
[string] $resizeVMsAfterDeployment,
[string] $ExistingResourceGroup,
@ -40,10 +40,10 @@ param (
# Experimental Feature
[switch] $UseManagedDisks,
[int] $coureCountExceededTimeout = 3600,
[int] $testIterations = 1,
[string] $tipSessionId="",
[string] $tipCluster="",
[int] $CoreCountExceededTimeout = 3600,
[int] $TestIterations = 1,
[string] $TiPSessionId="",
[string] $TiPCluster="",
[switch] $ForceDeleteResources
)
Get-ChildItem .\Libraries -Recurse | Where-Object { $_.FullName.EndsWith(".psm1") } | ForEach-Object { Import-Module $_.FullName -Force -Global}
@ -63,11 +63,11 @@ Set-Variable -Name PublicConfiguration -Value @() -Scope Global
Set-Variable -Name PrivateConfiguration -Value @() -Scope Global
Set-Variable -Name CurrentTestData -Value $CurrentTestData -Scope Global
Set-Variable -Name preserveKeyword -Value "preserving" -Scope Global
Set-Variable -Name tipSessionId -Value $tipSessionId -Scope Global
Set-Variable -Name tipCluster -Value $tipCluster -Scope Global
Set-Variable -Name TiPSessionId -Value $TiPSessionId -Scope Global
Set-Variable -Name TiPCluster -Value $TiPCluster -Scope Global
Set-Variable -Name global4digitRandom -Value $(Get-Random -SetSeed $(Get-Random) -Maximum 9999 -Minimum 1111) -Scope Global
Set-Variable -Name coureCountExceededTimeout -Value $coureCountExceededTimeout -Scope Global
Set-Variable -Name CoreCountExceededTimeout -Value $CoreCountExceededTimeout -Scope Global
if($EnableAcceleratedNetworking)
{
@ -87,13 +87,13 @@ if ( $OverrideVMSize )
{
Set-Variable -Name OverrideVMSize -Value $OverrideVMSize -Scope Global
}
if ( $customKernel )
if ( $CustomKernel )
{
Set-Variable -Name customKernel -Value $customKernel -Scope Global
Set-Variable -Name CustomKernel -Value $CustomKernel -Scope Global
}
if ( $customLIS )
if ( $CustomLIS )
{
Set-Variable -Name customLIS -Value $customLIS -Scope Global
Set-Variable -Name CustomLIS -Value $CustomLIS -Scope Global
}
if ( $customLISBranch )
{
@ -157,21 +157,21 @@ try
if($EconomyMode)
{
Set-Variable -Name EconomyMode -Value $true -Scope Global
if($keepReproInact)
if($KeepReproInact)
{
Set-Variable -Name keepReproInact -Value $true -Scope Global
Set-Variable -Name KeepReproInact -Value $true -Scope Global
}
}
else
{
Set-Variable -Name EconomyMode -Value $false -Scope Global
if($keepReproInact)
if($KeepReproInact)
{
Set-Variable -Name keepReproInact -Value $true -Scope Global
Set-Variable -Name KeepReproInact -Value $true -Scope Global
}
else
{
Set-Variable -Name keepReproInact -Value $false -Scope Global
Set-Variable -Name KeepReproInact -Value $false -Scope Global
}
}
$AzureSetup = $xmlConfig.config.Azure.General
@ -204,9 +204,9 @@ try
LogMsg "User : $($userIDSplitted[0])-xxxx-xxxx-xxxx-$($userIDSplitted[4])"
LogMsg "ServiceEndpoint : $($SelectedSubscription.Environment.ActiveDirectoryServiceEndpointResourceId)"
LogMsg "CurrentStorageAccount : $($AzureSetup.ARMStorageAccount)"
if($keepReproInact)
if($KeepReproInact)
{
LogMsg "PLEASE NOTE: keepReproInact is set. VMs will not be deleted after test is finished even if, test gets PASS."
LogMsg "PLEASE NOTE: KeepReproInact is set. VMs will not be deleted after test is finished even if, test gets PASS."
}
if ($DebugDistro)
@ -215,7 +215,7 @@ try
Set-Variable -Name DebugOsImage -Value $OsImage -Scope Global
}
$testCycle = GetCurrentCycleData -xmlConfig $xmlConfig -cycleName $cycleName
$testSuiteResultDetails=.\AzureTestSuite.ps1 $xmlConfig -Distro $Distro -cycleName $cycleName -testIterations $testIterations
$testSuiteResultDetails=.\AzureTestSuite.ps1 $xmlConfig -Distro $Distro -cycleName $cycleName -TestIterations $TestIterations
$logDirFilename = [System.IO.Path]::GetFilenameWithoutExtension($xmlConfigFile)
$summaryAll = GetTestSummary -testCycle $testCycle -StartTime $testStartTime -xmlFileName $logDirFilename -distro $Distro -testSuiteResultDetails $testSuiteResultDetails
$PlainTextSummary += $summaryAll[0]

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

@ -1,7 +1,7 @@
#v-shisav : STILL IN BETA VERSION
param($xmlConfig, [string] $Distro, [string] $cycleName, [int] $testIterations)
Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $testIterations )
param($xmlConfig, [string] $Distro, [string] $cycleName, [int] $TestIterations)
Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $TestIterations )
{
$StartTime = [Datetime]::Now.ToUniversalTime()
LogMsg "Starting the Cycle - $($CycleName.ToUpper())"
@ -160,9 +160,9 @@ Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $testIterations )
$originalTestName = $currentTestData.testName
}
# Generate Unique Test
for ( $testIterationCount = 1; $testIterationCount -le $testIterations; $testIterationCount ++ )
for ( $testIterationCount = 1; $testIterationCount -le $TestIterations; $testIterationCount ++ )
{
if ( $testIterations -ne 1 )
if ( $TestIterations -ne 1 )
{
$currentTestData.testName = "$($originalTestName)-$testIterationCount"
$test.Name = "$($originalTestName)-$testIterationCount"
@ -480,4 +480,4 @@ Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $testIterations )
$testSuiteResultDetails
}
RunTestsOnCycle -cycleName $cycleName -xmlConfig $xmlConfig -Distro $Distro -testIterations $testIterations
RunTestsOnCycle -cycleName $cycleName -xmlConfig $xmlConfig -Distro $Distro -TestIterations $TestIterations

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

@ -407,14 +407,14 @@ Function CreateAllResourceGroupDeployments($setupType, $xmlConfig, $Distro, [str
$readyToDeploy = ValidateSubscriptionUsage -subscriptionID $xmlConfig.config.Azure.General.SubscriptionID -RGXMLData $RG
$validateCurrentTime = Get-Date
$elapsedWaitTime = ($validateCurrentTime - $validateStartTime).TotalSeconds
if ( (!$readyToDeploy) -and ($elapsedWaitTime -lt $coureCountExceededTimeout))
if ( (!$readyToDeploy) -and ($elapsedWaitTime -lt $CoreCountExceededTimeout))
{
$waitPeriod = Get-Random -Minimum 1 -Maximum 10 -SetSeed (Get-Random)
LogMsg "Timeout in approx. $($coureCountExceededTimeout - $elapsedWaitTime) seconds..."
LogMsg "Timeout in approx. $($CoreCountExceededTimeout - $elapsedWaitTime) seconds..."
LogMsg "Waiting $waitPeriod minutes..."
sleep -Seconds ($waitPeriod*60)
}
if ( $elapsedWaitTime -gt $coureCountExceededTimeout )
if ( $elapsedWaitTime -gt $CoreCountExceededTimeout )
{
break
}
@ -1113,20 +1113,20 @@ Set-Content -Value "$($indents[0]){" -Path $jsonFile -Force
Add-Content -Value "$($indents[3])^type^: ^Microsoft.Compute/availabilitySets^," -Path $jsonFile
Add-Content -Value "$($indents[3])^name^: ^[variables('availabilitySetName')]^," -Path $jsonFile
Add-Content -Value "$($indents[3])^location^: ^[variables('location')]^," -Path $jsonFile
if ( $tipSessionId -and $tipCluster)
if ( $TiPSessionId -and $TiPCluster)
{
Add-Content -Value "$($indents[3])^tags^:" -Path $jsonFile
Add-Content -Value "$($indents[3]){" -Path $jsonFile
Add-Content -Value "$($indents[4])^TipNode.SessionId^: ^$tipSessionId^" -Path $jsonFile
Add-Content -Value "$($indents[4])^TipNode.SessionId^: ^$TiPSessionId^" -Path $jsonFile
Add-Content -Value "$($indents[3])}," -Path $jsonFile
}
Add-Content -Value "$($indents[3])^properties^:" -Path $jsonFile
Add-Content -Value "$($indents[3]){" -Path $jsonFile
if ( $tipSessionId -and $tipCluster)
if ( $TiPSessionId -and $TiPCluster)
{
Add-Content -Value "$($indents[4])^internalData^:" -Path $jsonFile
Add-Content -Value "$($indents[4]){" -Path $jsonFile
Add-Content -Value "$($indents[5])^pinnedFabricCluster^ : ^$tipCluster^" -Path $jsonFile
Add-Content -Value "$($indents[5])^pinnedFabricCluster^ : ^$TiPCluster^" -Path $jsonFile
Add-Content -Value "$($indents[4])}" -Path $jsonFile
}
Add-Content -Value "$($indents[3])}" -Path $jsonFile
@ -2358,6 +2358,8 @@ Function DeployResourceGroups ($xmlConfig, $setupType, $Distro, $getLogsIfFailed
$i = 0
$role = 1
$setupTypeData = $xmlConfig.config.Azure.Deployment.$setupType
#DEBUGRG
#$isAllDeployed = CreateAllResourceGroupDeployments -setupType $setupType -xmlConfig $xmlConfig -Distro $Distro -region $region -storageAccount $storageAccount -DebugRG "ICA-RG-M1S1-SSTEST-GZBX-636621761998"
$isAllDeployed = CreateAllResourceGroupDeployments -setupType $setupType -xmlConfig $xmlConfig -Distro $Distro -region $region -storageAccount $storageAccount
$isAllVerified = "False"
$isAllConnected = "False"

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

@ -250,16 +250,16 @@ Function ProvisionVMsForLisa($allVMData, $installPackagesOnRoleNames)
}
}
function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUpgrade)
function InstallCustomKernel ($CustomKernel, $allVMData, [switch]$RestartAfterUpgrade)
{
try
{
$currentKernelVersion = ""
$upgradedKernelVersion = ""
$customKernel = $customKernel.Trim()
if( ($customKernel -ne "linuxnext") -and ($customKernel -ne "netnext") -and ($customKernel -ne "proposed") -and ($customKernel -ne "latest") -and !($customKernel.EndsWith(".deb")) -and !($customKernel.EndsWith(".rpm")) )
$CustomKernel = $CustomKernel.Trim()
if( ($CustomKernel -ne "linuxnext") -and ($CustomKernel -ne "netnext") -and ($CustomKernel -ne "proposed") -and ($CustomKernel -ne "latest") -and !($CustomKernel.EndsWith(".deb")) -and !($CustomKernel.EndsWith(".rpm")) )
{
LogErr "Only linuxnext, netnext, proposed, latest are supported. E.g. -customKernel linuxnext/netnext/proposed. Or use -customKernel <link to deb file>, -customKernel <link to rpm file>"
LogErr "Only linuxnext, netnext, proposed, latest are supported. E.g. -CustomKernel linuxnext/netnext/proposed. Or use -CustomKernel <link to deb file>, -CustomKernel <link to rpm file>"
}
else
{
@ -270,9 +270,9 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
foreach ( $vmData in $allVMData )
{
RemoteCopy -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files ".\Testscripts\Linux\$scriptName,.\Testscripts\Linux\DetectLinuxDistro.sh" -username $user -password $password -upload
if ( $customKernel.StartsWith("localfile:"))
if ( $CustomKernel.StartsWith("localfile:"))
{
$customKernelFilePath = $customKernel.Replace('localfile:','')
$customKernelFilePath = $CustomKernel.Replace('localfile:','')
RemoteCopy -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files ".\$customKernelFilePath" -username $user -password $password -upload
}
RemoteCopy -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files ".\Testscripts\Linux\$scriptName,.\Testscripts\Linux\DetectLinuxDistro.sh" -username $user -password $password -upload
@ -280,7 +280,7 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "chmod +x *.sh" -runAsSudo
$currentKernelVersion = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "uname -r"
LogMsg "Executing $scriptName ..."
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName -customKernel $customKernel -logFolder /home/$user" -RunInBackground -runAsSudo
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName -CustomKernel $CustomKernel -logFolder /home/$user" -RunInBackground -runAsSudo
$packageInstallObj = New-Object PSObject
Add-member -InputObject $packageInstallObj -MemberType NoteProperty -Name ID -Value $jobID
Add-member -InputObject $packageInstallObj -MemberType NoteProperty -Name RoleName -Value $vmData.RoleName
@ -299,20 +299,20 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
{
if ( (Get-Job -Id $($job.ID)).State -eq "Running" )
{
$currentStatus = RunLinuxCmd -ip $job.PublicIP -port $job.SSHPort -username $user -password $password -command "tail -n 1 build-customKernel.txt"
$currentStatus = RunLinuxCmd -ip $job.PublicIP -port $job.SSHPort -username $user -password $password -command "tail -n 1 build-CustomKernel.txt"
LogMsg "Package Installation Status for $($job.RoleName) : $currentStatus"
$packageInstallJobsRunning = $true
}
else
{
if ( !(Test-Path -Path "$LogDir\$($job.RoleName)-build-customKernel.txt" ) )
if ( !(Test-Path -Path "$LogDir\$($job.RoleName)-build-CustomKernel.txt" ) )
{
RemoteCopy -download -downloadFrom $job.PublicIP -port $job.SSHPort -files "build-customKernel.txt" -username $user -password $password -downloadTo $LogDir
if ( ( Get-Content "$LogDir\build-customKernel.txt" ) -imatch "CUSTOM_KERNEL_SUCCESS" )
RemoteCopy -download -downloadFrom $job.PublicIP -port $job.SSHPort -files "build-CustomKernel.txt" -username $user -password $password -downloadTo $LogDir
if ( ( Get-Content "$LogDir\build-CustomKernel.txt" ) -imatch "CUSTOM_KERNEL_SUCCESS" )
{
$kernelSuccess += 1
}
Rename-Item -Path "$LogDir\build-customKernel.txt" -NewName "$($job.RoleName)-build-customKernel.txt" -Force | Out-Null
Rename-Item -Path "$LogDir\build-CustomKernel.txt" -NewName "$($job.RoleName)-build-CustomKernel.txt" -Force | Out-Null
}
}
}
@ -323,7 +323,7 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
}
if ( $kernelSuccess -eq $jobCount )
{
LogMsg "Kernel upgraded to `"$customKernel`" successfully in $($allVMData.Count) VM(s)."
LogMsg "Kernel upgraded to `"$CustomKernel`" successfully in $($allVMData.Count) VM(s)."
if ( $RestartAfterUpgrade )
{
LogMsg "Now restarting VMs..."
@ -341,7 +341,7 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
if ($currentKernelVersion -eq $upgradedKernelVersion)
{
LogErr "Kernel version is same after restarting VMs."
if ($customKernel -eq "latest")
if ($CustomKernel -eq "latest")
{
LogMsg "Continuing the tests as default kernel is latest."
$isKernelUpgraded = $true
@ -381,14 +381,14 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
}
}
function InstallcustomLIS ($customLIS, $customLISBranch, $allVMData, [switch]$RestartAfterUpgrade)
function InstallcustomLIS ($CustomLIS, $customLISBranch, $allVMData, [switch]$RestartAfterUpgrade)
{
try
{
$customLIS = $customLIS.Trim()
if( ($customLIS -ne "lisnext") -and !($customLIS.EndsWith("tar.gz")))
$CustomLIS = $CustomLIS.Trim()
if( ($CustomLIS -ne "lisnext") -and !($CustomLIS.EndsWith("tar.gz")))
{
LogErr "Only lisnext and *.tar.gz links are supported. Use -customLIS lisnext -LISbranch <branch name>. Or use -customLIS <link to tar.gz file>"
LogErr "Only lisnext and *.tar.gz links are supported. Use -CustomLIS lisnext -LISbranch <branch name>. Or use -CustomLIS <link to tar.gz file>"
}
else
{
@ -403,7 +403,7 @@ function InstallcustomLIS ($customLIS, $customLISBranch, $allVMData, [switch]$Re
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "chmod +x *.sh" -runAsSudo
$currentlisVersion = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "modinfo hv_vmbus"
LogMsg "Executing $scriptName ..."
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/root/$scriptName -customLIS $customLIS -LISbranch $customLISBranch" -RunInBackground -runAsSudo
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/root/$scriptName -CustomLIS $CustomLIS -LISbranch $customLISBranch" -RunInBackground -runAsSudo
$packageInstallObj = New-Object PSObject
Add-member -InputObject $packageInstallObj -MemberType NoteProperty -Name ID -Value $jobID
Add-member -InputObject $packageInstallObj -MemberType NoteProperty -Name RoleName -Value $vmData.RoleName
@ -422,20 +422,20 @@ function InstallcustomLIS ($customLIS, $customLISBranch, $allVMData, [switch]$Re
{
if ( (Get-Job -Id $($job.ID)).State -eq "Running" )
{
$currentStatus = RunLinuxCmd -ip $job.PublicIP -port $job.SSHPort -username "root" -password $password -command "tail -n 1 build-customLIS.txt"
$currentStatus = RunLinuxCmd -ip $job.PublicIP -port $job.SSHPort -username "root" -password $password -command "tail -n 1 build-CustomLIS.txt"
LogMsg "Package Installation Status for $($job.RoleName) : $currentStatus"
$packageInstallJobsRunning = $true
}
else
{
if ( !(Test-Path -Path "$LogDir\$($job.RoleName)-build-customLIS.txt" ) )
if ( !(Test-Path -Path "$LogDir\$($job.RoleName)-build-CustomLIS.txt" ) )
{
RemoteCopy -download -downloadFrom $job.PublicIP -port $job.SSHPort -files "build-customLIS.txt" -username "root" -password $password -downloadTo $LogDir
if ( ( Get-Content "$LogDir\build-customLIS.txt" ) -imatch "CUSTOM_LIS_SUCCESS" )
RemoteCopy -download -downloadFrom $job.PublicIP -port $job.SSHPort -files "build-CustomLIS.txt" -username "root" -password $password -downloadTo $LogDir
if ( ( Get-Content "$LogDir\build-CustomLIS.txt" ) -imatch "CUSTOM_LIS_SUCCESS" )
{
$lisSuccess += 1
}
Rename-Item -Path "$LogDir\build-customLIS.txt" -NewName "$($job.RoleName)-build-customLIS.txt" -Force | Out-Null
Rename-Item -Path "$LogDir\build-CustomLIS.txt" -NewName "$($job.RoleName)-build-CustomLIS.txt" -Force | Out-Null
}
}
}
@ -447,7 +447,7 @@ function InstallcustomLIS ($customLIS, $customLISBranch, $allVMData, [switch]$Re
if ( $lisSuccess -eq $jobCount )
{
LogMsg "lis upgraded to `"$customLIS`" successfully in all VMs."
LogMsg "lis upgraded to `"$CustomLIS`" successfully in all VMs."
if ( $RestartAfterUpgrade )
{
LogMsg "Now restarting VMs..."
@ -994,23 +994,23 @@ Function DeployVMs ($xmlConfig, $setupType, $Distro, $getLogsIfFailed = $false,
}
$retValue = DeployManagementServices -xmlConfig $xmlConfig -setupType $setupType -Distro $Distro -getLogsIfFailed $getLogsIfFailed -GetDeploymentStatistics $GetDeploymentStatistics -region $region -storageAccount $storageAccount -timeOutSeconds $timeOutSeconds
}
if ( $retValue -and $customKernel)
if ( $retValue -and $CustomKernel)
{
LogMsg "Custom kernel: $customKernel will be installed on all machines..."
$kernelUpgradeStatus = InstallCustomKernel -customKernel $customKernel -allVMData $allVMData -RestartAfterUpgrade
LogMsg "Custom kernel: $CustomKernel will be installed on all machines..."
$kernelUpgradeStatus = InstallCustomKernel -CustomKernel $CustomKernel -allVMData $allVMData -RestartAfterUpgrade
if ( !$kernelUpgradeStatus )
{
LogError "Custom Kernel: $customKernel installation FAIL. Aborting tests."
LogError "Custom Kernel: $CustomKernel installation FAIL. Aborting tests."
$retValue = ""
}
}
if ( $retValue -and $customLIS)
if ( $retValue -and $CustomLIS)
{
LogMsg "Custom LIS: $customLIS will be installed on all machines..."
$LISUpgradeStatus = InstallCustomLIS -customLIS $customLIS -allVMData $allVMData -customLISBranch $customLISBranch -RestartAfterUpgrade
LogMsg "Custom LIS: $CustomLIS will be installed on all machines..."
$LISUpgradeStatus = InstallCustomLIS -CustomLIS $CustomLIS -allVMData $allVMData -customLISBranch $customLISBranch -RestartAfterUpgrade
if ( !$LISUpgradeStatus )
{
LogError "Custom Kernel: $customKernel installation FAIL. Aborting tests."
LogError "Custom Kernel: $CustomKernel installation FAIL. Aborting tests."
$retValue = ""
}
}
@ -1837,9 +1837,9 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
$isVMLogsCollected = $true }
else
{
if ( $keepReproInact )
if ( $KeepReproInact )
{
LogMsg "Skipping cleanup due to 'keepReproInact' flag is set."
LogMsg "Skipping cleanup due to 'KeepReproInact' flag is set."
}
else
{
@ -1870,11 +1870,11 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
GetVMLogs -allVMData $allDeploymentData
}
$isVMLogsCollected = $true
if(!$keepUserDirectory -and !$keepReproInact -and $EconomyMode)
if(!$keepUserDirectory -and !$KeepReproInact -and $EconomyMode)
{
RemoveAllFilesFromHomeDirectory -allDeployedVMs $allVMData
}
if($keepReproInact)
if($KeepReproInact)
{
$xmlConfig.config.Azure.Deployment.$setupType.isDeployed = "NO"
}
@ -1886,7 +1886,7 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
{
LogMsg "Collecting VM logs.."
GetVMLogs -allVMData $allDeploymentData
if($keepReproInact)
if($KeepReproInact)
{
$xmlConfig.config.Azure.Deployment.$setupType.isDeployed = "NO"
}
@ -1936,9 +1936,9 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
}
else
{
if ( $keepReproInact )
if ( $KeepReproInact )
{
LogMsg "Skipping cleanup due to 'keepReproInact' flag is set."
LogMsg "Skipping cleanup due to 'KeepReproInact' flag is set."
}
else
{
@ -1970,11 +1970,11 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
GetVMLogs -allVMData $allVMData
}
$isVMLogsCollected = $true
if(!$keepUserDirectory -and !$keepReproInact -and $EconomyMode)
if(!$keepUserDirectory -and !$KeepReproInact -and $EconomyMode)
{
RemoveAllFilesFromHomeDirectory -allDeployedVMs $allVMData
}
if($keepReproInact)
if($KeepReproInact)
{
$xmlConfig.config.Azure.Deployment.$setupType.isDeployed = "NO"
}

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

@ -5,31 +5,39 @@ Param(
#Required
[string] $TestLocation="westeurope",
[string] $RGIdentifier = "TEST",
[string] $RGIdentifier = "SSTEST",
[string] $TestPlatform = "Azure",
[string] $ARMImageName = "Canonical UbuntuServer 16.04-LTS latest",
#Optinal
[string] $OsVHD, #... Required if -ARMImageName is not provided.
[string] $TestCategory = "",
[string] $TestArea,
[string] $TestCategory = "Performance",
[string] $TestArea = "Network",
[string] $TestTag = "",
[string] $TestNames="VERIFY-DEPLOYMENT-PROVISION",
[string] $TestNames="PERF-NETWORK-TCP-LATENCY-MULTICONNECTION",
[switch] $Verbose,
[string] $CustomKernel = "",
[string] $OverrideVMSize = "Standard_D1_v2",
[string] $CustomLIS,
[string] $CoreCountExceededTimeout,
[int] $TestIterations,
[string] $TiPSessionId,
[string] $TiPCluster,
#Swithces
[switch] $keepReproInact
#Toggles
[switch] $KeepReproInact,
[switch] $EnableAcceleratedNetworking,
[switch] $ForceDeleteResources,
[switch] $UseManagedDisks
)
#Import the Functinos from Library Files.
Get-ChildItem .\Libraries -Recurse | Where-Object { $_.FullName.EndsWith(".psm1") } | ForEach-Object { Import-Module $_.FullName -Force -Global }
LogVerbose "Set-Variable -Name WorkingDirectory -Value (Get-Location).Path -Scope Global"
try
{
#region Validate Parameters
LogVerbose "Set-Variable -Name WorkingDirectory -Value (Get-Location).Path -Scope Global"
$ParameterErrors = @()
if ( !$TestPlatform )
{
@ -389,9 +397,57 @@ try
Move-Item -Path "*.exe" -Destination .\tools -ErrorAction SilentlyContinue -Force
#endregion
LogMsg ".\AutomationManager.ps1 -xmlConfigFile '$xmlFile' -cycleName TC-$shortRandomNumber -RGIdentifier $RGIdentifier -runtests -UseAzureResourceManager"
.\AutomationManager.ps1 -xmlConfigFile "$xmlFile" -cycleName "TC-$shortRandomNumber" -RGIdentifier $RGIdentifier -runtests -UseAzureResourceManager -keepReproInact
#region Prepare execution command
$command = ".\AutomationManager.ps1 -xmlConfigFile '$xmlFile' -cycleName 'TC-$shortRandomNumber' -RGIdentifier '$RGIdentifier' -runtests -UseAzureResourceManager"
if ( $CustomKernel)
{
$command += " -CustomKernel '$CustomKernel'"
}
if ( $OverrideVMSize )
{
$cmd += " -OverrideVMSize $OverrideVMSize"
}
if ( $EnableAcceleratedNetworking )
{
$cmd += " -EnableAcceleratedNetworking"
}
if ( $ForceDeleteResources )
{
$cmd += " -ForceDeleteResources"
}
if ( $KeepReproInact )
{
$cmd += " -KeepReproInact"
}
if ( $CustomLIS)
{
$cmd += " -CustomLIS $CustomLIS"
}
if ( $CoreCountExceededTimeout )
{
$cmd += " -CoreCountExceededTimeout $CoreCountExceededTimeout"
}
if ( $TestIterations -gt 1 )
{
$cmd += " -TestIterations $TestIterations"
}
if ( $TiPSessionId)
{
$cmd += " -TiPSessionId $TiPSessionId"
}
if ( $TiPCluster)
{
$cmd += " -TiPCluster $TiPCluster"
}
if ($UseManagedDisks)
{
$cmd += " -UseManagedDisks"
}
Invoke-Expression -Command $command
#TBD Analyse the test result
#TBD Archive the logs
#TBD Email the reports

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

@ -49,8 +49,8 @@ ICA_TESTFAILED="TestFailed" # Error occurred during the test
#
#######################################################################
if [ -z "$customKernel" ]; then
echo "Please mention -customKernel next"
if [ -z "$CustomKernel" ]; then
echo "Please mention -CustomKernel next"
exit 1
fi
if [ -z "$logFolder" ]; then
@ -63,7 +63,7 @@ fi
LogMsg()
{
echo `date "+%b %d %Y %T"` : "${1}" # Add the time stamp to the log message
echo "${1}" >> $logFolder/build-customKernel.txt
echo "${1}" >> $logFolder/build-CustomKernel.txt
}
UpdateTestState()
@ -72,7 +72,7 @@ UpdateTestState()
}
touch $logFolder/build-customKernel.txt
touch $logFolder/build-CustomKernel.txt
CheckInstallLockUbuntu()
{
@ -90,10 +90,10 @@ CheckInstallLockUbuntu()
InstallKernel()
{
sleep 10
if [ "${customKernel}" == "linuxnext" ]; then
if [ "${CustomKernel}" == "linuxnext" ]; then
kernelSource="https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git"
sourceDir="linux-next"
elif [ "${customKernel}" == "proposed" ]; then
elif [ "${CustomKernel}" == "proposed" ]; then
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux" /etc/{issue,*release,*version}`
if [[ $DISTRO =~ "Xenial" ]];
then
@ -101,8 +101,8 @@ InstallKernel()
echo "deb http://archive.ubuntu.com/ubuntu/ xenial-proposed restricted main multiverse universe" >> /etc/apt/sources.list
rm -rf /etc/apt/preferences.d/proposed-updates
LogMsg "Installing linux-image-generic from proposed repository."
apt -y update >> $logFolder/build-customKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-customKernel.txt 2>&1
apt -y update >> $logFolder/build-CustomKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
elif [[ $DISTRO =~ "Trusty" ]];
then
@ -110,8 +110,8 @@ InstallKernel()
echo "deb http://archive.ubuntu.com/ubuntu/ trusty-proposed restricted main multiverse universe" >> /etc/apt/sources.list
rm -rf /etc/apt/preferences.d/proposed-updates
LogMsg "Installing linux-image-generic from proposed repository."
apt -y update >> $logFolder/build-customKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-customKernel.txt 2>&1
apt -y update >> $logFolder/build-CustomKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
fi
UpdateTestState $ICA_TESTCOMPLETED
@ -122,16 +122,16 @@ InstallKernel()
LogMsg "CUSTOM_KERNEL_SUCCESS"
UpdateTestState $ICA_TESTCOMPLETED
fi
elif [ "${customKernel}" == "latest" ]; then
elif [ "${CustomKernel}" == "latest" ]; then
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux" /etc/{issue,*release,*version}`
if [[ $DISTRO =~ "Ubuntu" ]];
then
LogMsg "Installing linux-image-generic from repository."
apt -y update >> $logFolder/build-customKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-customKernel.txt 2>&1
apt -y update >> $logFolder/build-CustomKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-CustomKernel.txt 2>&1
LogMsg "Installing linux-image-generic from proposed repository."
apt -y update >> $logFolder/build-customKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-customKernel.txt 2>&1
apt -y update >> $logFolder/build-CustomKernel.txt 2>&1
apt -y --fix-missing upgrade >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
fi
UpdateTestState $ICA_TESTCOMPLETED
@ -142,25 +142,25 @@ InstallKernel()
LogMsg "CUSTOM_KERNEL_SUCCESS"
UpdateTestState $ICA_TESTCOMPLETED
fi
elif [ "${customKernel}" == "netnext" ]; then
elif [ "${CustomKernel}" == "netnext" ]; then
kernelSource="https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git"
sourceDir="net-next"
elif [[ $customKernel == *.deb ]]; then
LogMsg "Custom Kernel:$customKernel"
elif [[ $CustomKernel == *.deb ]]; then
LogMsg "Custom Kernel:$CustomKernel"
apt-get update
if [[ $customKernel =~ "http" ]];then
if [[ $CustomKernel =~ "http" ]];then
CheckInstallLockUbuntu
apt-get install wget
LogMsg "Debian package web link detected. Downloading $customKernel"
wget $customKernel
LogMsg "Installing ${customKernel##*/}"
dpkg -i "${customKernel##*/}" >> $logFolder/build-customKernel.txt 2>&1
LogMsg "Debian package web link detected. Downloading $CustomKernel"
wget $CustomKernel
LogMsg "Installing ${CustomKernel##*/}"
dpkg -i "${CustomKernel##*/}" >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
else
CheckInstallLockUbuntu
prefix="localfile:"
LogMsg "Installing ${customKernel#$prefix}"
dpkg -i "${customKernel#$prefix}" >> $logFolder/build-customKernel.txt 2>&1
LogMsg "Installing ${CustomKernel#$prefix}"
dpkg -i "${CustomKernel#$prefix}" >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
fi
@ -172,20 +172,20 @@ InstallKernel()
LogMsg "CUSTOM_KERNEL_SUCCESS"
UpdateTestState $ICA_TESTCOMPLETED
fi
elif [[ $customKernel == *.rpm ]]; then
LogMsg "Custom Kernel:$customKernel"
elif [[ $CustomKernel == *.rpm ]]; then
LogMsg "Custom Kernel:$CustomKernel"
if [[ $customKernel =~ "http" ]];then
if [[ $CustomKernel =~ "http" ]];then
yum -y install wget
LogMsg "RPM package web link detected. Downloading $customKernel"
wget $customKernel
LogMsg "Installing ${customKernel##*/}"
rpm -ivh "${customKernel##*/}" >> $logFolder/build-customKernel.txt 2>&1
LogMsg "RPM package web link detected. Downloading $CustomKernel"
wget $CustomKernel
LogMsg "Installing ${CustomKernel##*/}"
rpm -ivh "${CustomKernel##*/}" >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
else
prefix="localfile:"
LogMsg "Installing ${customKernel#$prefix}"
rpm -ivh "${customKernel#$prefix}" >> $logFolder/build-customKernel.txt 2>&1
LogMsg "Installing ${CustomKernel#$prefix}"
rpm -ivh "${CustomKernel#$prefix}" >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
fi
@ -199,8 +199,8 @@ InstallKernel()
grub2-set-default 0
fi
fi
if [[ ${customKernel} == "linuxnext" ]] || [[ ${customKernel} == "netnext" ]]; then
LogMsg "Custom Kernel:$customKernel"
if [[ ${CustomKernel} == "linuxnext" ]] || [[ ${CustomKernel} == "netnext" ]]; then
LogMsg "Custom Kernel:$CustomKernel"
chmod +x $logFolder/DetectLinuxDistro.sh
LinuxDistro=`$logFolder/DetectLinuxDistro.sh`
if [ $LinuxDistro == "SLES" -o $LinuxDistro == "SUSE" ]; then
@ -221,19 +221,19 @@ InstallKernel()
CheckInstallLockUbuntu
apt-get update
LogMsg "Installing packages git make tar gcc bc patch dos2unix wget ..."
apt-get install -y git make tar gcc bc patch dos2unix wget >> $logFolder/build-customKernel.txt 2>&1
apt-get install -y git make tar gcc bc patch dos2unix wget >> $logFolder/build-CustomKernel.txt 2>&1
LogMsg "Installing kernel-package ..."
apt-get -o Dpkg::Options::="--force-confnew" -y install kernel-package >> $logFolder/build-customKernel.txt 2>&1
apt-get -o Dpkg::Options::="--force-confnew" -y install kernel-package >> $logFolder/build-CustomKernel.txt 2>&1
rm -rf linux-next
LogMsg "Downloading kernel source..."
git clone ${kernelSource} >> $logFolder/build-customKernel.txt 2>&1
git clone ${kernelSource} >> $logFolder/build-CustomKernel.txt 2>&1
cd ${sourceDir}
#Download kernel build shell script...
wget https://raw.githubusercontent.com/simonxiaoss/linux_performance_test/master/git_bisect/build-ubuntu.sh
chmod +x build-ubuntu.sh
#Start installing kernel
LogMsg "Building and Installing kernel..."
./build-ubuntu.sh >> $logFolder/build-customKernel.txt 2>&1
./build-ubuntu.sh >> $logFolder/build-CustomKernel.txt 2>&1
kernelInstallStatus=$?
if [ $kernelInstallStatus -eq 0 ]; then
LogMsg "CUSTOM_KERNEL_SUCCESS"

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

@ -3,7 +3,7 @@
#######################################################################
#
# Description: It install the LIS using given LIS source file (.tar.gz or lis-next)
# Usage: ./customLISInstall.sh -customLIS lisnext or tar file link -LISbranch a specific branch or default is master
# Usage: ./customLISInstall.sh -CustomLIS lisnext or tar file link -LISbranch a specific branch or default is master
# Author: Sivakanth Rebba
# Email : v-sirebb@microsoft.com
#
@ -32,7 +32,7 @@ ICA_TESTFAILED="TestFailed" # Error occurred during the test
LogMsg()
{
echo `date "+%b %d %Y %T"` : "${1}" # Add the time stamp to the log message
echo "${1}" >> ~/build-customLIS.txt
echo "${1}" >> ~/build-CustomLIS.txt
}
UpdateTestState()
@ -40,15 +40,15 @@ UpdateTestState()
echo "${1}" > ~/state.txt
}
if [ -z "$customLIS" ]; then
echo "Please mention -customLIS next"
if [ -z "$CustomLIS" ]; then
echo "Please mention -CustomLIS next"
exit 1
fi
if [ -z "$LISbranch" ]; then
echo "Not mentioned LIS branch, Use Master branch"
LISbranch="master"
fi
touch ~/build-customLIS.txt
touch ~/build-CustomLIS.txt
#Detect Distro and it's version
DistroName="Unknown"
@ -71,26 +71,26 @@ if [ -f /etc/UnitedLinux-release ] ; then
DistroName="${DistroName}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
fi
LogMsg "*****OS Info*****"
cat /etc/*-release >> ~/build-customLIS.txt 2>&1
cat /etc/*-release >> ~/build-CustomLIS.txt 2>&1
LogMsg "*****Kernen Info*****"
uname -r >> ~/build-customLIS.txt 2>&1
uname -r >> ~/build-CustomLIS.txt 2>&1
LogMsg "*****LIS Info*****"
modinfo hv_vmbus >> ~/build-customLIS.txt 2>&1
modinfo hv_vmbus >> ~/build-CustomLIS.txt 2>&1
kernel=`uname -r`
if [ "${customLIS}" == "lisnext" ]; then
if [ "${CustomLIS}" == "lisnext" ]; then
LISSource="https://github.com/LIS/lis-next.git"
sourceDir="lis-next"
elif [ "${customLIS}" == "netnext" ]; then
elif [ "${CustomLIS}" == "netnext" ]; then
LISSource="https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git"
sourceDir="net-next"
elif [[ $customLIS == *.rpm ]]; then
LogMsg "Custom LIS:$customLIS"
elif [[ $CustomLIS == *.rpm ]]; then
LogMsg "Custom LIS:$CustomLIS"
sed -i '/^exclude/c\#exclude' /etc/yum.conf
yum install -y wget tar
LogMsg "Debian package web link detected. Downloading $customLIS"
wget $customLIS
LogMsg "Installing ${customLIS##*/}"
rpm -ivh "${customLIS##*/}" >> ~/build-customLIS.txt 2>&1
LogMsg "Debian package web link detected. Downloading $CustomLIS"
wget $CustomLIS
LogMsg "Installing ${CustomLIS##*/}"
rpm -ivh "${CustomLIS##*/}" >> ~/build-CustomLIS.txt 2>&1
LISInstallStatus=$?
UpdateTestState $ICA_TESTCOMPLETED
if [ $LISInstallStatus -ne 0 ]; then
@ -101,20 +101,20 @@ elif [[ $customLIS == *.rpm ]]; then
UpdateTestState $ICA_TESTCOMPLETED
fi
exit 0
elif [[ $customLIS == *.tar.gz ]]; then
LogMsg "Custom LIS:$customLIS"
elif [[ $CustomLIS == *.tar.gz ]]; then
LogMsg "Custom LIS:$CustomLIS"
sed -i '/^exclude/c\#exclude' /etc/yum.conf
yum install -y git make tar gcc bc patch dos2unix wget xz >> ~/build-customLIS.txt 2>&1
LogMsg "LIS tar file web link detected. Downloading $customLIS"
wget $customLIS
LogMsg "Extracting ${customLIS##*/}"
tar -xvzf "${customLIS##*/}"
LogMsg "Installing ${customLIS##*/}"
yum install -y git make tar gcc bc patch dos2unix wget xz >> ~/build-CustomLIS.txt 2>&1
LogMsg "LIS tar file web link detected. Downloading $CustomLIS"
wget $CustomLIS
LogMsg "Extracting ${CustomLIS##*/}"
tar -xvzf "${CustomLIS##*/}"
LogMsg "Installing ${CustomLIS##*/}"
cd LISISO
./install.sh >> ~/build-customLIS.txt 2>&1
./install.sh >> ~/build-CustomLIS.txt 2>&1
LISInstallStatus=$?
UpdateTestState $ICA_TESTCOMPLETED
modinfo hv_vmbus >> ~/build-customLIS.txt 2>&1
modinfo hv_vmbus >> ~/build-CustomLIS.txt 2>&1
if [ $LISInstallStatus -ne 0 ]; then
LogMsg "CUSTOM_LIS_FAIL"
UpdateTestState $ICA_TESTFAILED
@ -124,7 +124,7 @@ elif [[ $customLIS == *.tar.gz ]]; then
fi
exit 0
fi
LogMsg "Custom LIS:$customLIS"
LogMsg "Custom LIS:$CustomLIS"
if [ $DistroName == "SLES" -o $DistroName == "SUSE" ]; then
zypper --non-interactive install git-core make tar gcc bc patch dos2unix wget xz
@ -132,9 +132,9 @@ if [ $DistroName == "SLES" -o $DistroName == "SUSE" ]; then
elif [ $DistroName == "CENTOS" -o $DistroName == "REDHAT" -o $DistroName == "FEDORA" -o $DistroName == "ORACLELINUX" ]; then
LogMsg "Installing packages git make tar gcc bc patch dos2unix wget ..."
sed -i '/^exclude/c\#exclude' /etc/yum.conf
yum install -y git make tar gcc bc patch dos2unix wget xz >> ~/build-customLIS.txt 2>&1
yum install -y git make tar gcc bc patch dos2unix wget xz >> ~/build-CustomLIS.txt 2>&1
LogMsg "Downloading LIS source from ${LISSource}..."
git clone ${LISSource} >> ~/build-customLIS.txt 2>&1
git clone ${LISSource} >> ~/build-CustomLIS.txt 2>&1
cd ${sourceDir}
git checkout ${LISbranch}
LogMsg "Downloaded LIS from this ${LISbranch} branch..."
@ -148,9 +148,9 @@ elif [ $DistroName == "CENTOS" -o $DistroName == "REDHAT" -o $DistroName == "FED
cd $LISsourceDir
LISDir=`pwd`
LogMsg "Installing kernel-devel-${kernel} for LIS..."
yum install -y "https://konkasoftpackages.blob.core.windows.net/linuxbinaries/kernel-devel-${kernel}.rpm" ~/build-customLIS.txt 2>&1
yum install -y "https://konkasoftpackages.blob.core.windows.net/linuxbinaries/kernel-devel-${kernel}.rpm" ~/build-CustomLIS.txt 2>&1
LogMsg "LIS is installing from this ${LISDir} branch..."
./*-hv-driver-install >> ~/build-customLIS.txt 2>&1
./*-hv-driver-install >> ~/build-CustomLIS.txt 2>&1
if [ $? -ne 0 ]; then
LogMsg "CUSTOM_LIS_FAIL"
UpdateTestState $ICA_TESTFAILED