Skip to content

Set test module name in payload of packets injected by ptfadapter#2123

Merged
wangxin merged 5 commits intosonic-net:masterfrom
wangxin:pkt-payload-pr
Aug 27, 2020
Merged

Set test module name in payload of packets injected by ptfadapter#2123
wangxin merged 5 commits intosonic-net:masterfrom
wangxin:pkt-payload-pr

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Aug 20, 2020

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

This PR enhanced the ptfadapter fixture to include test module name in
the payload of injected TCP/UDP packets. Then in the captured pcap file,
it would be easier to tell which packets are injected by the test script.

How did you do it?

  • Override the function in ptf.testutils for sending packets in the ptfadapter plugin. Intercept the packets to be sent and update its payload to repetition of test module name.
  • Override the function in ptf.testutils for receiving packets in the ptfadapter plugin. Intercept the expected packet and update its payload using the same method to match the sent packets.

How did you verify/test it?

Test run ACL and sip_dip scripts which dependent on ptfadapter. Capture the packets and inspect the payload.

  • Both ACL and sip_dip testing passed without issue.
  • In captured pcap file, the packets injected by the scripts have payload set to the repetition of the test module name.

Any platform specific information?

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

Documentation

This PR enhanced the ptfadapter fixture to include test module name in
the payload of injected TCP/UDP packets. Then in the captured pcap file,
it would be easier to tell which packets are injected by the test script.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin requested a review from a team August 20, 2020 11:52
@wangxin wangxin merged commit 035339b into sonic-net:master Aug 27, 2020
@wangxin wangxin deleted the pkt-payload-pr branch September 24, 2020 02:34
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
c5c105f (HEAD -> 202111, origin/202111) [PBH] Implement Edit Flows (sonic-net#2093)
7050581 [techsupport] Handle minor fixes of TS Lock and update auto-TS (sonic-net#2114)
3602f99 Fix issues in clear_qos (sonic-net#2122)
4f96d3b Fixing get port speed when oper status is down (sonic-net#2123)
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.

4 participants