Skip to content

cnf network: add acc200 tests#932

Open
ajaggapa wants to merge 1 commit intorh-ecosystem-edge:mainfrom
ajaggapa:acc200testsv4
Open

cnf network: add acc200 tests#932
ajaggapa wants to merge 1 commit intorh-ecosystem-edge:mainfrom
ajaggapa:acc200testsv4

Conversation

@ajaggapa
Copy link
Copy Markdown
Collaborator

@ajaggapa ajaggapa commented Nov 10, 2025

Summary by CodeRabbit

  • New Features

    • Added ACC200 accelerator support in the test suite and updated test parameters for this device.
    • Extended support for VRB (Virtual SR-IOV Booster) accelerators including cluster/config handling.
  • Tests

    • Implemented ACC200 test context mirroring existing accelerator validation flows.
    • Added VRB node readiness checks, cluster/config lifecycle steps, BBDev test execution, and result validation.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 10, 2025

📝 Walkthrough

Walkthrough

Adds ACC200 device constants and extends the accelerator test suite with VRB (sriov-vrb) support: new VRB helpers, VRB-specific cluster/node config flows, ACC200 test context, and a rename to separate FEC and VRB node-config readiness waiters.

Changes

Cohort / File(s) Summary
ACC200 Device Constants
tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go
Added exported constants: Acc200DeviceID ("57c0"), Acc200ResourceName ("intel.com/intel_fec_acc200"), Acc200EnvVar ("PCIDEVICE_INTEL_COM_INTEL_FEC_ACC200"), and ExpectedNumberBbdevTestsPassedForAcc200 (14).
VRB Support & Accelerator Test Enhancements
tests/cnf/core/network/accelerator/tests/accelerator.go
Added VRB imports, introduced VRB helpers (getVrbNodeConfigWithAccCard, defineVrbClusterConfig, waitForVrbNodeConfigToSucceed), renamed waitForNodeConfigToSucceedwaitForFecNodeConfigToSucceed, and added ACC200/VRB test context and lifecycle (cluster/config creation, node validation, bbdev test pod lifecycle, and cleanup).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review VRB helper implementations and their interplay with existing test flows.
  • Verify the rename preserves FEC behavior and there are no remaining references to the old function name.
  • Confirm ACC200 test context mirrors ACC100 correctly (resource names, environment vars, expected test counts).
  • Check imports for correctness and no unused packages.

Possibly related PRs

  • cnf network: migrate acc100 tests #876 — Introduced ACC100 constants/tests and related helpers; this PR extends the same test suite with ACC200/VRB and renames/refactors the node-config waiters.

Suggested reviewers

  • gkopels
  • evgenLevin

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'cnf network: add acc200 tests' directly and clearly describes the main change: addition of ACC200 tests to the CNF network test suite.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27021bcb260b5a608b339ea6f7efba00806978fc and 9bf4891.

⛔ Files ignored due to path filters (11)
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/groupversion_info.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/helper.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbclusterconfig_types.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbnodeconfig_types.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/zz_generated.deepcopy.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfig.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfiglist.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/const.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfig.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfiglist.go is excluded by !vendor/**
  • vendor/modules.txt is excluded by !vendor/**
📒 Files selected for processing (2)
  • tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go (1 hunks)
  • tests/cnf/core/network/accelerator/tests/accelerator.go (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go
🧰 Additional context used
🧬 Code graph analysis (1)
tests/cnf/core/network/accelerator/tests/accelerator.go (6)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfig.go (1)
  • NodeConfigBuilder (19-29)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbnodeconfig_types.go (1)
  • SriovAccelerator (16-23)
tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go (7)
  • Acc200DeviceID (24-24)
  • OperatorNamespace (48-48)
  • Acc200ResourceName (26-26)
  • TestNamespaceName (16-16)
  • Acc200EnvVar (28-28)
  • TotalNumberBbdevTests (30-30)
  • ExpectedNumberBbdevTestsPassedForAcc200 (34-34)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfiglist.go (1)
  • ListNodeConfig (14-78)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfig.go (2)
  • ClusterConfigBuilder (19-29)
  • NewClusterConfigBuilder (35-82)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbclusterconfig_types.go (7)
  • SriovVrbClusterConfigSpec (167-193)
  • AcceleratorSelector (195-204)
  • PhysicalFunctionConfig (127-138)
  • BBDevConfig (105-108)
  • VRB1BBDevConfig (75-79)
  • ACC100BBDevConfig (45-62)
  • QueueGroupConfig (32-42)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/cnf/core/network/accelerator/tests/accelerator.go (1)

174-274: Consider refactoring duplicate test logic.

The ACC200 test context (lines 174-274) closely mirrors the ACC100 context (lines 73-172), with only type and constant differences. Consider extracting shared test logic into a parameterized helper function to reduce duplication and improve maintainability.

Example approach:

func testAccelerator(
    deviceID string,
    resourceName string,
    envVar string,
    expectedPassed int,
    getNodeConfig func(string) (interface{}, interface{}, error),
    defineClusterConfig func(string, string, bool) interface{},
    waitForConfig func() error,
) {
    // Shared test logic
}

This refactoring can be deferred if immediate delivery is prioritized.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d855d80 and 27021bcb260b5a608b339ea6f7efba00806978fc.

⛔ Files ignored due to path filters (11)
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/groupversion_info.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/helper.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbclusterconfig_types.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbnodeconfig_types.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/zz_generated.deepcopy.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfig.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfiglist.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/const.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfig.go is excluded by !vendor/**
  • vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfiglist.go is excluded by !vendor/**
  • vendor/modules.txt is excluded by !vendor/**
📒 Files selected for processing (2)
  • tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go (1 hunks)
  • tests/cnf/core/network/accelerator/tests/accelerator.go (8 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/cnf/core/network/accelerator/tests/accelerator.go (7)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfig.go (1)
  • NodeConfigBuilder (19-29)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbnodeconfig_types.go (1)
  • SriovAccelerator (16-23)
tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go (7)
  • Acc200DeviceID (24-24)
  • OperatorNamespace (48-48)
  • Acc200ResourceName (26-26)
  • TestNamespaceName (16-16)
  • Acc200EnvVar (28-28)
  • TotalNumberBbdevTests (30-30)
  • ExpectedNumberBbdevTestsPassedForAcc200 (34-34)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfiglist.go (1)
  • ListClusterConfig (14-78)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/nodeconfiglist.go (1)
  • ListNodeConfig (14-78)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/sriov-vrb/clusterconfig.go (2)
  • ClusterConfigBuilder (19-29)
  • NewClusterConfigBuilder (35-82)
vendor/github.com/rh-ecosystem-edge/eco-goinfra/pkg/schemes/fec/vrbtypes/sriovvrbclusterconfig_types.go (7)
  • SriovVrbClusterConfigSpec (167-193)
  • AcceleratorSelector (195-204)
  • PhysicalFunctionConfig (127-138)
  • BBDevConfig (105-108)
  • VRB1BBDevConfig (75-79)
  • ACC100BBDevConfig (45-62)
  • QueueGroupConfig (32-42)
🔇 Additional comments (6)
tests/cnf/core/network/accelerator/internal/tsparams/types-vars-consts.go (1)

23-34: LGTM! ACC200 constants follow established patterns.

The new ACC200 constants mirror the existing ACC100 structure and naming conventions. The lower expected test pass count (14 vs 27 for ACC100) suggests different hardware capabilities, which aligns with the VRB1/ACC200 configuration in the test file.

tests/cnf/core/network/accelerator/tests/accelerator.go (5)

13-13: LGTM! VRB imports added correctly.

The new VRB-related imports support the ACC200 test implementation and follow the same pattern as existing FEC imports.

Also applies to: 27-27


101-101: LGTM! Function rename improves clarity.

Renaming to waitForFecNodeConfigToSucceed makes it clear this waits for FEC-specific configs, distinguishing it from the new VRB equivalent.


350-363: LGTM! VRB helper function implemented correctly.

The getVrbNodeConfigWithAccCard function correctly mirrors the FEC equivalent and uses appropriate VRB-specific types and API calls.


409-427: LGTM! Wait functions implemented consistently.

Both waitForFecNodeConfigToSucceed and waitForVrbNodeConfigToSucceed follow the same polling pattern and correctly use their respective API calls. The explicit naming clarifies which config type each function waits for.

Also applies to: 429-447


589-608: Verify 4G queue group configuration.

The VRB cluster config sets NumQueueGroups: 0 for both Uplink4G and Downlink4G (lines 592, 597), while 5G queues use NumQueueGroups: 4 (lines 602, 607). This suggests 4G functionality is intentionally disabled.

Please confirm:

  • Is this the correct configuration for ACC200/VRB1 hardware?
  • Does the ACC200 device support 4G workloads, or is it 5G-only?
  • Should the test expectations account for this configuration difference?

If this configuration is correct and documented, consider adding a brief comment explaining why 4G queues are set to 0 to help future maintainers understand the intent.

Comment thread tests/cnf/core/network/accelerator/tests/accelerator.go
Comment on lines +218 to +221
It("node should show acc200 resource", func() {
Eventually(getNodeResource, 10*time.Minute, time.Second).
WithArguments(svnc.Object.Name, tsparams.Acc200ResourceName).To(BeNumerically(">", 0))
})
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.

⚠️ Potential issue | 🟡 Minor

Add reportxml.ID annotations for consistency.

The ACC200 test cases are missing reportxml.ID() annotations, while the corresponding ACC100 tests have them (see lines 117 and 122). This inconsistency affects test reporting and traceability.

Apply this diff to add the IDs:

-	It("node should show acc200 resource", func() {
+	It("node should show acc200 resource", reportxml.ID("XXXXX"), func() {
 		Eventually(getNodeResource, 10*time.Minute, time.Second).
 			WithArguments(svnc.Object.Name, tsparams.Acc200ResourceName).To(BeNumerically(">", 0))
 	})
 
-	It("validation of acc200 resource", func() {
+	It("validation of acc200 resource", reportxml.ID("XXXXX"), func() {
 		Eventually(getNodeResource, 10*time.Minute, time.Second).

Note: Replace "XXXXX" with appropriate test IDs from your test management system.

Also applies to: 223-273

🤖 Prompt for AI Agents
In tests/cnf/core/network/accelerator/tests/accelerator.go around lines 218-221
and also lines 223-273, several It() test cases for ACC200 are missing
reportxml.ID() annotations; add a reportxml.ID("XXXXX") call as the first
argument inside each It() (matching the pattern used in ACC100 tests), replacing
"XXXXX" with the correct test IDs from your test management system so each test
reads It(reportxml.ID("XXXXX"), "description", func() { ... }) to restore
consistent reporting and traceability.

@klaskosk
Copy link
Copy Markdown
Collaborator

Hello, reminder to please rebase this PR now that the release-4.20 branch has been cut. You may need to make some changes to migrate to klog v2, see this slack thread

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