sai_test: add opt-in SIMULATE_SONIC to emulate SONiC teamd/IntfMgr netdevs for standalone benches#2316
Open
nicholasching wants to merge 1 commit into
Open
Conversation
…s in sai_test Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
5 tasks
Author
|
@kcudnik, could you please invoke azure pipelines to run checks, please. I do not have the permissions to do so. |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context / motivation
Part of the SAIVPP unit-test framework (see the sonic-sairedis
docker-sai-test-vppharness). When the OCPsai_testT0 suite runs against a SAI backend on a standalone bench with no SONiC control plane, there is noteamdto createPortChannelnetdevs and noIntfMgrto assign LAG/SVI interface IPs — which some backends (e.g. the VPP virtual switch) rely on for LAG bring-up and routed-to-LAG/SVI forwarding. This adds an opt-in way for the test setup to emulate that.What this change does
test/sai_test/config/simulate_sonic.py(new). Opt-in helper, active only whenSIMULATE_SONIC=1; every entry point is a no-op otherwise.test/sai_test/config/lag_configer.py—create_lag(). When enabled, create thePortChannel<N>netdevteamdwould provide, before the SAI LAG create.test/sai_test/config/route_configer.py—create_router_interface(). When enabled, assign the connected IPsIntfMgrwould set on a LAG or VLAN(SVI) router interface.ip … type bond; LAG RIF IPs useip addr add. A VLAN SVI has no host-interface netdev to mirror from, so its address is programmed via command templates supplied by the caller (SVI_RIF_SET_IP_CMD/SVI_RIF_PROBE_CMD, with{ifname}/{addr}placeholders) — no backend-specific tooling is hardcoded insai_test. All interface-name prefixes and address patterns are env-overridable.Scope / risk
setUp-path hooks) — test-config helpers only; no change to SAI/backend code or packet semantics.SIMULATE_SONICunset, all entry points no-op, so real-HW and other OCP consumers are unchanged unless they opt in.Dependencies
None. Independent of #2299 / #2300 / #2301 (edits different functions); targets
master.