Added new Mesh network performance test - NETWORK-PERF-MESH-TEST

This commit is contained in:
Sivakanth 2015-06-29 19:37:58 +05:30
Родитель 6a66f7d05a
Коммит 73306337c9
6 изменённых файлов: 400 добавлений и 0 удалений

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

@ -1347,6 +1347,121 @@
</VirtualMachine>
</HostedService>
</BVTDeployment>
<MeshVM>
<isDeployed>NO</isDeployed>
<HostedService>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>22</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>122</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>222</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>322</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>422</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>522</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>622</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>722</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>822</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
<VirtualMachine>
<state></state>
<InstanceSize>Small</InstanceSize>
<EndPoints>
<Name>SSH</Name>
<Protocol>tcp</Protocol>
<LocalPort>22</LocalPort>
<PublicPort>922</PublicPort>
</EndPoints>
<DataDisk></DataDisk>
</VirtualMachine>
</HostedService>
</MeshVM>
<VMImage>
<isDeployed>NO</isDeployed>
<HostedService>
@ -2974,6 +3089,18 @@
<TestID>Perf_002</TestID>
<Priority>P0</Priority>
</test>
<test>
<testName>NETWORK-PERF-MESH-TEST</testName>
<testScript>meshnetwork-perf-main.sh,meshnetwork-perf-server.sh,meshnetwork-perf-client.sh</testScript>
<testScriptps1>NETWORK-PERF-MESH-TEST.ps1</testScriptps1>
<SubtestValues>32,64,512,1000,2000,4000,6000</SubtestValues>
<files>remote-scripts\meshnetwork-perf-main.sh,remote-scripts\meshnetwork-perf-server.sh,remote-scripts\meshnetwork-perf-client.sh,remote-scripts\sar-top.sh</files>
<setupType>MeshVM</setupType>
<TestType></TestType>
<TestFeature></TestFeature>
<TestID>Perf_003</TestID>
<Priority>P0</Priority>
</test>
<test>
<testName>ICA-FIO-TEST</testName>
@ -3777,6 +3904,9 @@
<test>
<Name>NETWORK-PERF-THROUGHPUT-6K-CONNETCTIONS-TEST</Name>
</test>
<test>
<Name>NETWORK-PERF-MESH-TEST</Name>
</test>
</Cycle>
<!-- E2E tests -->

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

@ -0,0 +1,107 @@
Import-Module .\TestLibs\RDFELibs.psm1 -Force
$Subtests= $currentTestData.SubtestValues
$SubtestValues = $Subtests.Split(",")
$duration = 600
$result = ""
$testResult = ""
$resultArr = @()
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
if($isDeployed)
{
$hs1Name = $isDeployed
$testServiceData = Get-AzureService -ServiceName $hs1Name
#Get VMs deployed in the service..
$testVMsinService = $testServiceData | Get-AzureVM
$hs1vm1 = $testVMsinService[0]
$hs1vm1Endpoints = $hs1vm1 | Get-AzureEndpoint
$hs1VIP = $hs1vm1Endpoints[0].Vip
$hs1ServiceUrl = $hs1vm1.DNSName
$hs1ServiceUrl = $hs1ServiceUrl.Replace("http://","")
$hs1ServiceUrl = $hs1ServiceUrl.Replace("/","")
$hs1vm1IP = $hs1vm1.IpAddress
$hs1vm1Hostname = $hs1vm1.InstanceName
$hs1vm10 = $testVMsinService[9]
$hs1vm10IP = $hs1vm10.IpAddress
$hs1vm10Hostname = $hs1vm10.InstanceName
$hs1vm10Endpoints = $hs1vm10 | Get-AzureEndpoint
$hs1vm1sshport = GetPort -Endpoints $hs1vm1Endpoints -usage ssh
$hs1vm10sshport = GetPort -Endpoints $hs1vm10Endpoints -usage ssh
Remove-Item hostnames.txt | Out-Null
foreach($i in $testVMsinService)
{
$i.HostName >> hostnames.txt
}
foreach ($NumberofConnections in $SubtestValues)
{
try
{
$testResult = $null
LogMsg "Test Started for Parallel Connections $NumberofConnections"
function UploadFiles()
{
$out = RemoteCopy -uploadTo $hs1VIP -port $hs1vm10sshport -files $currentTestData.files -username $user -password $password -upload 2>&1 | Out-Null
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command "chmod +x *" -runAsSudo 2>&1 | Out-Null
$out = RemoteCopy -uploadTo $hs1VIP -port $hs1vm10sshport -files hostnames.txt -username $user -password $password -upload 2>&1 | Out-Null
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command "dos2unix *" -runAsSudo 2>&1 | Out-Null
return $true
}
if(!$filesUploaded)
{
$filesUploaded = UploadFiles
}
$TestStatus = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command "bash $($currentTestData.testScript.Split(',')[0]) $user $password $($currentTestData.testScript.Split(',')[1]) $($currentTestData.testScript.Split(',')[2]) $NumberofConnections $duration" -runAsSudo -runmaxallowedtime 1200 -ignoreLinuxExitCode
function CollectLogs()
{
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command "mkdir logs" -runAsSudo 2>&1 | Out-Null
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command 'mv *.log *.txt logs/' -runAsSudo 2>&1 | Out-Null
$out = RunLinuxCmd -username $user -password $password -ip $hs1VIP -port $hs1vm10sshport -command "tar -cvf logs.tar logs" -runAsSudo 2>&1 | Out-Null
$out = RemoteCopy -download -downloadFrom $hs1VIP -files "/home/$user/logs.tar" -downloadTo $LogDir -port $hs1vm10sshport -username $user -password $password 2>&1 | Out-Null
return $true
}
if($TestStatus -imatch "Mesh Network test Success")
{
LogMsg "Mesh network test completed Successfully.."
$testResult = "PASS"
}
else
{
LogErr "Mesh network test failed.."
$testResult = "FAIL"
}
LogMsg "$($currentTestData.testName) : $NumberofConnections : $testResult"
}
catch
{
$ErrorMessage = $_.Exception.Message
LogMsg "EXCEPTION : $ErrorMessage"
}
Finally
{
$metaData = $NumberofConnections
if (!$testResult)
{
$testResult = "Aborted"
}
$resultArr += $testResult
$resultSummary += CreateResultSummary -testResult $testResult -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!
}
}
$logs = CollectLogs
}
else
{
$testResult = "Aborted"
$resultArr += $testResult
}
$result = GetFinalResultHeader -resultarr $resultArr
#Clean up the setup
#DoTestCleanUp -result $result -testName $currentTestData.testName -deployedServices $isDeployed
#Return the result and summery to the test suite script..
return $result,$resultSummary

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

@ -0,0 +1,40 @@
#!/bin/bash
nc=$1
duration=$2
echo "Starting iperf client in `hostname`"
echo "Num of Connections: $nc"
total_no_vms=`cat hostnames.txt | wc -l`
nc_vm=$(($nc/$((($total_no_vms-1)*2))))
echo "Num of Connections per VM $nc_vm"
my_hostname=`hostname`
my_vm_number=`cat hostnames.txt | grep -n $my_hostname$| sed s/:.*//`
hostnames=(`cat hostnames.txt`)
#start sar with nc and time in its name
echo "stating sar in client `hostname`"
sarlog=$nc-`hostname`
bash sar-top.sh $duration $sarlog &
for server_vm_number in `seq 0 $((${#hostnames[@]}-1))`
do
if [ ${hostnames[$server_vm_number]} != $my_hostname ]
then
number_of_connections=$nc_vm
echo $server_vm_number:$my_vm_number
port_number=$((8001+($my_vm_number-1)*6))
while [ $number_of_connections -gt 64 ]; do
number_of_connections=$(($number_of_connections-64))
echo "iperf3 -c ${hostnames[$server_vm_number]} -p $port_number -P 64 -t $duration >> `hostname`-clientlog.txt &" # /dev/null &
iperf3 -c ${hostnames[$server_vm_number]} -p $port_number -P 64 -t $duration > /dev/null &
port_number=$((port_number+1))
done
echo "iperf3 -c ${hostnames[$server_vm_number]} -p $port_number -P $number_of_connections -t $duration >> `hostname`-clientlog.txt &" #/dev/null"
iperf3 -c ${hostnames[$server_vm_number]} -p $port_number -P $number_of_connections -t $duration > /dev/null &
fi
done
iperf_count=`pgrep iperf3 | wc -l`
if [ $iperf_count -gt 100 ]; then
echo "iperf clients is running in `hostname`"
else
echo "iperf clients is not running in `hostname`"
fi
exit 0

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

@ -0,0 +1,94 @@
#!/bin/bash
#Prerequisites: iperf3, sysstat(for sar), dos2unix
user=$1
passwd=$2
server_file=$3
client_file=$4
num_of_connections=$5
duration=$6
hostnames=(`cat hostnames.txt`)
count=0
mainlog="$num_of_connections"_main_log.txt
serverlog="$num_of_connections"_server_status.txt
clientlog="$num_of_connections"_client_status.txt
[ -f $mainlog ] && rm -rf $mainlog
[ -f $serverlog ] && rm -rf $serverlog
[ -f $clientlog ] && rm -rf $clientlog
#Process to start server..
while [ "x${hostnames[count]}" != "x" ]
do
echo ${hostnames[count]} >> $mainlog
if [ `hostname` == ${hostnames[$count]} ]; then
echo "start server in localhost" >> $mainlog
bash $server_file >> $serverlog
else
echo "copying server file to ${hostnames[$count]} and start server" >> $mainlog
sshpass -p $passwd scp -o StrictHostKeyChecking=no $server_file $client_file hostnames.txt sar-top.sh $user@${hostnames[$count]}:/home/$user
sshpass -p $passwd ssh -o StrictHostKeyChecking=no $user@${hostnames[$count]} "bash $server_file" >> $serverlog
fi
count=$(( $count + 1 ))
done
#Process to start client..
server_status=`cat $serverlog | grep "iperf server is running" | wc -l`
echo "Server status: $server_status" >> $mainlog
if [ $server_status == `cat hostnames.txt | wc -l` ]; then
echo "iperf server is running in all machines.." >> $mainlog
count=0
while [ "x${hostnames[count]}" != "x" ]
do
echo ${hostnames[count]} >> $mainlog
if [ `hostname` == ${hostnames[$count]} ]; then
echo "starting client in localhost" >> $mainlog
bash $client_file $num_of_connections $duration >> $clientlog &
else
echo "starting client in ${hostnames[$count]}" >> $mainlog
sshpass -p $passwd ssh -o StrictHostKeyChecking=no $user@${hostnames[$count]} "bash $client_file $num_of_connections $duration" >> $clientlog &
fi
count=$(( $count + 1 ))
done
else
echo "iperf server is not running, check server status.." >> $mainlog
echo "Mesh Network test Failed"
exit 10
fi
echo "iperf tests are running please wait"
sleep $(( $duration + 120 ))
count=0
iperf_status=0
while [ "x${hostnames[count]}" != "x" ]
do
echo "verifying iperf client status in ${hostnames[$count]}" >> $mainlog
iperfc_count=`sshpass -p $passwd ssh -o StrictHostKeyChecking=no $user@${hostnames[$count]} "pgrep iperf3| wc -l"`
if [ $iperfc_count != 100 ]; then
echo "IPERF client status in ${hostnames[$count]}:$iperfc_count" >> $mainlog
iperf_status=$(( $iperf_status + 1 ))
else
echo "Iperf test completed in ${hostnames[$count]}" >> $mainlog
fi
count=$(( $count + 1 ))
done
if [ $iperf_status != 0 ]; then
echo "Mesh Network test Failed"
else
echo "Mesh Network test Success"
#collecting logs..
count=0
while [ "x${hostnames[count]}" != "x" ]
do
echo ${hostnames[count]} >> $mainlog
if [ `hostname` == ${hostnames[$count]} ]; then
echo "copying localhost logs" >> $mainlog
else
echo "copying logs from ${hostnames[$count]} to localhost " >> $mainlog
sshpass -p $passwd scp -o StrictHostKeyChecking=no $user@${hostnames[$count]}:/home/$user/$num_of_connections"-*.log" /home/$user/ >> $mainlog
fi
count=$(( $count + 1 ))
done
fi
exit 0

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

@ -0,0 +1,15 @@
#!/bin/bash
#Running iperf3 server for 8001 to 8100 ports
killall iperf3 > /dev/null 2>&1
for i in {8001..8100}
do
iperf3 -s -D -p $i
done
count=$(pgrep iperf3 | wc -l)
if [ $count -eq 100 ]; then
echo "iperf server is running and available from 8001 to 8100 ports in `hostname`"
else
echo "iperf server is not running as a daemon"
fi
exit 0

14
remote-scripts/sar-top.sh Normal file
Просмотреть файл

@ -0,0 +1,14 @@
#!/bin/bash
duration=$1
filename=$2
echo $filename-top.log $duration $filename $filename-sar.log
[ -f $filename-top.log ] && rm -rf $filename-top.log
[ -f $filename-sar.log ] && rm -rf $filename-sar.log
sar -n DEV 1 $duration 2>&1 > $filename-sar.log&
for i in $(seq 1 $duration)
do
top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}' >> $filename-top.log
sleep 1
done
exit 0