Skip to content

[dash] Add Privatelink traffic test#14757

Merged
kperumalbfn merged 15 commits into
sonic-net:masterfrom
theasianpianist:dash-pl
Feb 21, 2025
Merged

[dash] Add Privatelink traffic test#14757
kperumalbfn merged 15 commits into
sonic-net:masterfrom
theasianpianist:dash-pl

Conversation

@theasianpianist
Copy link
Copy Markdown
Contributor

@theasianpianist theasianpianist commented Sep 26, 2024

Description of PR

Summary:
Fixes #14613

Adds outbound and inbound traffic tests for Privatelink

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

PR testes are failing, dependent on sonic-net/sonic-buildimage#21553

Approach

What is the motivation for this PR?

Add test cases to cover Privatelink traffic scenarios

How did you do it?

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Smartswitch testbed only

Documentation

prabhataravind and others added 3 commits September 26, 2024 06:33
Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Sep 26, 2024

@mukeshmv to review

Comment thread tests/dash/test_dash_privatelink.py Outdated

@pytest.fixture(scope="module")
def dpu_ip(duthost, dpu_index):
cmd = f"ip addr show | grep Ethernet-BP{dpu_index} | grep inet | awk '{{print $2}}'"
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.

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.

Here is an example of Nvidia platform:
sonic-net/sonic-buildimage#20358

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Copy link
Copy Markdown
Contributor

@JibinBao JibinBao left a comment

Choose a reason for hiding this comment

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

Can we have a test plan to explain the test? espeicallly for the privatelink_config,
What do the variables defined in the file of privatelink_config.py mean? If there is a chart to introduce the different ips in the test, it will be better.
Thanks

Comment thread tests/dash/packets.py Outdated
Comment thread tests/dash/test_dash_privatelink.py Outdated
Comment thread tests/dash/test_dash_vnet.py Outdated
Comment thread tests/dash/configs/privatelink_config.py Outdated
Comment thread tests/dash/configs/privatelink_config.py Outdated
Comment thread tests/dash/packets.py Outdated
Comment thread tests/dash/packets.py Outdated
@oleksandrivantsiv
Copy link
Copy Markdown
Contributor

@theasianpianist the test misses the data plane interface configuration for both the NPU and DPU sides. There is a static route that the test adds on the NPU side to send traffic to the DPU, but no IP address configuration on the interfaces. Therefore, the test won’t work without some manual pre-configuration. My assumption is that the test should be atomic and apply the full configuration needed to pass. The test should be extended to set the IP address on the NPU, and the IP address and VIP address on the DPU.

Copy link
Copy Markdown
Contributor

@oleksandrivantsiv oleksandrivantsiv left a comment

Choose a reason for hiding this comment

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

As commented

Comment thread tests/dash/configs/privatelink_config.py Outdated
Comment thread tests/dash/packets.py Outdated
Comment thread tests/dash/gnmi_utils.py Outdated
Comment thread tests/dash/gnmi_utils.py Outdated
Comment thread tests/dash/test_dash_privatelink.py Outdated
logger.info(messages)
apply_messages(localhost, duthost, ptfhost, messages, dpu_index)

return
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.

There is no clean up of the dash configurations.

@StormLiangMS
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@StormLiangMS
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread tests/dash/packets.py Outdated
Comment thread tests/dash/configs/privatelink_config.py Outdated
Comment thread tests/dash/gnmi_utils.py
Comment thread tests/dash/gnmi_utils.py
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Comment thread tests/dash/conftest.py
dash_info[LOCAL_PTF_INTF] = minigraph_facts["minigraph_ptf_indices"][intf]
dash_info[LOCAL_PTF_MAC] = neigh_table["v4"][neigh_ip]["macaddress"]
if topo == 'dpu-1' and REMOTE_PA_IP not in dash_info:
if (topo == 'dpu-1' or topo == "t1-28-lag") and REMOTE_PA_IP not in dash_info:
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.

We'll need to add smartswitch-t1 topo as well here.

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.

We'll do this later. Ok to merge for now.

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

prsunny
prsunny previously approved these changes Feb 1, 2025
@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Feb 1, 2025

@oleksandrivantsiv , can you signoff?

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Feb 3, 2025

depends on sonic-net/sonic-buildimage#21553

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Feb 10, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Feb 13, 2025

Also depends on sonic-net/sonic-buildimage#21714

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Feb 13, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@theasianpianist
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 14757 in repo sonic-net/sonic-mgmt

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kperumalbfn kperumalbfn merged commit 1628450 into sonic-net:master Feb 21, 2025
Comment thread tests/dash/gnmi_utils.py
self.gnmi_client_key = "gnmiclient.key"
self.gnmi_server_start_wait_time = 30
self.enable_zmq = duthost.shell("netstat -na | grep -w 8100", module_ignore_errors=True)['rc'] == 0
# self.enable_zmq = duthost.shell("netstat -na | grep -w 8100", module_ignore_errors=True)['rc'] == 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.

@theasianpianist , why change dash test case always enable ZMQ on GNMI?
If someone run these test case on a device not enable ZMQ on orchagent side, some test case may failed, can you check this change?

@JibinBao
Copy link
Copy Markdown
Contributor

JibinBao commented May 6, 2025

Hi @theasianpianist
Since there is no code to configure the dpu ip, npu ip and route, how do you run the test automatically?
Are they configured by the PR #17596?

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.

[Test Gap][dash] Privatelink packet transformation tests