LISA Perf test improvements
1. Added LISA-PERF cycle. 2. Removed code from terasort test case and replaced with Function. 3. Improved APACHE benchmark test to work with Ubuntu and RHEL
This commit is contained in:
Родитель
966038662b
Коммит
355ef3c7a3
|
@ -4909,7 +4909,7 @@
|
|||
<setupType>M1S1</setupType>
|
||||
<SupportedExecutionModes>AzureServiceManagement,AzureResourceManager</SupportedExecutionModes>
|
||||
<!--Remote Files will be directly downloaded to test VM.-->
|
||||
<remoteFiles>https://raw.githubusercontent.com/LIS/lis-test/master/WS2012R2/lisa/remote-scripts/ica/performance_ab.sh</remoteFiles>
|
||||
<remoteFiles>https://raw.githubusercontent.com/iamshital/lis-test/master/WS2012R2/lisa/remote-scripts/ica/performance_ab.sh</remoteFiles>
|
||||
<!--Remote XML will be downloaded to automation server for analysis-->
|
||||
<remoteXML>https://raw.githubusercontent.com/LIS/lis-test/master/WS2012R2/lisa/xml/Perf_AB.xml</remoteXML>
|
||||
<SubtestValues>SOME,TEXTS,NEEDS,TO,BE,PRESENT,HERE,FOR,PRINTING,TEST,SUMMARY</SubtestValues>
|
||||
|
@ -5685,6 +5685,22 @@
|
|||
<Name>ICA-PERF-ZOOKEEPER-TEST</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
|
||||
<Cycle>
|
||||
<cycleName>LISA-PERF</cycleName>
|
||||
<test>
|
||||
<Name>ICA-TERASORT-BENCHMARK-TEST</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>ICA-PERF-REDIS-TEST</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>ICA-PERF-APACHE-BENCHMARK-TEST</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>ICA-PERF-ZOOKEEPER-TEST</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
|
||||
<Cycle>
|
||||
<cycleName>RHUI-Stress</cycleName>
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
Function ProvisionVMsForLisa($allVMData)
|
||||
#
|
||||
# This function enables the root password and ssh key based authentication across all VMs in same service / resource group.
|
||||
# $allVMData : PSObject which contains all the VM data in same service / resource group.
|
||||
# $installPackagesOnRoleName : [string] if you want to install packages on specific role only then use this parameter. Eg. ProvisionVMsForLisa -allVMData $VMData -installPackagesOnRoleName "master"
|
||||
# Multiple Rolenames can be given as "master,client"
|
||||
#
|
||||
Function ProvisionVMsForLisa($allVMData, $installPackagesOnRoleNames)
|
||||
{
|
||||
$scriptUrl = "https://raw.githubusercontent.com/LIS/lis-test/master/WS2012R2/lisa/remote-scripts/ica/provisionLinuxForLisa.sh"
|
||||
$scriptUrl = "https://raw.githubusercontent.com/iamshital/lis-test/master/WS2012R2/lisa/remote-scripts/ica/provisionLinuxForLisa.sh"
|
||||
$sshPrivateKeyPath = ".\ssh\myPrivateKey.key"
|
||||
$sshPrivateKey = "myPrivateKey.key"
|
||||
LogMsg "Downloading $scriptUrl ..."
|
||||
|
@ -34,17 +40,40 @@
|
|||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "cp /home/$user/.ssh/config /root/.ssh/"
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "service sshd restart"
|
||||
|
||||
LogMsg "Executing $scriptName ..."
|
||||
$provisionJob = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/root/$scriptName" -RunInBackground
|
||||
#endregion
|
||||
while ( (Get-Job -Id $provisionJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "tail -n 1 /root/provisionLinux.log"
|
||||
LogMsg "Current Package Installation Status : $currentStatus"
|
||||
WaitFor -seconds 10
|
||||
}
|
||||
RemoteCopy -download -downloadFrom $vmData.PublicIP -port $vmData.SSHPort -files "/root/provisionLinux.log" -username "root" -password $password -downloadTo $LogDir
|
||||
Rename-Item -Path "$LogDir\provisionLinux.log" -NewName "$($vmData.RoleName)-provisionLinux.log" -Force | Out-Null
|
||||
if ( $installPackagesOnRoleNames )
|
||||
{
|
||||
if ( $installPackagesOnRoleNames -imatch $vmData.RoleName )
|
||||
{
|
||||
LogMsg "Executing $scriptName ..."
|
||||
$provisionJob = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/root/$scriptName" -RunInBackground
|
||||
#endregion
|
||||
while ( (Get-Job -Id $provisionJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "tail -n 1 /root/provisionLinux.log"
|
||||
LogMsg "Current Package Installation Status : $currentStatus"
|
||||
WaitFor -seconds 10
|
||||
}
|
||||
RemoteCopy -download -downloadFrom $vmData.PublicIP -port $vmData.SSHPort -files "/root/provisionLinux.log" -username "root" -password $password -downloadTo $LogDir
|
||||
Rename-Item -Path "$LogDir\provisionLinux.log" -NewName "$($vmData.RoleName)-provisionLinux.log" -Force | Out-Null
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "$($vmData.RoleName) is set to NOT install packages. Hence skipping package installation on this VM."
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Executing $scriptName ..."
|
||||
$provisionJob = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/root/$scriptName" -RunInBackground
|
||||
#endregion
|
||||
while ( (Get-Job -Id $provisionJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "tail -n 1 /root/provisionLinux.log"
|
||||
LogMsg "Current Package Installation Status : $currentStatus"
|
||||
WaitFor -seconds 10
|
||||
}
|
||||
RemoteCopy -download -downloadFrom $vmData.PublicIP -port $vmData.SSHPort -files "/root/provisionLinux.log" -username "root" -password $password -downloadTo $LogDir
|
||||
Rename-Item -Path "$LogDir\provisionLinux.log" -NewName "$($vmData.RoleName)-provisionLinux.log" -Force | Out-Null }
|
||||
LogMsg "$($vmData.RoleName) preparation finished."
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -114,6 +114,13 @@ if ($isDeployed)
|
|||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "/root/abConsoleLogs.txt"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "/root/summary.log"
|
||||
$abSummary = Get-Content -Path "$LogDir\summary.log" -ErrorAction SilentlyContinue
|
||||
foreach ( $line in $detailedResult.Split("`n") )
|
||||
{
|
||||
if ( $line -imatch "Time taken for tests" )
|
||||
{
|
||||
$abSummary = $line
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (!$abSummary)
|
||||
|
@ -134,7 +141,7 @@ if ($isDeployed)
|
|||
elseif ( $finalStatus -imatch "TestCompleted")
|
||||
{
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "/root/abtest.log"
|
||||
LogMsg "Test Completed. Result : $abResult."
|
||||
LogMsg "Test Completed. Result : $abSummary."
|
||||
$testResult = "PASS"
|
||||
}
|
||||
elseif ( $finalStatus -imatch "TestRunning")
|
||||
|
@ -159,7 +166,7 @@ if ($isDeployed)
|
|||
$testResult = "Aborted"
|
||||
}
|
||||
$resultArr += $testResult
|
||||
$resultSummary += CreateResultSummary -testResult $abResult -metaData $metaData -checkValues "PASS,FAIL,ABORTED" -testName $currentTestData.testName# if you want to publish all result then give here all test status possibilites. if you want just failed results, then give here just "FAIL". You can use any combination of PASS FAIL ABORTED and corresponding test results will be published!
|
||||
$resultSummary += CreateResultSummary -testResult $abSummary -metaData $metaData -checkValues "PASS,FAIL,ABORTED" -testName $currentTestData.testName# if you want to publish all result then give here all test status possibilites. if you want just failed results, then give here just "FAIL". You can use any combination of PASS FAIL ABORTED and corresponding test results will be published!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,16 @@ if ($isDeployed)
|
|||
LogMsg " SSH Port : $($vmData.SSHPort)"
|
||||
$i += 1
|
||||
}
|
||||
#
|
||||
# PROVISION VMS FOR LISA WILL ENABLE ROOT USER AND WILL MAKE ENABLE PASSWORDLESS AUTHENTICATION ACROSS ALL VMS IN SAME HOSTED SERVICE.
|
||||
#
|
||||
ProvisionVMsForLisa -allVMData $allVMData -installPackagesOnRoleNames "master"
|
||||
|
||||
foreach ( $vmData in $allVMData )
|
||||
{
|
||||
LogMsg "Adding $($vmData.InternalIP) $($vmData.RoleName) to /etc/hosts of $($masterVMData.RoleName) "
|
||||
$out = RunLinuxCmd -ip $masterVMData.PublicIP -port $masterVMData.SSHPort -username "root" -password $password -command "echo $($vmData.InternalIP) $($vmData.RoleName) >> /etc/hosts"
|
||||
}
|
||||
if ( $currentTestData.HADOOP_VERSION )
|
||||
{
|
||||
$hadoopVersion = $currentTestData.HADOOP_VERSION
|
||||
|
@ -87,38 +97,16 @@ if ($isDeployed)
|
|||
# You can add as much as teerasort test parameters here.
|
||||
|
||||
LogMsg "constanst.sh created successfully..."
|
||||
Set-Content -Value "/root/perf_hadoopterasort.sh &> terasortConsoleLogs.txt" -Path "$LogDir\StartTerasortTest.sh"
|
||||
Set-Content -Value "echo `"Host *`" > /home/$user/.ssh/config" -Path "$LogDir\disableHostKeyVerification.sh"
|
||||
Add-Content -Value "echo StrictHostKeyChecking=no >> /home/$user/.ssh/config" -Path "$LogDir\disableHostKeyVerification.sh"
|
||||
LogMsg (Get-Content $constantsFile)
|
||||
foreach ( $vmData in $allVMData )
|
||||
{
|
||||
LogMsg "Preaparing $($vmData.RoleName) for test..."
|
||||
RemoteCopy -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files ".\$constantsFile,.\$LogDir\perf_hadoopterasort.sh,.\remote-scripts\enableRoot.sh,$sshKeyPath,.\$LogDir\StartTerasortTest.sh,.\$LogDir\disableHostKeyVerification.sh" -username $user -password $password -upload
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "chmod +x /home/$user/*.sh" -runAsSudo
|
||||
$rootPasswordSet = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/enableRoot.sh -password $($password.Replace('"',''))" -runAsSudo
|
||||
LogMsg $rootPasswordSet
|
||||
if (( $rootPasswordSet -imatch "ROOT_PASSWRD_SET" ) -and ( $rootPasswordSet -imatch "SSHD_RESTART_SUCCESSFUL" ))
|
||||
{
|
||||
LogMsg "root user enabled for $($vmData.RoleName) and password set to $password"
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw "Failed to enable root password / starting SSHD service. Please check logs. Aborting test."
|
||||
}
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "chmod 600 /home/$user/$sshKey && cp -ar /home/$user/* /root/"
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "mkdir -p /root/.ssh/ && cp /home/$user/.ssh/authorized_keys /root/.ssh/"
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "/home/$user/disableHostKeyVerification.sh"
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "cp /home/$user/.ssh/config /root/.ssh/"
|
||||
$out = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username "root" -password $password -command "service sshd restart"
|
||||
LogMsg "Adding $($vmData.InternalIP) $($vmData.RoleName) to /etc/hosts of $($masterVMData.RoleName) "
|
||||
$out = RunLinuxCmd -ip $masterVMData.PublicIP -port $masterVMData.SSHPort -username "root" -password $password -command "echo $($vmData.InternalIP) $($vmData.RoleName) >> /etc/hosts"
|
||||
LogMsg "$($vmData.RoleName) preparation finished."
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region EXECUTE TEST
|
||||
|
||||
Set-Content -Value "/root/perf_hadoopterasort.sh &> terasortConsoleLogs.txt" -Path "$LogDir\StartTerasortTest.sh"
|
||||
|
||||
RemoteCopy -uploadTo $masterVMData.PublicIP -port $masterVMData.SSHPort -files ".\$constantsFile,.\$LogDir\perf_hadoopterasort.sh,$sshKeyPath,.\$LogDir\StartTerasortTest.sh" -username "root" -password $password -upload
|
||||
$out = RunLinuxCmd -ip $masterVMData.PublicIP -port $masterVMData.SSHPort -username "root" -password $password -command "chmod +x *.sh"
|
||||
$out = RunLinuxCmd -ip $masterVMData.PublicIP -port $masterVMData.SSHPort -username "root" -password $password -command "chmod 600 $sshKey"
|
||||
$testJob = RunLinuxCmd -ip $masterVMData.PublicIP -port $masterVMData.SSHPort -username "root" -password $password -command "/root/StartTerasortTest.sh" -RunInBackground
|
||||
#endregion
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче