Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions iperf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!.gitignore
!config.json
!install.ps1
!README.md
24 changes: 24 additions & 0 deletions iperf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# iperf3 for AutoHCK

Windows iperf3 v3.17.1 (amd64) for NetKVM functest throughput and RSS cases.

## Layout

```
iperf/
config.json
install.ps1
iperf3-win.zip # not in git — AutoHCK downloads on first use
```

Guest install: `C:\iperf\iperf3.exe` on machine PATH.

Host setup: Linux `iperf3` is configured in AutoHCK test case pre_test_commands.

## Usage

```json
"extra_software": ["iperf"]
```

Source: https://github.com/ar51an/iperf3-win-builds/releases/tag/3.17.1
11 changes: 11 additions & 0 deletions iperf/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"download_url": "https://github.com/ar51an/iperf3-win-builds/releases/download/3.17.1/iperf-3.17.1-win64.zip",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work for x86?

"file_name": "iperf3-win.zip",
"install_cmd": "powershell",
"install_args": "-ExecutionPolicy Bypass -File @sw_path@\\install.ps1",
"install_dest": "client",
"install_time": {
"kit": "after",
"driver": "before"
}
}
40 changes: 40 additions & 0 deletions iperf/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$ErrorActionPreference = 'Stop'
$SrcDir = $PSScriptRoot
$InstallDir = 'C:\iperf'
$ZipFile = Join-Path $SrcDir 'iperf3-win.zip'

if (-not (Test-Path $ZipFile)) {
Write-Output "FAIL: iperf3-win.zip not found at $ZipFile"
exit 1
}

$TempDir = Join-Path $env:TEMP ("iperf3_extract_" + [guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $TempDir -Force | Out-Null
try {
Expand-Archive -LiteralPath $ZipFile -DestinationPath $TempDir -Force
$exe = Get-ChildItem -Path $TempDir -Recurse -Filter 'iperf3.exe' | Select-Object -First 1
if (-not $exe) {
Write-Output 'FAIL: iperf3.exe not found inside zip'
exit 1
}
New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
Copy-Item -LiteralPath $exe.FullName -Destination (Join-Path $InstallDir 'iperf3.exe') -Force
$dll = Get-ChildItem -Path $TempDir -Recurse -Filter 'cygwin1.dll' | Select-Object -First 1
if ($dll) {
Copy-Item -LiteralPath $dll.FullName -Destination (Join-Path $InstallDir 'cygwin1.dll') -Force
}
} finally {
Remove-Item -LiteralPath $TempDir -Recurse -Force -ErrorAction SilentlyContinue
}

$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
$parts = @()
if (-not [string]::IsNullOrEmpty($machinePath)) {
$parts = @($machinePath -split ';' | Where-Object { $_ -ne '' })
}
if ($parts -notcontains $InstallDir) {
[Environment]::SetEnvironmentVariable('Path', ($InstallDir + ';' + $machinePath), 'Machine')
}

Write-Output "PASS: iperf3 installed ($InstallDir)"
exit 0