Skip to content

Switch to single connection #76

Switch to single connection

Switch to single connection #76

Workflow file for this run

# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
# This workflow will download the cts traffic generator and run it against a target.
name: cts_traffic
on:
# Permit manual runs of the workflow.
workflow_dispatch:
inputs:
profile:
description: 'Capture CPU profile'
required: false
default: false
type: boolean
duration:
description: 'Duration of the test in milliseconds'
required: false
default: 60000
type: number
concurrent_connections:
description: 'Number of concurrent connections'
required: false
default: 1
type: number
pull_request:
branches:
- main
paths:
- .github/workflows/cts_traffic.yml
concurrency:
group: ctstraffic-${{ github.event.client_payload.pr || github.event.client_payload.sha || inputs.ref || github.event.pull_request.number || 'main' }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build cts-traffic test tool
uses: microsoft/ctsTraffic/.github/workflows/reusable-build.yml@master
with:
build_artifact: cts-traffic
repository: 'microsoft/ctsTraffic'
configurations: '["Release"]'
ref: 'master'
test:
name: Test CTS Traffic
needs: [build]
strategy:
fail-fast: false
matrix:
vec: [
# { env: "azure", os: "2022", arch: "x64" },
# { env: "azure", os: "2025", arch: "x64" },
{ env: "lab", os: "2022", arch: "x64" },
]
runs-on:
- self-hosted
- ${{ matrix.vec.env }}
- os-windows-${{ matrix.vec.os }}
- ${{ matrix.vec.arch }}
steps:
- name: Setup workspace
run: |
wpr.exe -cancel 2>$null; $global:LASTEXITCODE = 0
Get-ChildItem | % { Remove-Item -Recurse $_ }
Get-ChildItem $env:TEMP | % { Remove-Item -Recurse $_ }
New-item -ItemType Directory -Path ${{ github.workspace }}\cts-traffic
New-item -ItemType Directory -Path ${{ github.workspace }}\ETL
# Install the latest anti-malware signatures for Windows Defender to prevent false positives.
# Windows Defender incorrectly flags some of the test binaries as malware.
- name: Download latest anti-malware signatures for Windows Defender
run: |
Update-MpSignature -Verbose
Start-MpScan -ScanType QuickScan
Add-MpPreference -ExclusionPath ${{ github.workspace }}
- name: Download cts-traffic
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d
with:
name: "cts-traffic Release"
path: ${{ github.workspace }}\cts-traffic
- name: Run CTS cts-traffic
working-directory: ${{ github.workspace }}\cts-traffic
run: |
$profile = 0
if ("${{inputs.profile}}" -eq "true") { $profile = 1 }
$duration = 60000
if ("${{inputs.duration}}" -ne "") { $duration = ${{inputs.duration}} }
$concurrentConnections = 1
if ("${{inputs.concurrent_connections}}" -ne "") { $concurrentConnections = ${{inputs.concurrent_connections}} }
$url = "https://raw.githubusercontent.com/microsoft/bpf_performance/main/scripts/two-machine-perf.ps1"
iex "& { $(irm $url) } -CpuProfile $profile -Duration $duration -ConcurrentConnections $concurrentConnections -Verbose"
- name: Move ETL files to ETLfolder
working-directory: ${{ github.workspace }}\cts-traffic
run: |
dir .
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl ${{ github.workspace }}\ETL }
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl ${{ github.workspace }}\ETL }
- name: Upload CTS cts-traffic results
if: always()
uses: actions/upload-artifact@v2
with:
name: cts_traffic_${{ matrix.vec.env }}_${{ matrix.vec.os }}_${{ matrix.vec.arch }}
path: ${{ github.workspace }}\cts-traffic\ctsTrafficResults.csv
- name: Cleanup workspace
if: always()
run: |
if (Test-Path ${{ github.workspace }}\cts-traffic) { Remove-Item -Recurse -Force ${{ github.workspace }}\cts-traffic }
if (Test-Path ${{ github.workspace }}\ETL) { Remove-Item -Recurse -Force ${{ github.workspace }}\ETL }
- name: Restore Windows Defender exclusions
if: always()
run: |
Remove-MpPreference -ExclusionPath ${{ github.workspace }}
Update-MpSignature -Verbose
Start-MpScan -ScanType QuickScan