Skip to content

test: add e2e validation for MANA accelerated networking#8832

Draft
titilambert wants to merge 8 commits into
mainfrom
add-e2e-tests-for-mana
Draft

test: add e2e validation for MANA accelerated networking#8832
titilambert wants to merge 8 commits into
mainfrom
add-e2e-tests-for-mana

Conversation

@titilambert

Copy link
Copy Markdown

What this PR does / why we need it:

Adds end-to-end tests validating that MANA (Microsoft Azure Network Adapter)
accelerated networking is properly configured on V6 VM series. The tests cover
Ubuntu 22.04, Ubuntu 24.04, and Azure Linux V3.

Validations added:

  • MANA PCI device (00ba) is exposed to the VM
  • MANA kernel driver (mana.ko) is loaded
  • Virtual Function (VF) interface is bonded to eth0
  • Network traffic actually flows through the VF path

Additionally, MANA validation is run conditionally in ValidateCommonLinux
on any VM where MANA hardware is detected (V5+ series).

Which issue(s) this PR fixes:

Fixes #

@titilambert

Copy link
Copy Markdown
Author

This change is part of the following stack:

Change managed by git-spice.

Copilot AI review requested due to automatic review settings July 3, 2026 19:26
@titilambert

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds end-to-end validation for MANA (Microsoft Azure Network Adapter) accelerated networking on newer VM series, expanding the e2e suite to assert both device/driver presence and datapath correctness on Ubuntu 22.04/24.04 and Azure Linux V3.

Changes:

  • Added VMSS helper to explicitly enable Accelerated Networking on the primary NIC for targeted MANA scenarios.
  • Introduced MANA validation helpers (PCI device, driver availability, VF bonding, VF traffic counters) and conditionally ran them from ValidateCommonLinux when MANA hardware is detected.
  • Added dedicated e2e scenarios for Ubuntu 22.04, Ubuntu 24.04, and Azure Linux V3 on a V6 SKU, plus a new Tags.MANA filter flag.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
e2e/vmss.go Adds a helper to enable Accelerated Networking on the VMSS primary NIC.
e2e/validators.go Implements MANA detection and validation steps (PCI/driver/VF bonding/traffic).
e2e/validation.go Conditionally runs MANA validation as part of common Linux validations when hardware is detected.
e2e/types.go Adds a MANA tag to scenario filtering.
e2e/scenario_test.go Adds three VM-series coverage scenarios validating MANA on V6 SKUs across OSes.

Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go Outdated
Comment thread e2e/vmss.go
Comment thread e2e/validators.go Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 19:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go
Comment on lines +2904 to +2907
func hasMANAHardware(ctx context.Context, s *Scenario) bool {
result := execScriptOnVMForScenario(ctx, s, "lspci 2>/dev/null | grep -q '00ba'")
return result.exitCode == "0"
}
Comment thread e2e/validators.go Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread e2e/validators.go
Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go
Comment on lines +2902 to +2908
// hasMANAHardware checks if the VM has MANA PCI hardware available.
// Returns true if the MANA device (00ba) is found in lspci output.
// This is used to conditionally run MANA validations on VMs that support it.
func hasMANAHardware(ctx context.Context, s *Scenario) bool {
result := execScriptOnVMForScenario(ctx, s, "lspci 2>/dev/null | grep -q '00ba'")
return result.exitCode == "0"
}
Copilot AI review requested due to automatic review settings July 3, 2026 19:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go Outdated
Comment on lines +2905 to +2906
result := execScriptOnVMForScenario(ctx, s, "lspci 2>/dev/null | grep -q '00ba'")
return result.exitCode == "0"
Comment thread e2e/validators.go Outdated
Comment on lines +2833 to +2835
cmd := `grep -q '/mana' /lib/modules/$(uname -r)/modules.builtin 2>/dev/null || find /lib/modules/$(uname -r)/kernel -name 'mana*.ko*' 2>/dev/null | grep -q .`
execScriptOnVMForScenarioValidateExitCode(ctx, s, cmd, 0,
"MANA kernel driver (mana.ko) not found as built-in or loadable module")
Comment thread e2e/scenario_test.go
Comment thread e2e/scenario_test.go
Comment thread e2e/scenario_test.go
Copilot AI review requested due to automatic review settings July 3, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread e2e/validators.go
Comment on lines +2872 to +2875
// Send a known number of ICMP packets from a pod on this node
pingCmd := fmt.Sprintf("ping -c %d -W 2 168.63.129.16", pingCount)
pingResult := execOnVMForScenarioOnUnprivilegedPod(ctx, s, pingCmd)
require.Equalf(s.T, "0", pingResult.exitCode, "failed to execute ping from debug pod (exit %s):\n%s", pingResult.exitCode, pingResult.String())
Comment thread e2e/validators.go Outdated
defer toolkit.LogStep(s.T, "validating traffic is flowing through MANA VF")()

const pingCount = 10
getVFRxPackets := "sudo ethtool -S eth0 | awk -F': *' '/^[[:space:]]*vf_rx_packets:/{print $2; exit}'"
Comment thread e2e/validators.go Outdated
Comment thread e2e/validators.go Outdated
Comment on lines +2905 to +2906
result := execScriptOnVMForScenario(ctx, s, "lspci 2>/dev/null | grep -q '00ba'")
return result.exitCode == "0"
Copilot AI review requested due to automatic review settings July 3, 2026 20:02
titilambert and others added 7 commits July 3, 2026 16:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@titilambert titilambert force-pushed the add-e2e-tests-for-mana branch from 81bb13d to 294a4f3 Compare July 3, 2026 20:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread e2e/validators.go
Comment on lines +2901 to +2907
// hasMANAHardware checks if the VM has MANA PCI hardware available.
// Returns true if the MANA device (00ba) is found in lspci output.
// This is used to conditionally run MANA validations on VMs that support it.
func hasMANAHardware(ctx context.Context, s *Scenario) bool {
result := execScriptOnVMForScenario(ctx, s, "lspci 2>/dev/null | grep -q '00ba'")
return result.exitCode == "0"
}
Comment thread e2e/validators.go Outdated
defer toolkit.LogStep(s.T, "validating traffic is flowing through MANA VF")()

const pingCount = 10
getVFRxPackets := "sudo ethtool -S eth0 | awk -F': *' '/^[[:space:]]*vf_rx_packets:/{print $2; exit}'"
Comment thread e2e/validators.go Outdated
Comment on lines +2820 to +2822
cmd := `command -v lspci >/dev/null 2>&1 || { echo "lspci not found (install pciutils)"; exit 127; }
lspci | grep -i 'Microsoft Corporation'`
result := execScriptOnVMForScenarioValidateExitCode(ctx, s, cmd, 0,
Copilot AI review requested due to automatic review settings July 3, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread e2e/scenario_test.go
Comment on lines +3333 to +3335
Validator: func(ctx context.Context, s *Scenario) {
ValidateMANA(ctx, s)
},
Comment thread e2e/scenario_test.go
Comment thread e2e/scenario_test.go
Comment thread e2e/validators.go
Comment on lines +2873 to +2888
// Send a known number of ICMP packets from a pod on this node
pingCmd := fmt.Sprintf("ping -c %d -W 2 168.63.129.16", pingCount)
pingResult := execOnVMForScenarioOnUnprivilegedPod(ctx, s, pingCmd)
require.Equalf(s.T, "0", pingResult.exitCode, "failed to execute ping from debug pod (exit %s):\n%s", pingResult.exitCode, pingResult.String())

// Read VF rx counter after generating traffic
resultAfter := execScriptOnVMForScenarioValidateExitCode(ctx, s, getVFRxPackets, 0,
"could not read VF rx packet counter from ethtool -S eth0")
countAfter, err := strconv.Atoi(strings.TrimSpace(resultAfter.stdout))
require.NoError(s.T, err, "failed to parse vf_rx_packets after value %q", resultAfter.stdout)

delta := countAfter - countBefore
s.T.Logf("MANA VF rx packets after: %d (delta: %d, expected >= %d)", countAfter, delta, pingCount)

require.GreaterOrEqual(s.T, delta, pingCount,
"vf_rx_packets increased by %d but expected at least %d \u2014 traffic may not be flowing through the MANA VF", delta, pingCount)
Signed-off-by: Thibault Cohen <thicohen@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants