Merge branch 'master' of https://github.com/iamshital/azure-linux-automation
This commit is contained in:
Коммит
a0590a6c00
|
@ -19,7 +19,8 @@ param (
|
|||
[switch] $upload,
|
||||
[switch] $help,
|
||||
[string] $Distro,
|
||||
[string] $cycleName,
|
||||
[string] $cycleName,
|
||||
[string] $RunSelectedTests,
|
||||
[string] $TestPriority,
|
||||
[string] $osImage,
|
||||
[switch] $EconomyMode,
|
||||
|
@ -83,6 +84,10 @@ if ( $customLISBranch )
|
|||
{
|
||||
Set-Variable -Name customLISBranch -Value $customLISBranch -Scope Global
|
||||
}
|
||||
if ( $RunSelectedTests )
|
||||
{
|
||||
Set-Variable -Name RunSelectedTests -Value $RunSelectedTests -Scope Global
|
||||
}
|
||||
if ( $xmlConfig.config.Azure.General.StorageAccount -imatch "NewStorage_" )
|
||||
{
|
||||
$NewASMStorageAccountType = ($xmlConfig.config.Azure.General.StorageAccount).Replace("NewStorage_","")
|
||||
|
|
|
@ -220,14 +220,28 @@ Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro )
|
|||
$testCount = 1
|
||||
}
|
||||
|
||||
for ($counter = 0; $counter -lt $testCount; $counter++)
|
||||
foreach ($test in $currentCycleData.test)
|
||||
{
|
||||
$test = $currentCycleData.test[$counter]
|
||||
if (-not $test)
|
||||
{
|
||||
$test = $currentCycleData.test
|
||||
}
|
||||
$currentTestData = GetCurrentTestData -xmlConfig $xmlConfig -testName $test.Name
|
||||
if ($RunSelectedTests)
|
||||
{
|
||||
if ($RunSelectedTests.Trim().Replace(" ","").Split(",") -contains $test.Name)
|
||||
{
|
||||
$currentTestData = GetCurrentTestData -xmlConfig $xmlConfig -testName $test.Name
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Skipping $($test.Name) because it is not in selected tests to run."
|
||||
Continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$currentTestData = GetCurrentTestData -xmlConfig $xmlConfig -testName $test.Name
|
||||
}
|
||||
# Generate Unique Test
|
||||
$server = $xmlConfig.config.global.ServerEnv.Server
|
||||
$cluster = $xmlConfig.config.global.ClusterEnv.Cluster
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
</ARMImage>
|
||||
<OsVHD></OsVHD>
|
||||
<!-- <OsVHD>VHD_NAME.vhd</OsVHD> -->
|
||||
<!-- <OsVHD>http://storageaccouunt.blob.core.windows.net/vhds/VHD_NAME.vhd</OsVHD> -->
|
||||
</Distro>
|
||||
<Distro>
|
||||
<Name>SSU1510P</Name>
|
||||
|
@ -7107,7 +7108,7 @@
|
|||
<param>numjobs=1</param>
|
||||
<param>ioruntime=300</param>
|
||||
<param>maxIO=4</param>
|
||||
<param>fileSize=134G</param>
|
||||
<param>fileSize=1023G</param>
|
||||
</TestParameters>
|
||||
<Priority>P0</Priority>
|
||||
</test>
|
||||
|
@ -7633,7 +7634,30 @@
|
|||
<Name>BVT-DELETE-VHD</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
|
||||
<Cycle>
|
||||
<cycleName>BVTMK</cycleName>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-NO-ERROR-IN-LOGS</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-VHD-PREREQUISITES</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-WA-PROC-CHECK</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-WA-VER-CHECK</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-SWAP-CHECK</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-RESTART</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-SHUTDOWN</Name>
|
||||
</test>
|
||||
</Cycle>
|
||||
<!-- Network Outbound Access tests -->
|
||||
<Cycle>
|
||||
<cycleName>OutboundAccess</cycleName>
|
||||
|
@ -8451,9 +8475,6 @@
|
|||
<test>
|
||||
<Name>ICA-PERF-FIO-TEST-4K</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>ICA-PERF-FIO-TEST-8K</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>ICA-PERF-FIO-TEST-1024K</Name>
|
||||
</test>
|
||||
|
|
|
@ -590,15 +590,16 @@ else
|
|||
{
|
||||
$saInfoCollected = $false
|
||||
$retryCount = 0
|
||||
$maxRetryCount = 20
|
||||
$maxRetryCount = 999
|
||||
while(!$saInfoCollected -and ($retryCount -lt $maxRetryCount))
|
||||
{
|
||||
try
|
||||
{
|
||||
$retryCount += 1
|
||||
LogMsg "Getting Existing Storage Account : $StorageAccountName details ..."
|
||||
$StorageAccountType = (Get-AzureRmStorageAccount | where {$_.StorageAccountName -eq $StorageAccountName}).Sku.Tier.ToString()
|
||||
$StorageAccountRG = (Get-AzureRmStorageAccount | where {$_.StorageAccountName -eq $StorageAccountName}).ResourceGroupName.ToString()
|
||||
LogMsg "[Attempt $retryCount/$maxRetryCount] : Getting Existing Storage Account : $StorageAccountName details ..."
|
||||
$GetAzureRMStorageAccount = Get-AzureRmStorageAccount
|
||||
$StorageAccountType = ($GetAzureRMStorageAccount | where {$_.StorageAccountName -eq $StorageAccountName}).Sku.Tier.ToString()
|
||||
$StorageAccountRG = ($GetAzureRMStorageAccount | where {$_.StorageAccountName -eq $StorageAccountName}).ResourceGroupName.ToString()
|
||||
$saInfoCollected = $true
|
||||
if($StorageAccountType -match 'Premium')
|
||||
{
|
||||
|
@ -614,7 +615,7 @@ else
|
|||
catch
|
||||
{
|
||||
LogErr "Error in fetching Storage Account info. Retrying."
|
||||
sleep -Seconds 30
|
||||
sleep -Seconds 10
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2285,9 +2286,13 @@ Function CreateAllRGDeploymentsWithTempParameters($templateName, $location, $Tem
|
|||
return $retValue, $deployedGroups, $resourceGroupCount, $DeploymentElapsedTime
|
||||
}
|
||||
|
||||
Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageContainer,$destinationStorageAccount,$destinationStorageContainer,$vhdName)
|
||||
Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageContainer,$destinationStorageAccount,$destinationStorageContainer,$vhdName,$destVHDName)
|
||||
{
|
||||
$retValue = $false
|
||||
if (!$destVHDName)
|
||||
{
|
||||
$destVHDName = $vhdName
|
||||
}
|
||||
$GetAzureRmStorageAccount = Get-AzureRmStorageAccount
|
||||
|
||||
LogMsg "Retrieving $sourceStorageAccount storage account key"
|
||||
|
@ -2300,7 +2305,7 @@ Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageCon
|
|||
LogMsg "Retrieving $destinationStorageAccount storage account key"
|
||||
$DestAccountKey= (Get-AzureRmStorageAccountKey -ResourceGroupName $(($GetAzureRmStorageAccount | Where {$_.StorageAccountName -eq "$destinationStorageAccount"}).ResourceGroupName) -Name $destinationStorageAccount)[0].Value
|
||||
[string]$DestAccountName = $destinationStorageAccount
|
||||
[string]$DestBlob = $vhdName
|
||||
[string]$DestBlob = $destVHDName
|
||||
$DestContainer = $destinationStorageContainer
|
||||
|
||||
$context = New-AzureStorageContext -StorageAccountName $srcStorageAccount -StorageAccountKey $srcStorageAccountKey
|
||||
|
|
|
@ -221,7 +221,7 @@ function InstallCustomKernel ($customKernel, $allVMData, [switch]$RestartAfterUp
|
|||
if ($currentKernelVersion -eq $upgradedKernelVersion)
|
||||
{
|
||||
LogErr "Kernel version is same after restarting VMs."
|
||||
if ($customKernel -imatch "latest")
|
||||
if ($customKernel -eq "latest")
|
||||
{
|
||||
LogMsg "Continuing the tests as default kernel is latest."
|
||||
$isKernelUpgraded = $true
|
||||
|
@ -400,7 +400,7 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
LogMsg "SRIOV workaround is not needed."
|
||||
}
|
||||
LogMsg "Now executing $scriptName ..."
|
||||
$jobID = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName" -runAsSudo
|
||||
$sriovOutput = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/home/$user/$scriptName" -runAsSudo
|
||||
$sriovDetectedCount += 1
|
||||
}
|
||||
else
|
||||
|
@ -412,8 +412,15 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
|
||||
if ($sriovDetectedCount -gt 0)
|
||||
{
|
||||
LogMsg "Now restarting VMs..."
|
||||
$restartStatus = RestartAllDeployments -allVMData $allVMData
|
||||
if ($sriovOutput -imatch "SYSTEM_RESTART_REQUIRED")
|
||||
{
|
||||
LogMsg "Updated SRIOV configuration. Now restarting VMs..."
|
||||
$restartStatus = RestartAllDeployments -allVMData $allVMData
|
||||
}
|
||||
if ($sriovOutput -imatch "DATAPATH_SWITCHED_TO_VF")
|
||||
{
|
||||
$restartStatus="True"
|
||||
}
|
||||
}
|
||||
$vmCount = 0
|
||||
$bondSuccess = 0
|
||||
|
@ -423,17 +430,35 @@ function EnableSRIOVInAllVMs($allVMData)
|
|||
foreach ( $vmData in $allVMData )
|
||||
{
|
||||
$vmCount += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/sbin/ifconfig -a" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "bond")
|
||||
if ($sriovOutput -imatch "DATAPATH_SWITCHED_TO_VF")
|
||||
{
|
||||
LogMsg "New bond detected in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "dmesg" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "Data path switched to VF")
|
||||
{
|
||||
LogMsg "Data path already switched to VF in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "Data path not switched to VF in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "New bond not detected in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
$AfterIfConfigStatus = $null
|
||||
$AfterIfConfigStatus = RunLinuxCmd -ip $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -command "/sbin/ifconfig -a" -runAsSudo
|
||||
if ($AfterIfConfigStatus -imatch "bond")
|
||||
{
|
||||
LogMsg "New bond detected in $($vmData.RoleName)"
|
||||
$bondSuccess += 1
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "New bond not detected in $($vmData.RoleName)"
|
||||
$bondError += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux" /etc/{issue,*release,*version}`
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
bootLogs=`dmesg`
|
||||
if [[ $bootLogs =~ "Data path switched to VF" ]];
|
||||
then
|
||||
#A temporary workaround for SRIOV issue.
|
||||
macAddr=`cat /sys/class/net/eth0/address`
|
||||
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"hv_netvsc\", ATTR{address}==\"${macAddr}\", NAME=\"eth0\"" > /etc/udev/rules.d/70-persistent-net.rules
|
||||
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"mlx4_core\", ATTR{address}==\"${macAddr}\", NAME=\"vf0\"" >> /etc/udev/rules.d/70-persistent-net.rules
|
||||
#sed -i '/rename*/c\vf0' /etc/network/interfaces
|
||||
echo "SYSTEM_RESTART_REQUIRED"
|
||||
echo "DATAPATH_SWITCHED_TO_VF"
|
||||
else
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
then
|
||||
#A temporary workaround for SRIOV issue.
|
||||
macAddr=`cat /sys/class/net/eth0/address`
|
||||
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"hv_netvsc\", ATTR{address}==\"${macAddr}\", NAME=\"eth0\"" > /etc/udev/rules.d/70-persistent-net.rules
|
||||
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"mlx4_core\", ATTR{address}==\"${macAddr}\", NAME=\"vf0\"" >> /etc/udev/rules.d/70-persistent-net.rules
|
||||
#sed -i '/rename*/c\vf0' /etc/network/interfaces
|
||||
echo "SYSTEM_RESTART_REQUIRED"
|
||||
fi
|
||||
fi
|
||||
exit 0
|
|
@ -1,10 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Reference: https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-vm-accelerated-networking
|
||||
|
||||
wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/tools/hv/bondvf.sh
|
||||
chmod +x ./bondvf.sh
|
||||
./bondvf.sh
|
||||
cp bondvf.sh /etc/init.d
|
||||
update-rc.d bondvf.sh defaults
|
||||
bootLogs=`dmesg`
|
||||
if [[ $bootLogs =~ "Data path switched to VF" ]];
|
||||
then
|
||||
echo "DATAPATH_SWITCHED_TO_VF"
|
||||
else
|
||||
wget https://raw.githubusercontent.com/torvalds/linux/master/tools/hv/bondvf.sh
|
||||
chmod +x ./bondvf.sh
|
||||
./bondvf.sh
|
||||
cp bondvf.sh /etc/init.d
|
||||
update-rc.d bondvf.sh defaults
|
||||
echo "SYSTEM_RESTART_REQUIRED"
|
||||
fi
|
||||
exit 0
|
|
@ -58,7 +58,7 @@ else
|
|||
}
|
||||
LogMsg "test VM sizes: $VMSizes"
|
||||
$NumberOfSizes = $VMSizes.Count
|
||||
$DeploymentCount = $NumberOfSizes*5
|
||||
$DeploymentCount = $NumberOfSizes*1
|
||||
|
||||
#Test Starts Here..
|
||||
try
|
||||
|
@ -129,6 +129,7 @@ $DeploymentCount = $NumberOfSizes*5
|
|||
$deployedResourceGroupName = $null
|
||||
$DeploymentStatistics = CreateDeploymentResultObject
|
||||
#Create A VM here and Wait for the VM to come up.
|
||||
LogMsg "Current Progress : Success : $successCount, Fail : $failCount, Remaining : $($DeploymentCount - $successCount - $failCount)"
|
||||
LogMsg "ATTEMPT : $count/$DeploymentCount : Deploying $($VMSizes[$VMSizeNumber]) VM.."
|
||||
Set-Variable -Name OverrideVMSize -Value $($VMSizes[$VMSizeNumber]) -Scope Global -Force
|
||||
$xmlConfig.config.Azure.Deployment.SingleVM.HostedService.Tag = $($VMSizes[$VMSizeNumber]).Replace("_","-")
|
||||
|
@ -152,6 +153,8 @@ $DeploymentCount = $NumberOfSizes*5
|
|||
{
|
||||
if ( $UseAzureResourceManager )
|
||||
{
|
||||
LogMsg "ATTEMPT : $count/$DeploymentCount : Deploying $($VMSizes[$VMSizeNumber]) VM.. SUCCESS"
|
||||
LogMsg "deployment Time = $($DeploymentStatistics.DeploymentTime)"
|
||||
#Added restart check for the deployment
|
||||
$isRestarted = RestartAllDeployments -allVMData $allVMData
|
||||
if($isRestarted)
|
||||
|
@ -161,6 +164,17 @@ $DeploymentCount = $NumberOfSizes*5
|
|||
LogMsg "deployment Time = $($DeploymentStatistics.DeploymentTime)"
|
||||
$deployResult = "PASS"
|
||||
}
|
||||
LogMsg "ATTEMPT : $count/$DeploymentCount : Reboot $($VMSizes[$VMSizeNumber]) VM.. SUCCESS"
|
||||
$successCount += 1
|
||||
$deployResult = "PASS"
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash = @{}
|
||||
$hash.Add($preserveKeyword,"yes")
|
||||
$hash.Add("testName","$($currentTestData.testName)")
|
||||
$out = Set-AzureRmResourceGroup -Name $deployedServiceName -Tag $hash
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -69,9 +69,9 @@ if ($isDeployed)
|
|||
foreach ( $param in $currentTestData.TestParameters.param)
|
||||
{
|
||||
Add-Content -Value "$param" -Path $constantsFile
|
||||
if ($param -imatch "bufferLenghs=")
|
||||
if ($param -imatch "bufferLengths=")
|
||||
{
|
||||
$testBuffers= $param.Replace("bufferLenghs=(","").Replace(")","").Split(" ")
|
||||
$testBuffers= $param.Replace("bufferLengths=(","").Replace(")","").Split(" ")
|
||||
}
|
||||
if ($param -imatch "connections=" )
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ collect_VM_properties
|
|||
|
||||
foreach ( $file in $files )
|
||||
{
|
||||
if ( $file.Name -imatch "iperf-client-tcp-$IPVersion-buffer-$($Buffer)K-conn-$connection-instance-*" )
|
||||
if ( $file.Name -imatch "iperf-client-tcp-$IPVersion-buffer-$($Buffer)-conn-$connection-instance-*" )
|
||||
{
|
||||
|
||||
$currentInstanceclientJsonText = $null
|
||||
|
|
|
@ -73,7 +73,14 @@ collect_VM_properties
|
|||
{
|
||||
$expectedCount = 4
|
||||
}
|
||||
elseif ($clientVMData.InstanceSize -eq "Standard_NC24r")
|
||||
{
|
||||
$expectedCount = 4
|
||||
}
|
||||
$errorCount = 0
|
||||
#Adding sleep of 180 seconds, giving time to load nvidia drivers.
|
||||
LogMsg "Waiting 3 minutes. (giving time to load nvidia drivers)"
|
||||
Start-Sleep -Seconds 180
|
||||
#region PCI Express pass-through
|
||||
$PCIExpress = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "lsvmbus" -ignoreLinuxExitCode
|
||||
Set-Content -Value $PCIExpress -Path $LogDir\PIC-Express-pass-through.txt -Force
|
||||
|
|
|
@ -0,0 +1,400 @@
|
|||
Import-Module .\TestLibs\RDFELibs.psm1 -Force
|
||||
$result = ""
|
||||
$testResult = ""
|
||||
$resultArr = @()
|
||||
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
|
||||
if ($isDeployed)
|
||||
{
|
||||
try
|
||||
{
|
||||
$noClient = $true
|
||||
$noServer = $true
|
||||
foreach ( $vmData in $allVMData )
|
||||
{
|
||||
if ( $vmData.RoleName -imatch "client" )
|
||||
{
|
||||
$clientVMData = $vmData
|
||||
$noClient = $false
|
||||
}
|
||||
elseif ( $vmData.RoleName -imatch "server" )
|
||||
{
|
||||
$noServer = $fase
|
||||
$serverVMData = $vmData
|
||||
}
|
||||
}
|
||||
if ( $noClient )
|
||||
{
|
||||
Throw "No any master VM defined. Be sure that, Client VM role name matches with the pattern `"*master*`". Aborting Test."
|
||||
}
|
||||
if ( $noServer )
|
||||
{
|
||||
Throw "No any slave VM defined. Be sure that, Server machine role names matches with pattern `"*slave*`" Aborting Test."
|
||||
}
|
||||
#region CONFIGURE VM FOR TERASORT TEST
|
||||
LogMsg "CLIENT VM details :"
|
||||
LogMsg " RoleName : $($clientVMData.RoleName)"
|
||||
LogMsg " Public IP : $($clientVMData.PublicIP)"
|
||||
LogMsg " SSH Port : $($clientVMData.SSHPort)"
|
||||
LogMsg " Location : $($clientVMData.Location)"
|
||||
LogMsg "SERVER VM details :"
|
||||
LogMsg " RoleName : $($serverVMData.RoleName)"
|
||||
LogMsg " Public IP : $($serverVMData.PublicIP)"
|
||||
LogMsg " SSH Port : $($serverVMData.SSHPort)"
|
||||
LogMsg " Location : $($serverVMData.Location)"
|
||||
#
|
||||
# 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 "none"
|
||||
|
||||
#endregion
|
||||
|
||||
LogMsg "Generating constansts.sh ..."
|
||||
$constantsFile = "$LogDir\constants.sh"
|
||||
|
||||
#region Check if VMs share same Public IP
|
||||
Set-Content -Value "#Generated by Azure Automation." -Path $constantsFile
|
||||
|
||||
if ( $clientVMData.PublicIP -eq $serverVMData.PublicIP )
|
||||
{
|
||||
Add-Content -Value "server=$($serverVMData.InternalIP)" -Path $constantsFile
|
||||
Add-Content -Value "client=$($clientVMData.InternalIP)" -Path $constantsFile
|
||||
}
|
||||
else
|
||||
{
|
||||
Add-Content -Value "server=$($serverVMData.PublicIP)" -Path $constantsFile
|
||||
Add-Content -Value "client=$($clientVMData.PublicIP)" -Path $constantsFile
|
||||
}
|
||||
#endregion
|
||||
|
||||
foreach ( $param in $currentTestData.TestParameters.param)
|
||||
{
|
||||
Add-Content -Value "$param" -Path $constantsFile
|
||||
if ($param -imatch "bufferLengths=")
|
||||
{
|
||||
$testBuffers= $param.Replace("bufferLengths=(","").Replace(")","").Split(" ")
|
||||
}
|
||||
if ($param -imatch "connections=" )
|
||||
{
|
||||
$testConnections = $param.Replace("connections=(","").Replace(")","").Split(" ")
|
||||
}
|
||||
if ( $param -imatch "IPversion" )
|
||||
{
|
||||
if ( $param -imatch "IPversion=6" )
|
||||
{
|
||||
$IPVersion = "IPv6"
|
||||
Add-Content -Value "serverIpv6=$($serverVMData.PublicIPv6)" -Path $constantsFile
|
||||
Add-Content -Value "clientIpv6=$($clientVMData.PublicIPv6)" -Path $constantsFile
|
||||
}
|
||||
else
|
||||
{
|
||||
$IPVersion = "IPv4"
|
||||
}
|
||||
}
|
||||
}
|
||||
LogMsg "constanst.sh created successfully..."
|
||||
LogMsg (Get-Content -Path $constantsFile)
|
||||
#endregion
|
||||
|
||||
|
||||
#region EXECUTE TEST
|
||||
$myString = @"
|
||||
cd /root/
|
||||
./perf_iperf3.sh &> iperf3tcpConsoleLogs.txt
|
||||
. azuremodules.sh
|
||||
collect_VM_properties
|
||||
"@
|
||||
Set-Content "$LogDir\Startiperf3tcpTest.sh" $myString
|
||||
RemoteCopy -uploadTo $clientVMData.PublicIP -port $clientVMData.SSHPort -files ".\$constantsFile,.\remote-scripts\azuremodules.sh,.\remote-scripts\perf_iperf3.sh,.\SetupScripts\ConfigureUbuntu1604IPv6.sh,.\$LogDir\Startiperf3tcpTest.sh" -username "root" -password $password -upload
|
||||
RemoteCopy -uploadTo $clientVMData.PublicIP -port $clientVMData.SSHPort -files $currentTestData.files -username "root" -password $password -upload
|
||||
|
||||
$out = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "chmod +x *.sh"
|
||||
$testJob = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "/root/Startiperf3tcpTest.sh" -RunInBackground
|
||||
#endregion
|
||||
|
||||
#region MONITOR TEST
|
||||
while ( (Get-Job -Id $testJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "tail -1 iperf3tcpConsoleLogs.txt"
|
||||
LogMsg "Current Test Staus : $currentStatus"
|
||||
WaitFor -seconds 20
|
||||
}
|
||||
$finalStatus = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "cat /root/state.txt"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "/root/iperf3tcpConsoleLogs.txt"
|
||||
$iperf3LogDir = "$LogDir\iperf3Data"
|
||||
New-Item -itemtype directory -path $iperf3LogDir -Force -ErrorAction SilentlyContinue | Out-Null
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $iperf3LogDir -files "iperf-client-tcp*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $iperf3LogDir -files "iperf-server-tcp*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "VM_properties.csv"
|
||||
|
||||
$testSummary = $null
|
||||
$iperf3LogDir = "$LogDir\iperf3Data"
|
||||
#region START tcp ANALYSIS
|
||||
$clientfolder = $iperf3LogDir
|
||||
$serverfolder = $iperf3LogDir
|
||||
|
||||
#clientData
|
||||
$files = Get-ChildItem -Path $clientfolder
|
||||
$FinalClientThroughputArr=@()
|
||||
$FinalServerThroughputArr=@()
|
||||
|
||||
$FinalServerClientTCPResultObjArr = @()
|
||||
|
||||
function GetTCPDataObject()
|
||||
{
|
||||
$objNode = New-Object -TypeName PSObject
|
||||
Add-Member -InputObject $objNode -MemberType NoteProperty -Name BufferSize -Value $null -Force
|
||||
Add-Member -InputObject $objNode -MemberType NoteProperty -Name Connections -Value $null -Force
|
||||
Add-Member -InputObject $objNode -MemberType NoteProperty -Name ClientTxGbps -Value $null -Force
|
||||
return $objNode
|
||||
}
|
||||
|
||||
foreach ( $Buffer in $testBuffers )
|
||||
{
|
||||
foreach ( $connection in $testConnections )
|
||||
{
|
||||
|
||||
$currentResultObj = GetTCPDataObject
|
||||
|
||||
$currentConnectionClientTxGbps = 0
|
||||
$currentConnectionClientTxGbpsArr = @()
|
||||
|
||||
$currentConnectionserverTxGbps = 0
|
||||
$currentConnectionserverTxGbpsArr = @()
|
||||
|
||||
foreach ( $file in $files )
|
||||
{
|
||||
if ( $file.Name -imatch "iperf-client-tcp-$IPVersion-buffer-$($Buffer)-conn-$connection-instance-*" )
|
||||
{
|
||||
|
||||
$currentInstanceclientJsonText = $null
|
||||
$currentInstanceclientJsonObj = $null
|
||||
$currentInstanceClientPacketLoss = @()
|
||||
$currentInstanceClientThroughput = $null
|
||||
$fileName = $file.Name
|
||||
try
|
||||
{
|
||||
$currentInstanceclientJsonText = ([string]( Get-Content "$clientfolder\$fileName")).Replace("-nan","0")
|
||||
$currentInstanceclientJsonObj = ConvertFrom-Json -InputObject $currentInstanceclientJsonText
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogErr " $fileName : RETURNED NULL"
|
||||
}
|
||||
if ( $currentInstanceclientJsonObj.end.sum_sent )
|
||||
{
|
||||
$currentInstanceClientThroughput = $currentInstanceclientJsonObj.end.sum_sent.bits_per_second/1000000000
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($currentInstanceclientJsonObj.error)
|
||||
{
|
||||
LogErr " $fileName : Error Found : $($currentInstanceclientJsonObj.error)"
|
||||
}
|
||||
$totalStreams = 0
|
||||
$totalBitsPerSecond = 0
|
||||
foreach ( $interval in $currentInstanceclientJsonObj.intervals)
|
||||
{
|
||||
$totalBitsPerSecond += $interval.sum.bits_per_second
|
||||
$totalStreams+=1
|
||||
}
|
||||
if ($totalStreams -ge 1)
|
||||
{
|
||||
LogMsg " $fileName : Analysed $totalStreams intervals."
|
||||
$currentInstanceClientThroughput = ($totalBitsPerSecond/$totalStreams)/1000000000
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr " $fileName : Error : No connection intervals found."
|
||||
}
|
||||
#Write-Host " $($currentJsonObj.error) $currentFileClientThroughput"
|
||||
}
|
||||
if($currentInstanceClientThroughput)
|
||||
{
|
||||
LogMsg " $fileName : Data collected successfully."
|
||||
$currentConnectionClientTxGbpsArr += $currentInstanceClientThroughput
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $file in $files )
|
||||
{
|
||||
if ( $file.Name -imatch "iperf-server-tcp-$IPVersion-buffer-$($Buffer)-conn-$connection-instance-*" )
|
||||
{
|
||||
|
||||
$currentInstanceServerJsonText = $null
|
||||
$currentInstanceServerJsonObj = $null
|
||||
$currentInstanceServerPacketLoss = @()
|
||||
$currentInstanceServerThroughput = $null
|
||||
$fileName = $file.Name
|
||||
try
|
||||
{
|
||||
$currentInstanceServerJsonText = ([string]( Get-Content "$serverfolder\$fileName")).Replace("-nan","0")
|
||||
$currentInstanceServerJsonObj = ConvertFrom-Json -InputObject $currentInstanceServerJsonText
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogErr " $fileName : RETURNED NULL"
|
||||
}
|
||||
if ( $currentInstanceServerJsonObj.end.sum_sent )
|
||||
{
|
||||
$currentInstanceServerThroughput = $currentInstanceServerJsonObj.end.sum_sent.bits_per_second/1000000000
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($currentInstanceServerJsonObj.error)
|
||||
{
|
||||
LogErr " $fileName : Error Found : $($currentInstanceServerJsonObj.error)"
|
||||
}
|
||||
$totalStreams = 0
|
||||
$totalBitsPerSecond = 0
|
||||
foreach ( $interval in $currentInstanceServerJsonObj.intervals)
|
||||
{
|
||||
$totalBitsPerSecond += $interval.sum.bits_per_second
|
||||
$totalStreams+=1
|
||||
}
|
||||
if ($totalStreams -ge 1)
|
||||
{
|
||||
LogMsg " $fileName : Analysed $totalStreams intervals."
|
||||
$currentInstanceServerThroughput = ($totalBitsPerSecond/$totalStreams)/1000000000
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr " $fileName : Error : No connection intervals found."
|
||||
}
|
||||
#Write-Host " $($currentJsonObj.error) $currentFileClientThroughput"
|
||||
}
|
||||
if($currentInstanceServerThroughput)
|
||||
{
|
||||
LogMsg " $fileName : Data collected successfully."
|
||||
$currentConnectionServerTxGbpsArr += $currentInstanceServerThroughput
|
||||
}
|
||||
}
|
||||
}
|
||||
$currentConnectionClientTxGbps = [math]::Round((($currentConnectionClientTxGbpsArr | Measure-Object -Average).Average),2)
|
||||
Write-Host "Client: $Buffer . $connection . $currentConnectionClientTxGbps"
|
||||
$FinalClientThroughputArr += $currentConnectionClientTxGbps
|
||||
$FinalClientTCPLossArr += $currentConnectionClientTCPLoss
|
||||
|
||||
$currentResultObj.BufferSize = $Buffer
|
||||
$currentResultObj.Connections = $connection
|
||||
$currentResultObj.ClientTxGbps = $currentConnectionClientTxGbps
|
||||
|
||||
$FinalServerClientTCPResultObjArr += $currentResultObj
|
||||
Write-Host "-------------------------------"
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
foreach ( $tcpResultObject in $FinalServerClientTCPResultObjArr )
|
||||
{
|
||||
$connResult="ClientTxGbps=$($tcpResultObject.ClientTxGbps)"
|
||||
$metaData = "Buffer=$($tcpResultObject.BufferSize)K Connections=$($tcpResultObject.Connections)"
|
||||
$resultSummary += CreateResultSummary -testResult $connResult -metaData $metaData -checkValues "PASS,FAIL,ABORTED" -testName $currentTestData.testName
|
||||
}
|
||||
if ( $finalStatus -imatch "TestFailed")
|
||||
{
|
||||
LogErr "Test failed. Last known status : $currentStatus."
|
||||
$testResult = "FAIL"
|
||||
}
|
||||
elseif ( $finalStatus -imatch "TestAborted")
|
||||
{
|
||||
LogErr "Test Aborted. Last known status : $currentStatus."
|
||||
$testResult = "ABORTED"
|
||||
}
|
||||
elseif ( $finalStatus -imatch "TestCompleted")
|
||||
{
|
||||
LogMsg "Test Completed."
|
||||
$testResult = "PASS"
|
||||
}
|
||||
elseif ( $finalStatus -imatch "TestRunning")
|
||||
{
|
||||
LogMsg "Powershell backgroud job for test is completed but VM is reporting that test is still running. Please check $LogDir\zkConsoleLogs.txt"
|
||||
LogMsg "Contests of summary.log : $testSummary"
|
||||
$testResult = "PASS"
|
||||
}
|
||||
LogMsg "Test result : $testResult"
|
||||
LogMsg "Test Completed"
|
||||
|
||||
|
||||
LogMsg "Uploading the test results.."
|
||||
$dataSource = $xmlConfig.config.Azure.database.server
|
||||
$user = $xmlConfig.config.Azure.database.user
|
||||
$password = $xmlConfig.config.Azure.database.password
|
||||
$database = $xmlConfig.config.Azure.database.dbname
|
||||
$dataTableName = $xmlConfig.config.Azure.database.dbtable
|
||||
$TestCaseName = $xmlConfig.config.Azure.database.testTag
|
||||
if ($dataSource -And $user -And $password -And $database -And $dataTableName)
|
||||
{
|
||||
$GuestDistro = cat "$LogDir\VM_properties.csv" | Select-String "OS type"| %{$_ -replace ",OS type,",""}
|
||||
|
||||
#$TestCaseName = "LINUX-NEXT-UPSTREAM-TEST"
|
||||
if ( $UseAzureResourceManager )
|
||||
{
|
||||
$HostType = "Azure-ARM"
|
||||
}
|
||||
else
|
||||
{
|
||||
$HostType = "Azure"
|
||||
}
|
||||
$HostBy = ($xmlConfig.config.Azure.General.Location).Replace('"','')
|
||||
$HostOS = cat "$LogDir\VM_properties.csv" | Select-String "Host Version"| %{$_ -replace ",Host Version,",""}
|
||||
$GuestOSType = "Linux"
|
||||
$GuestDistro = cat "$LogDir\VM_properties.csv" | Select-String "OS type"| %{$_ -replace ",OS type,",""}
|
||||
$GuestSize = $clientVMData.InstanceSize
|
||||
$KernelVersion = cat "$LogDir\VM_properties.csv" | Select-String "Kernel version"| %{$_ -replace ",Kernel version,",""}
|
||||
$ProtocolType = "TCP"
|
||||
|
||||
$connectionString = "Server=$dataSource;uid=$user; pwd=$password;Database=$database;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;"
|
||||
$SQLQuery = "INSERT INTO $dataTableName (TestCaseName,TestDate,HostType,HostBy,HostOS,GuestOSType,GuestDistro,GuestSize,KernelVersion,IPVersion,ProtocolType,NumberOfConnections,Throughput_Gbps,Latency_ms) VALUES "
|
||||
|
||||
foreach ($tcpResult in $FinalServerClientTCPResultObjArr)
|
||||
{
|
||||
$SQLQuery += "('$TestCaseName','$(Get-Date -Format yyyy-MM-dd)','$HostType','$HostBy','$HostOS','$GuestOSType','$GuestDistro','$GuestSize','$KernelVersion','$IPVersion','$ProtocolType','$($tcpResult.Connections)','$($tcpResult.ClientTxGbps)','0'),"
|
||||
}
|
||||
$SQLQuery = $SQLQuery.TrimEnd(',')
|
||||
LogMsg $SQLQuery
|
||||
$connection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$connection.ConnectionString = $connectionString
|
||||
$connection.Open()
|
||||
|
||||
$command = $connection.CreateCommand()
|
||||
$command.CommandText = $SQLQuery
|
||||
$result = $command.executenonquery()
|
||||
$connection.Close()
|
||||
LogMsg "Uploading the test results done!!"
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Invalid database details. Failed to upload result to database!"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
LogMsg "EXCEPTION : $ErrorMessage"
|
||||
}
|
||||
Finally
|
||||
{
|
||||
$metaData = "iperf3tcp RESULT"
|
||||
if (!$testResult)
|
||||
{
|
||||
$testResult = "Aborted"
|
||||
}
|
||||
$resultArr += $testResult
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$testResult = "Aborted"
|
||||
$resultArr += $testResult
|
||||
}
|
||||
|
||||
$result = GetFinalResultHeader -resultarr $resultArr
|
||||
|
||||
#Clean up the setup
|
||||
DoTestCleanUp -result $result -testName $currentTestData.testName -deployedServices $isDeployed -ResourceGroups $isDeployed
|
||||
|
||||
#Return the result and summery to the test suite script..
|
||||
return $result, $resultSummary
|
|
@ -48,11 +48,25 @@ if ($isDeployed)
|
|||
|
||||
#endregion
|
||||
|
||||
if($EnableAcceleratedNetworking)
|
||||
{
|
||||
$DataPath = "SRIOV"
|
||||
LogMsg "Getting SRIOV NIC Name."
|
||||
$nicName = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "dmesg | grep 'VF registering' | tail -1 | awk '{ print `$NF }'"
|
||||
LogMsg "SRIOV NIC: $nicName"
|
||||
}
|
||||
else
|
||||
{
|
||||
$DataPath = "Synthetic"
|
||||
$nicName = "eth0"
|
||||
}
|
||||
|
||||
LogMsg "Generating constansts.sh ..."
|
||||
$constantsFile = "$LogDir\constants.sh"
|
||||
Set-Content -Value "#Generated by Azure Automation." -Path $constantsFile
|
||||
Add-Content -Value "server=$($serverVMData.InternalIP)" -Path $constantsFile
|
||||
Add-Content -Value "client=$($clientVMData.InternalIP)" -Path $constantsFile
|
||||
Add-Content -Value "nicName=$nicName" -Path $constantsFile
|
||||
foreach ( $param in $currentTestData.TestParameters.param)
|
||||
{
|
||||
Add-Content -Value "$param" -Path $constantsFile
|
||||
|
@ -80,14 +94,17 @@ collect_VM_properties
|
|||
#region MONITOR TEST
|
||||
while ( (Get-Job -Id $testJob).State -eq "Running" )
|
||||
{
|
||||
$currentStatus = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "tail -5 ntttcpConsoleLogs.txt | head -1"
|
||||
$currentStatus = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "tail -2 ntttcpConsoleLogs.txt | head -1"
|
||||
LogMsg "Current Test Staus : $currentStatus"
|
||||
WaitFor -seconds 20
|
||||
}
|
||||
$finalStatus = RunLinuxCmd -ip $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -command "cat /root/state.txt"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "/root/ntttcpConsoleLogs.txt"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "lagscope-ntttcp-*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "ntttcp-p*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "ntttcp-sender-p*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "mpstat-sender-p*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "dstat-sender-p*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "sar-sender-p*"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "report.log"
|
||||
RemoteCopy -downloadFrom $clientVMData.PublicIP -port $clientVMData.SSHPort -username "root" -password $password -download -downloadTo $LogDir -files "VM_properties.csv"
|
||||
|
||||
|
@ -101,12 +118,19 @@ collect_VM_properties
|
|||
}
|
||||
try
|
||||
{
|
||||
$uploadResults = $true
|
||||
$test_connections = $line.Trim().Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Split(" ")[0]
|
||||
$throughput_gbps = $line.Trim().Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Split(" ")[1]
|
||||
$average_tcp_latency = $line.Trim().Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Split(" ")[2]
|
||||
$cycle_per_byte = $line.Trim().Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Split(" ")[2]
|
||||
$average_tcp_latency = $line.Trim().Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Replace(" "," ").Split(" ")[3]
|
||||
$metadata = "Connections=$test_connections"
|
||||
$connResult = "throughput=$throughput_gbps`Gbps Avg_TCP_lat=$average_tcp_latency"
|
||||
$connResult = "throughput=$throughput_gbps`Gbps cyclePerBytet=$cycle_per_byte Avg_TCP_lat=$average_tcp_latency"
|
||||
$resultSummary += CreateResultSummary -testResult $connResult -metaData $metaData -checkValues "PASS,FAIL,ABORTED" -testName $currentTestData.testName
|
||||
if ([string]$throughput_gbps -imatch "0.00")
|
||||
{
|
||||
$uploadResults = $false
|
||||
$testResult = "FAIL"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -125,7 +149,7 @@ collect_VM_properties
|
|||
LogErr "Test Aborted. Last known status : $currentStatus."
|
||||
$testResult = "ABORTED"
|
||||
}
|
||||
elseif ( $finalStatus -imatch "TestCompleted")
|
||||
elseif ( ($finalStatus -imatch "TestCompleted") -and $uploadResults )
|
||||
{
|
||||
LogMsg "Test Completed."
|
||||
$testResult = "PASS"
|
||||
|
@ -136,7 +160,7 @@ collect_VM_properties
|
|||
LogMsg "Contests of summary.log : $testSummary"
|
||||
$testResult = "PASS"
|
||||
}
|
||||
LogMsg "Test result : $testResult"
|
||||
|
||||
LogMsg "Test Completed"
|
||||
|
||||
LogMsg "Uploading the test results.."
|
||||
|
@ -167,14 +191,6 @@ collect_VM_properties
|
|||
$KernelVersion = cat "$LogDir\VM_properties.csv" | Select-String "Kernel version"| %{$_ -replace ",Kernel version,",""}
|
||||
$IPVersion = "IPv4"
|
||||
$ProtocolType = "TCP"
|
||||
if($EnableAcceleratedNetworking)
|
||||
{
|
||||
$DataPath = "SRIOV"
|
||||
}
|
||||
else
|
||||
{
|
||||
$DataPath = "Synthetic"
|
||||
}
|
||||
$connectionString = "Server=$dataSource;uid=$user; pwd=$password;Database=$database;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;"
|
||||
$LogContents = Get-Content -Path "$LogDir\report.log"
|
||||
$SQLQuery = "INSERT INTO $dataTableName (TestCaseName,TestDate,HostType,HostBy,HostOS,GuestOSType,GuestDistro,GuestSize,KernelVersion,IPVersion,ProtocolType,DataPath,NumberOfConnections,Throughput_Gbps,Latency_ms) VALUES "
|
||||
|
@ -186,20 +202,30 @@ collect_VM_properties
|
|||
}
|
||||
$SQLQuery = $SQLQuery.TrimEnd(',')
|
||||
LogMsg $SQLQuery
|
||||
$connection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$connection.ConnectionString = $connectionString
|
||||
$connection.Open()
|
||||
if ($uploadResults)
|
||||
{
|
||||
$connection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$connection.ConnectionString = $connectionString
|
||||
$connection.Open()
|
||||
|
||||
$command = $connection.CreateCommand()
|
||||
$command.CommandText = $SQLQuery
|
||||
$result = $command.executenonquery()
|
||||
$connection.Close()
|
||||
LogMsg "Uploading the test results done!!"
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr "Uploading the test results cancelled due to zero throughput for some connections!!"
|
||||
$testResult = "FAIL"
|
||||
}
|
||||
|
||||
$command = $connection.CreateCommand()
|
||||
$command.CommandText = $SQLQuery
|
||||
$result = $command.executenonquery()
|
||||
$connection.Close()
|
||||
LogMsg "Uploading the test results done!!"
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMsg "Invalid database details. Failed to upload result to database!"
|
||||
}
|
||||
LogMsg "Test result : $testResult"
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ InstallIPERF3()
|
|||
LogMsg "Detected Ubuntu"
|
||||
ssh ${1} "until dpkg --force-all --configure -a; sleep 10; do echo 'Trying again...'; done"
|
||||
ssh ${1} "apt-get update"
|
||||
ssh ${1} "apt-get -y install iperf3 sysstat bc"
|
||||
ssh ${1} "apt-get -y install iperf3 sysstat bc psmisc"
|
||||
if [ $IPversion -eq 6 ]; then
|
||||
scp ConfigureUbuntu1604IPv6.sh ${1}:
|
||||
ssh ${1} "chmod +x ConfigureUbuntu1604IPv6.sh"
|
||||
|
@ -60,14 +60,14 @@ InstallIPERF3()
|
|||
then
|
||||
LogMsg "Detected Redhat/CentOS 6.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install iperf3 sysstat bc"
|
||||
ssh ${1} "yum -y --nogpgcheck install iperf3 sysstat bc psmisc"
|
||||
ssh ${1} "iptables -F"
|
||||
|
||||
elif [[ $DISTRO =~ "Red Hat Enterprise Linux Server release 7" ]] || [[ $DISTRO =~ "CentOS Linux release 7" ]];
|
||||
then
|
||||
LogMsg "Detected Redhat/CentOS 7.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install iperf3 sysstat bc"
|
||||
ssh ${1} "yum -y --nogpgcheck install iperf3 sysstat bc psmisc"
|
||||
ssh ${1} "iptables -F"
|
||||
|
||||
else
|
||||
|
@ -146,8 +146,8 @@ if [ ! ${connections} ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! ${bufferLenghs} ]; then
|
||||
errMsg="Please add/provide value for bufferLenghs in constants.sh. bufferLenghs=(1 8). Note buffer lenghs are in KB"
|
||||
if [ ! ${bufferLengths} ]; then
|
||||
errMsg="Please add/provide value for bufferLengths in constants.sh. bufferLengths=(1 8). Note buffer lenghs are in Bytest"
|
||||
LogMsg "${errMsg}"
|
||||
echo "${errMsg}" >> ./summary.log
|
||||
UpdateTestState $ICA_TESTABORTED
|
||||
|
@ -182,7 +182,7 @@ fi
|
|||
|
||||
|
||||
#connections=(64 128)
|
||||
#BufferLenghts are in K
|
||||
#BufferLenghts are in Bytes
|
||||
#max_parallel_connections_per_instance=64
|
||||
#Make & build IPERF3 on client and server Machine
|
||||
|
||||
|
@ -201,7 +201,7 @@ ssh ${client} "rm -rf iperf-server-*"
|
|||
#BufferLenghts are in K
|
||||
#bufferLenghs=(1 8)
|
||||
|
||||
for current_buffer in "${bufferLenghs[@]}"
|
||||
for current_buffer in "${bufferLengths[@]}"
|
||||
do
|
||||
for current_test_connections in "${connections[@]}"
|
||||
do
|
||||
|
@ -223,7 +223,7 @@ for current_buffer in "${bufferLenghs[@]}"
|
|||
while [ $currentIperfInstanses -lt $num_threads_n ]
|
||||
do
|
||||
currentIperfInstanses=$(($currentIperfInstanses+1))
|
||||
serverCommand="iperf3 -s -1 -J -i10 -f g -p ${currentPort} > iperf-server-${testType}-IPv${IPversion}-buffer-${current_buffer}K-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
serverCommand="iperf3 -s -1 -J -i10 -f g -p ${currentPort} > iperf-server-${testType}-IPv${IPversion}-buffer-${current_buffer}-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
ssh ${server} $serverCommand &
|
||||
LogMsg "Executed: $serverCommand"
|
||||
currentPort=$(($currentPort+1))
|
||||
|
@ -249,11 +249,11 @@ for current_buffer in "${bufferLenghs[@]}"
|
|||
|
||||
if [[ "$testType" == "udp" ]];
|
||||
then
|
||||
clientCommand="iperf3 -c $testServer -u -b 0 -J -f g -i10 -l ${current_buffer}K -t ${testDuration} -p ${currentPort} -P $num_threads_P -${IPversion} > iperf-client-${testType}-IPv${IPversion}-buffer-${current_buffer}K-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
clientCommand="iperf3 -c $testServer -u -b 0 -J -f g -i10 -l ${current_buffer} -t ${testDuration} -p ${currentPort} -P $num_threads_P -${IPversion} > iperf-client-${testType}-IPv${IPversion}-buffer-${current_buffer}-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
fi
|
||||
if [[ "$testType" == "tcp" ]];
|
||||
then
|
||||
clientCommand="iperf3 -c $testServer -b 0 -J -f g -i10 -w ${current_buffer}K -t ${testDuration} -p ${currentPort} -P $num_threads_P -${IPversion} > iperf-client-${testType}-IPv${IPversion}-buffer-${current_buffer}K-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
clientCommand="iperf3 -c $testServer -b 0 -J -f g -i10 -l ${current_buffer} -t ${testDuration} -p ${currentPort} -P $num_threads_P -${IPversion} > iperf-client-${testType}-IPv${IPversion}-buffer-${current_buffer}-conn-$current_test_connections-instance-${currentIperfInstanses}.txt 2>&1"
|
||||
fi
|
||||
|
||||
ssh ${client} $clientCommand &
|
||||
|
@ -261,12 +261,13 @@ for current_buffer in "${bufferLenghs[@]}"
|
|||
currentPort=$(($currentPort+1))
|
||||
sleep 0.1
|
||||
done
|
||||
LogMsg "Iperf3 running buffer ${current_buffer}K $num_threads_P X $num_threads_n ..."
|
||||
LogMsg "Iperf3 running buffer ${current_buffer}Bytes $num_threads_P X $num_threads_n ..."
|
||||
sleep ${testDuration}
|
||||
timeoutSeconds=900
|
||||
sleep 5
|
||||
var=`ps -C "iperf3 -c" --no-headers | wc -l`
|
||||
while [ $var -gt 0 ]
|
||||
echo $var
|
||||
while [[ $var -gt 0 ]];
|
||||
do
|
||||
timeoutSeconds=`expr $timeoutSeconds - 1`
|
||||
if [ $timeoutSeconds -eq 0 ]; then
|
||||
|
@ -282,8 +283,8 @@ for current_buffer in "${bufferLenghs[@]}"
|
|||
done
|
||||
#Sleep extra 5 seconds.
|
||||
sleep 5
|
||||
LogMsg "Iperf3 Finished buffer ${current_buffer}K $num_threads_P X $num_threads_n ..."
|
||||
LogMsg "Iperf3 Finished buffer ${current_buffer} $num_threads_P X $num_threads_n ..."
|
||||
done
|
||||
done
|
||||
scp ${server}:iperf-server-* ./
|
||||
UpdateTestState ICA_TESTCOMPLETED
|
||||
UpdateTestState ICA_TESTCOMPLETED
|
||||
|
|
|
@ -51,7 +51,7 @@ InstallNTTTCP() {
|
|||
LogMsg "Configuring ${1} for ntttcp test..."
|
||||
ssh ${1} "until dpkg --force-all --configure -a; sleep 10; do echo 'Trying again...'; done"
|
||||
ssh ${1} "apt-get update"
|
||||
ssh ${1} "apt-get -y install libaio1 sysstat git bc make gcc"
|
||||
ssh ${1} "apt-get -y install libaio1 sysstat git bc make gcc dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
|
@ -63,7 +63,7 @@ InstallNTTTCP() {
|
|||
then
|
||||
LogMsg "Detected Redhat 6.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc dstat psmisc"
|
||||
ssh ${1} "yum -y --nogpgcheck install gcc-c++"
|
||||
|
||||
ssh ${1} "wget http://ftp.heanet.ie/mirrors/gnu/libc/glibc-2.14.1.tar.gz"
|
||||
|
@ -82,7 +82,7 @@ InstallNTTTCP() {
|
|||
then
|
||||
LogMsg "Detected Redhat 7.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
|
@ -95,7 +95,7 @@ InstallNTTTCP() {
|
|||
then
|
||||
LogMsg "Detected CentOS 6.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc dstat psmisc"
|
||||
ssh ${1} "yum -y --nogpgcheck install gcc-c++"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
|
@ -109,7 +109,7 @@ InstallNTTTCP() {
|
|||
then
|
||||
LogMsg "Detected CentOS 7.x"
|
||||
ssh ${1} "rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc"
|
||||
ssh ${1} "yum -y --nogpgcheck install libaio1 sysstat git bc make gcc dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
|
@ -122,7 +122,7 @@ InstallNTTTCP() {
|
|||
then
|
||||
LogMsg "Detected SLES12"
|
||||
ssh ${1} "zypper --no-gpg-checks --non-interactive --gpg-auto-import-keys remove gettext-runtime-mini*"
|
||||
ssh ${1} "zypper --no-gpg-checks --non-interactive --gpg-auto-import-keys install sysstat git bc make gcc grub2"
|
||||
ssh ${1} "zypper --no-gpg-checks --non-interactive --gpg-auto-import-keys install sysstat git bc make gcc grub2 dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
|
@ -181,6 +181,13 @@ if [ ! ${testDuration} ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! ${nicName} ]; then
|
||||
errMsg="Please add/provide value for nicName in constants.sh. nicName=eth0/bond0"
|
||||
LogMsg "${errMsg}"
|
||||
echo "${errMsg}" >> ./summary.log
|
||||
UpdateTestState $ICA_TESTABORTED
|
||||
exit 1
|
||||
fi
|
||||
#Make & build ntttcp on client and server Machine
|
||||
|
||||
LogMsg "Configuring client ${client}..."
|
||||
|
@ -196,7 +203,7 @@ ssh root@${client} "wget https://raw.githubusercontent.com/iamshital/linux_perfo
|
|||
ssh root@${client} "chmod +x run-ntttcp-and-tcping.sh && chmod +x report-ntttcp-and-tcping.sh"
|
||||
LogMsg "Now running NTTTCP test"
|
||||
ssh root@${client} "rm -rf ntttcp-test-logs"
|
||||
ssh root@${client} "./run-ntttcp-and-tcping.sh ntttcp-test-logs ${server} root ${testDuration}"
|
||||
ssh root@${client} "./run-ntttcp-and-tcping.sh ntttcp-test-logs ${server} root ${testDuration} ${nicName}"
|
||||
ssh root@${client} "./report-ntttcp-and-tcping.sh ntttcp-test-logs"
|
||||
ssh root@${client} "cp ntttcp-test-logs/* ."
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче