Skip to content

Commit

Permalink
Run WAN Perf on WS2022 (microsoft#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Oct 7, 2021
1 parent 441e836 commit d1ae0e4
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .azure/azure-pipelines.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ stages:
jobs:
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_5Mbps
displayName: 5 Mbps
iterations: 3
Expand All @@ -491,6 +492,7 @@ stages:
logProfile: Datapath.Light
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_30Mbps
displayName: 30 Mbps
iterations: 3
Expand All @@ -501,6 +503,7 @@ stages:
logProfile: Datapath.Light
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_100Mbps
displayName: 100 Mbps
iterations: 3
Expand Down
5 changes: 5 additions & 0 deletions .azure/azure-pipelines.periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ stages:
jobs:
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_general_1
displayName: General Networks (5 Mbps)
iterations: 3
Expand All @@ -83,6 +84,7 @@ stages:
extraArgs: -Periodic
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_general_2
displayName: General Networks (10 Mbps)
iterations: 3
Expand All @@ -97,6 +99,7 @@ stages:
extraArgs: -Periodic
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_general_3
displayName: General Networks (50 Mbps)
iterations: 3
Expand All @@ -111,6 +114,7 @@ stages:
extraArgs: -Periodic
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_general_4
displayName: General Networks (100 Mbps)
iterations: 3
Expand All @@ -125,6 +129,7 @@ stages:
extraArgs: -Periodic
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_general_5
displayName: General Networks (200 Mbps)
iterations: 3
Expand Down
1 change: 1 addition & 0 deletions .azure/azure-pipelines.wanperf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ stages:
jobs:
- template: ./templates/run-wanperf.yml
parameters:
image: windows-2022
jobName: wanperf_custom
displayName: Custom
protocol: ${{ parameters.protocol }}
Expand Down
11 changes: 7 additions & 4 deletions .azure/templates/run-wanperf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
parameters:
jobName:
displayName:
pool: 'MsQuic-Win-Latest'
pool: ''
image: ''
platform: 'windows'
config: 'Release'
Expand All @@ -25,8 +25,8 @@ parameters:
timeout: 15

jobs:
- job: ${{ parameters.jobName }}
displayName: ${{ parameters.displayName }}
- job: ${{ parameters.jobName }}_${{ replace(parameters.pool, '-', '_') }}${{ replace(replace(parameters.image, '-', '_'), '.', '_') }}
displayName: ${{ parameters.displayName }} (${{ parameters.pool }}${{ parameters.image }})
timeoutInMinutes: 0
${{ if ne(parameters.pool, '') }}:
pool: ${{ parameters.pool }}
Expand Down Expand Up @@ -55,7 +55,10 @@ jobs:
inputs:
pwsh: true
filePath: scripts/prepare-machine.ps1
arguments: -Configuration Test
${{ if ne(parameters.image, '') }}:
arguments: -Configuration Test -DuoNic
${{ if eq(parameters.image, '') }}:
arguments: -Configuration Test

- task: PowerShell@2
displayName: Run WAN Performance Test
Expand Down
48 changes: 47 additions & 1 deletion scripts/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ param (
[switch]$TestCertificates,

[Parameter(Mandatory = $false)]
[switch]$SignCode
[switch]$SignCode,

[Parameter(Mandatory = $false)]
[switch]$DuoNic
)

#Requires -RunAsAdministrator
Expand Down Expand Up @@ -133,6 +136,46 @@ function Install-ClogTool {
}
}

$ArtifactsPath = Join-Path $RootDir "artifacts"
$CoreNetCiPath = Join-Path $ArtifactsPath "corenet-ci-main"
$SetupPath = Join-Path $CoreNetCiPath "vm-setup"

function Download-CoreNet-Deps {
# Download and extract https://github.com/microsoft/corenet-ci.
if (!(Test-Path $ArtifactsPath)) { mkdir $ArtifactsPath }
if (!(Test-Path $CoreNetCiPath)) {
$ZipPath = Join-Path $ArtifactsPath "corenet-ci.zip"
Invoke-WebRequest -Uri "https://github.com/microsoft/corenet-ci/archive/refs/heads/main.zip" -OutFile $ZipPath
Expand-Archive -Path $ZipPath -DestinationPath $ArtifactsPath -Force
Remove-Item -Path $ZipPath
}
}

# Installs DuoNic from the CoreNet-CI repo.
function Install-DuoNic {
# Check to see if test signing is enabled.
$HasTestSigning = $false
try { $HasTestSigning = ("$(bcdedit)" | Select-String -Pattern "testsigning\s+Yes").Matches.Success } catch { }
if (!$HasTestSigning) { Write-Error "Test Signing Not Enabled!" }

# Download the CI repo that contains DuoNic.
Write-Host "Downloading CoreNet-CI"
Download-CoreNet-Deps

# Install the test root certificate.
Write-Host "Installing test root certificate"
$RootCertPath = Join-Path $SetupPath "testroot-sha2.cer"
if (!(Test-Path $RootCertPath)) { Write-Error "Missing file: $RootCertPath" }
certutil.exe -addstore -f "Root" $RootCertPath

# Install the DuoNic driver.
Write-Host "Installing DuoNic driver"
$DuoNicPath = Join-Path $SetupPath duonic
$DuoNicScript = (Join-Path $DuoNicPath duonic.ps1)
if (!(Test-Path $DuoNicScript)) { Write-Error "Missing file: $DuoNicScript" }
Invoke-Expression "cmd /c `"pushd $DuoNicPath && pwsh duonic.ps1 -Install`""
}

if (($Configuration -eq "Dev")) {
Install-ClogTool "Microsoft.Logging.CLOG"
}
Expand Down Expand Up @@ -301,6 +344,9 @@ if ($IsWindows) {
# Delete the installer.
Remove-Item -Path $ExeFile
}
if ($DuoNic) {
Install-DuoNic
}
}

} elseif ($IsLinux) {
Expand Down

0 comments on commit d1ae0e4

Please sign in to comment.