Merge remote-tracking branch 'upstream/master'
This commit is contained in:
Коммит
785940e3ce
|
@ -0,0 +1,85 @@
|
|||
if ( $customSecretsFilePath )
|
||||
{
|
||||
$secretsFile = $customSecretsFilePath
|
||||
Write-Host "Using provided secrets file: $($secretsFile | Split-Path -Leaf)"
|
||||
}
|
||||
if ($env:Azure_Secrets_File)
|
||||
{
|
||||
$secretsFile = $env:Azure_Secrets_File
|
||||
Write-Host "Using predefined secrets file: $($secretsFile | Split-Path -Leaf) in Jenkins Global Environments."
|
||||
}
|
||||
if ( $secretsFile -eq $null )
|
||||
{
|
||||
Write-Host "ERROR: Azure Secrets file not found in Jenkins / user not provided -customSecretsFilePath" -ForegroundColor Red -BackgroundColor Black
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if ( Test-Path $secretsFile)
|
||||
{
|
||||
Write-Host "$($secretsFile | Split-Path -Leaf) found."
|
||||
$xmlSecrets = [xml](Get-Content $secretsFile)
|
||||
.\AddAzureRmAccountFromSecretsFile.ps1 -customSecretsFilePath $secretsFile
|
||||
$subscriptionID = $xmlSecrets.secrets.SubscriptionID
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$($secretsFile | Split-Path -Leaf) file is not added in Jenkins Global Environments OR it is not bound to 'Azure_Secrets_File' variable." -ForegroundColor Red -BackgroundColor Black
|
||||
Write-Host "Aborting." -ForegroundColor Red -BackgroundColor Black
|
||||
exit 1
|
||||
}
|
||||
|
||||
$newFile = "Z:\Jenkins_Shared_Do_Not_Delete\userContent\shared\azure-vm-sizes.txt"
|
||||
$oldFile = "Z:\Jenkins_Shared_Do_Not_Delete\userContent\shared\azure-vm-sizes-base.txt"
|
||||
$fallback ="Z:\Jenkins_Shared_Do_Not_Delete\userContent\shared\azure-vm-sizes-fallback.txt"
|
||||
Write-Host "Getting regions"
|
||||
Copy-Item -Path $oldFile -Destination $fallback -Verbose -Force
|
||||
Remove-Item -Path $oldFile -Verbose -Force
|
||||
Copy-Item -Path $newFile -Destination $oldFile -Verbose -Force
|
||||
Remove-Item -Path $newFile -Force -Verbose
|
||||
$allRegions = (Get-AzureRmLocation).Location
|
||||
$allRegions = "eastasia,southeastasia".Split(",")
|
||||
foreach ( $region in $allRegions)
|
||||
{
|
||||
try
|
||||
{
|
||||
Write-Host "Getting VM sizes from $region"
|
||||
$vmSizes = Get-AzureRmVMSize -Location $region
|
||||
foreach ( $vmSize in $vmSizes )
|
||||
{
|
||||
Add-Content -Value "$region $($vmSize.Name)" -Path $newFile -Force
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Error "Failed to fetch data from $region."
|
||||
}
|
||||
}
|
||||
|
||||
$newVMSizes = Compare-Object -ReferenceObject (Get-Content -Path $oldFile ) -DifferenceObject (Get-Content -Path $newFile)
|
||||
$newVMs = 0
|
||||
$newVMsString = $null
|
||||
foreach ( $newSize in $newVMSizes )
|
||||
{
|
||||
if ( $newSize.SideIndicator -eq '=>')
|
||||
{
|
||||
$newVMs += 1
|
||||
Write-Host "$newVMs. $($newSize.InputObject)"
|
||||
$newVMsString += "$($newSize.InputObject),"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$newVMs. $($newSize.InputObject) $($newSize.SideIndicator)"
|
||||
}
|
||||
}
|
||||
if ( $newVMs -eq 0)
|
||||
{
|
||||
Write-Host "No New sizes today."
|
||||
Set-Content -Value "NO_NEW_VMS" -Path todaysNewVMs.txt -NoNewline
|
||||
}
|
||||
else
|
||||
{
|
||||
Set-Content -Value $($newVMsString.TrimEnd(",")) -Path todaysNewVMs.txt -NoNewline
|
||||
}
|
||||
Write-Host "Exiting with zero"
|
||||
exit 0
|
|
@ -142,6 +142,11 @@ elseif ($StorageAccount -eq "")
|
|||
$StorageAccountName = $regionStorageMapping.AllRegions.$regionName.StandardStorage
|
||||
Write-Host "Auto selecting storage account : $StorageAccountName as per your test region."
|
||||
}
|
||||
elseif ($StorageAccount -ne "")
|
||||
{
|
||||
$StorageAccountName = $StorageAccount.Trim()
|
||||
Write-Host "Selecting custom storage account : $StorageAccountName as per your test region."
|
||||
}
|
||||
#if ($defaultDestinationStorageAccount -ne $StorageAccountName)
|
||||
#{
|
||||
# $OsVHD = "https://$defaultDestinationStorageAccount.blob.core.windows.net/vhds/$OsVHD"
|
||||
|
|
|
@ -2701,26 +2701,33 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [
|
|||
{
|
||||
if($DeployedServices -or $ResourceGroups)
|
||||
{
|
||||
foreach ($vmData in $allVMData)
|
||||
try
|
||||
{
|
||||
$out = RemoteCopy -upload -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files .\remote-scripts\CollectLogFile.sh -username $user -password $password
|
||||
$out = RunLinuxCmd -username $user -password $password -ip $vmData.PublicIP -port $vmData.SSHPort -command "bash CollectLogFile.sh" -ignoreLinuxExitCode
|
||||
$out = RemoteCopy -downloadFrom $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -files "$($vmData.RoleName)-*.txt" -downloadTo "$LogDir" -download
|
||||
$finalKernelVersion = Get-Content "$LogDir\$($vmData.RoleName)-kernelVersion.txt"
|
||||
Set-Variable -Name finalKernelVersion -Value $finalKernelVersion -Scope Global
|
||||
#region LIS Version
|
||||
$tempLIS = (Select-String -Path "$LogDir\$($vmData.RoleName)-lis.txt" -Pattern "^version:").Line
|
||||
if ($tempLIS)
|
||||
foreach ($vmData in $allVMData)
|
||||
{
|
||||
$finalLISVersion = $tempLIS.Split(":").Trim()[1]
|
||||
$out = RemoteCopy -upload -uploadTo $vmData.PublicIP -port $vmData.SSHPort -files .\remote-scripts\CollectLogFile.sh -username $user -password $password
|
||||
$out = RunLinuxCmd -username $user -password $password -ip $vmData.PublicIP -port $vmData.SSHPort -command "bash CollectLogFile.sh" -ignoreLinuxExitCode
|
||||
$out = RemoteCopy -downloadFrom $vmData.PublicIP -port $vmData.SSHPort -username $user -password $password -files "$($vmData.RoleName)-*.txt" -downloadTo "$LogDir" -download
|
||||
$finalKernelVersion = Get-Content "$LogDir\$($vmData.RoleName)-kernelVersion.txt"
|
||||
Set-Variable -Name finalKernelVersion -Value $finalKernelVersion -Scope Global
|
||||
#region LIS Version
|
||||
$tempLIS = (Select-String -Path "$LogDir\$($vmData.RoleName)-lis.txt" -Pattern "^version:").Line
|
||||
if ($tempLIS)
|
||||
{
|
||||
$finalLISVersion = $tempLIS.Split(":").Trim()[1]
|
||||
}
|
||||
else
|
||||
{
|
||||
$finalLISVersion = "NA"
|
||||
}
|
||||
Set-Variable -Name finalLISVersion -Value $finalLISVersion -Scope Global
|
||||
Write-Host "Setting : finalLISVersion : $finalLISVersion"
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
$finalLISVersion = "NA"
|
||||
}
|
||||
Set-Variable -Name finalLISVersion -Value $finalLISVersion -Scope Global
|
||||
Write-Host "Setting : finalLISVersion : $finalLISVersion"
|
||||
#endregion
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogErr "Ignorable error in collecting final data from VMs."
|
||||
}
|
||||
$currentTestBackgroundJobs = Get-Content $LogDir\CurrentTestBackgroundJobs.txt -ErrorAction SilentlyContinue
|
||||
if ( $currentTestBackgroundJobs )
|
||||
|
|
|
@ -182,12 +182,13 @@ InstallKernel()
|
|||
LogMsg "Installing ${customKernel##*/}"
|
||||
rpm -ivh "${customKernel##*/}" >> $logFolder/build-customKernel.txt 2>&1
|
||||
kernelInstallStatus=$?
|
||||
rpm -e kernel-$(uname -r)
|
||||
else
|
||||
prefix="localfile:"
|
||||
LogMsg "Installing ${customKernel#$prefix}"
|
||||
rpm -ivh "${customKernel#$prefix}" >> $logFolder/build-customKernel.txt 2>&1
|
||||
kernelInstallStatus=$?
|
||||
|
||||
rpm -e kernel-$(uname -r)
|
||||
fi
|
||||
UpdateTestState $ICA_TESTCOMPLETED
|
||||
if [ $kernelInstallStatus -ne 0 ]; then
|
||||
|
|
|
@ -44,10 +44,10 @@ touch ./IPERF3Test.log
|
|||
InstallIPERF3()
|
||||
{
|
||||
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux\|clear-linux-os" /etc/{issue,*release,*version} /usr/lib/os-release`
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
if [[ $DISTRO =~ "Ubuntu" ]] || [[ $DISTRO =~ "Debian" ]];;
|
||||
then
|
||||
|
||||
LogMsg "Detected Ubuntu"
|
||||
LogMsg "Detected Ubuntu/Debian"
|
||||
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 psmisc"
|
||||
|
|
|
@ -45,9 +45,9 @@ touch ./lagscopeTest.log
|
|||
InstallLAGSCOPE() {
|
||||
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux\|clear-linux-os" /etc/{issue,*release,*version} /usr/lib/os-release`
|
||||
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
if [[ $DISTRO =~ "Ubuntu" ]] || [[ $DISTRO =~ "Debian" ]];
|
||||
then
|
||||
LogMsg "Detected UBUNTU"
|
||||
LogMsg "Detected UBUNTU/Debian"
|
||||
LogMsg "Configuring ${1} for lagscope test..."
|
||||
ssh ${1} "until dpkg --force-all --configure -a; sleep 10; do echo 'Trying again...'; done"
|
||||
ssh ${1} "apt-get update"
|
||||
|
|
|
@ -45,14 +45,15 @@ touch ./ntttcpTest.log
|
|||
InstallNTTTCP() {
|
||||
DISTRO=`grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux\|clear-linux-os" /etc/{issue,*release,*version} /usr/lib/os-release`
|
||||
|
||||
if [[ $DISTRO =~ "Ubuntu" ]];
|
||||
if [[ $DISTRO =~ "Ubuntu" ]] || [[ $DISTRO =~ "Debian" ]];
|
||||
then
|
||||
LogMsg "Detected UBUNTU"
|
||||
LogMsg "Detected UBUNTU/Debian"
|
||||
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 dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
@ -71,6 +72,8 @@ InstallNTTTCP() {
|
|||
ssh ${1} "mv glibc-2.14.1 glibc-2.14 && cd glibc-2.14 && mkdir build && cd build && ../configure --prefix=/opt/glibc-2.14 && make && make install && export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH"
|
||||
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
@ -84,6 +87,7 @@ InstallNTTTCP() {
|
|||
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 dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
@ -98,6 +102,7 @@ InstallNTTTCP() {
|
|||
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/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
@ -111,6 +116,7 @@ InstallNTTTCP() {
|
|||
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 dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
@ -124,6 +130,7 @@ InstallNTTTCP() {
|
|||
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 dstat psmisc"
|
||||
ssh ${1} "git clone https://github.com/Microsoft/ntttcp-for-linux.git"
|
||||
ssh ${1} "cd ntttcp-for-linux/ && git checkout 7a5017b00a603cfaf2ae2a83a6d6b688b2f9dbaa"
|
||||
ssh ${1} "cd ntttcp-for-linux/src/ && make && make install"
|
||||
ssh ${1} "cp ntttcp-for-linux/src/ntttcp ."
|
||||
ssh ${1} "rm -rf lagscope"
|
||||
|
|
Загрузка…
Ссылка в новой задаче