diff --git a/.github/workflows/auto-reset-parent-or-child-lab-machine.yml b/.github/workflows/auto-reset-parent-or-child-lab-machine.yml index 0f5b070f..e5c38b15 100644 --- a/.github/workflows/auto-reset-parent-or-child-lab-machine.yml +++ b/.github/workflows/auto-reset-parent-or-child-lab-machine.yml @@ -87,8 +87,8 @@ jobs: { parent-or-child: "child=rr1-netperf-25\\localadminuser", vm-name: "netperf-windows-2022-server" }, { parent-or-child: "child=rr1-netperf-05\\localadminuser", vm-name: "netperf" }, { parent-or-child: "parent=rr1-netperf-10\\localadminuser", vm-name: "netperf" }, - { parent-or-child: "child=rr1-netperf-11\\localadminuser", vm-name: "netperf-linux-server" }, - { parent-or-child: "parent=rr1-netperf-12\\localadminuser", vm-name: "netperf-linux-client" }, + { parent-or-child: "child=rr1-netperf-11\\localadminuser", vm-name: "netperf-ubuntu24-server" }, + { parent-or-child: "parent=rr1-netperf-12\\localadminuser", vm-name: "netperf-ubuntu24-client" }, { parent-or-child: "child=rr1-netperf-01\\localadminuser", vm-name: "netperf-windows-2022-server" }, { parent-or-child: "parent=rr1-netperf-02\\localadminuser", vm-name: "netperf-windows-2022-client" }, { parent-or-child: "child=rr1-netperf-03\\localadminuser", vm-name: "netperf-windows-2022-server" }, @@ -111,7 +111,7 @@ jobs: - name: Start VM, wait for online status, alert observer. run: | $vmName = "${{ matrix.vec.vm-name }}" - if ($vmName.Contains("linux")) { + if ($vmName.Contains("linux") -or $vmName.Contains("ubuntu")) { Restart-VM -Name $vmName -Force } else { Start-VM -Name $vmName @@ -139,7 +139,7 @@ jobs: - name: Start VM, wait for online status, alert observer. run: | $vmName = "${{ inputs.vm-name }}" - if ($vmName.Contains("linux")) { + if ($vmName.Contains("linux") -or $vmName.Contains("ubuntu")) { Restart-VM -Name $vmName -Force } else { Start-VM -Name $vmName diff --git a/.github/workflows/quic_matrix.json b/.github/workflows/quic_matrix.json index 7aafd31c..291a3f3a 100644 --- a/.github/workflows/quic_matrix.json +++ b/.github/workflows/quic_matrix.json @@ -9,5 +9,6 @@ { "env": "azure", "os": "windows-2025", "arch": "x64", "tls": "schannel", "io": "wsk", "preferred_pool_sku": "Experimental_Boost4" }, { "env": "lab", "os": "windows-2022", "arch": "x64", "tls": "schannel", "io": "iocp" }, { "env": "lab", "os": "windows-2022", "arch": "x64", "tls": "schannel", "io": "xdp" }, - { "env": "lab", "os": "windows-2022", "arch": "x64", "tls": "schannel", "io": "wsk" } + { "env": "lab", "os": "windows-2022", "arch": "x64", "tls": "schannel", "io": "wsk" }, + { "env": "lab", "os": "ubuntu-24.04", "arch": "x64", "tls": "quictls", "io": "epoll" } ] diff --git a/docs/machines.md b/docs/machines.md index 289c8314..b33e578e 100644 --- a/docs/machines.md +++ b/docs/machines.md @@ -175,6 +175,9 @@ curl https://raw.githubusercontent.com/microsoft/netperf/main/setup-runner-linux CLIENTIP='192.168.0.XXX/24' sudo apt install net-tools -y +# if eth1 does not exist +sudo ip link set eth1 up + ifconfig # From the output of ifconfig, look for the netadapter (eth0 or eth1 ...) WITHOUT an inet ipv4 address. Usually, this will be eth1. sudo ip addr add $CLIENTIP dev eth1 # make sure eth1 is indeed the netadapter without an inet ipv4 address. # Also create a startup script that runs "sudo ip addr add $CLIENTIP dev eth_" so when the VM restarts, the ip persists. diff --git a/netperf-lib.psm1 b/netperf-lib.psm1 index 3258b13a..c7001c68 100644 --- a/netperf-lib.psm1 +++ b/netperf-lib.psm1 @@ -19,11 +19,24 @@ function NetperfSendCommand { ) if ($Session -and $Session -ne "NOT_SUPPORTED") { - Write-Host "Sending command (via remote powershell): $Command" $CallBackName = $env:CallBackName $RemoteDir = $env:RemoteDir - Invoke-Command -Session $Session -ScriptBlock { - & "$Using:RemoteDir/scripts/$Using:CallBackName" -Command $Using:Command -WorkingDir $Using:RemoteDir + if ($isWindows) { + Write-Host "Sending command (via remote powershell): $RemoteDir/scripts/$CallBackName -Command $Command -WorkingDir $RemoteDir" + Invoke-Command -Session $Session -ScriptBlock { + & pwsh -NoProfile -NonInteractive -WorkingDirectory $Using:RemoteDir -File ` + "$Using:RemoteDir/scripts/$Using:CallBackName" ` + -Command $Using:Command ` + -WorkingDir $Using:RemoteDir + } + } else { + Write-Host "Sending command (via remote powershell): sudo -n pwsh -NoProfile -NonInteractive -File $RemoteDir/scripts/$CallBackName -Command $Command -WorkingDir $RemoteDir" + Invoke-Command -Session $Session -ScriptBlock { + & sudo -n pwsh -NoProfile -NonInteractive -WorkingDirectory $Using:RemoteDir -File ` + "$Using:RemoteDir/scripts/$Using:CallBackName" ` + -Command $Using:Command ` + -WorkingDir $Using:RemoteDir + } } return } @@ -112,12 +125,12 @@ function NetperfWaitServerFinishExecution { function InitNetperfLib { param ( - $CallbackName, + $CallBackName, $RemoteDir, $RemoteName, $UserNameOnLinux ) - $env:CallbackName = $CallbackName + $env:CallBackName = $CallBackName $env:RemoteDir = $RemoteDir $env:RemoteName = $RemoteName $env:UserNameOnLinux = $UserNameOnLinux @@ -126,6 +139,7 @@ function InitNetperfLib { # Set up the connection to the peer over remote powershell. Write-Host "Connecting to $RemoteName" + Write-Host "Using Callback Script: $RemoteDir/scripts/$CallBackName" $Attempts = 0 while ($Attempts -lt 5) { try { @@ -160,16 +174,37 @@ function InitNetperfLib { function Copy-RepoToPeer { param($Session) $RemoteDir = $env:RemoteDir + $UserNameOnLinux = $env:UserNameOnLinux if (!($Session -eq "NOT_SUPPORTED")) { # Copy the artifacts to the peer. Write-Host "Copying files to peer" - Invoke-Command -Session $Session -ScriptBlock { - if (Test-Path $Using:RemoteDir) { - Remove-Item -Force -Recurse $Using:RemoteDir | Out-Null + if ($isWindows) { + Invoke-Command -Session $Session -ScriptBlock { + if (Test-Path $Using:RemoteDir) { + Remove-Item -Force -Recurse $Using:RemoteDir | Out-Null + } + New-Item -ItemType Directory -Path $Using:RemoteDir -Force | Out-Null + } + } else { + Invoke-Command -Session $Session -ScriptBlock { + # Create tmp script + $Script = @" + if (Test-Path $Using:RemoteDir) { + Remove-Item -Force -Recurse $Using:RemoteDir | Out-Null + } + New-Item -ItemType Directory -Path $Using:RemoteDir -Force | Out-Null + chown $Using:UserNameOnLinux:$Using:UserNameOnLinux $Using:RemoteDir + chmod 755 $Using:RemoteDir +"@ + # Create file + New-Item -ItemType File -Path "$Using:RemoteDir/../tmp_script.ps1" -Force | Out-Null + Set-Content -Path "$Using:RemoteDir/../tmp_script.ps1" -Value $Script -Force + & sudo -n pwsh -NoProfile -NonInteractive -File ` + "$Using:RemoteDir/../tmp_script.ps1" } - New-Item -ItemType Directory -Path $Using:RemoteDir -Force | Out-Null } - Copy-Item -ToSession $Session -Path ./* -Destination "$RemoteDir" -Recurse + + Copy-Item -ToSession $Session -Path ./*, ./.* -Destination "$RemoteDir" -Recurse -Force } else { Write-Host "Not using remote powershell, assuming peer has checked out the repo." }