Skip to content

Add dualtor support for directed broadcast test#6395

Merged
xwjiang-ms merged 7 commits intosonic-net:masterfrom
xwjiang-ms:dir_bcast_for_dualtor
Sep 30, 2022
Merged

Add dualtor support for directed broadcast test#6395
xwjiang-ms merged 7 commits intosonic-net:masterfrom
xwjiang-ms:dir_bcast_for_dualtor

Conversation

@xwjiang-ms
Copy link
Copy Markdown
Contributor

@xwjiang-ms xwjiang-ms commented Sep 22, 2022

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012

Approach

What is the motivation for this PR?

Directed bcast test only support t0 topo, but dualtor also support this function

How did you do it?

  1. Use mgfacts to get src/dst ports instead of hard code
  2. Use json file to record src/dst ports
  3. Dualtor will forward dir bcast packets from active ports, so after toggling, dst ports should be all active ports in "show mux status"
  4. Expected to forward packets by active ports in active tor, but dualtor can't forword packets until buildimage team make some changes, so use xfail now

How did you verify/test it?

Run test

Any platform specific information?

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

Documentation

What is the motivation for this PR?
Directed bcast test only support t0 topo, but dualtor also support this function

How did you do it?
1. Use mgfacts to get src/dst ports instead of hard code
2. Use json file to record src/dst ports
3. Dualtor will forward dir bcast packets from active ports, so after toggling,
dst ports should be all active ports in "show mux status"

How did you verify/test it?
Run test

Any platform specific information?
Supported testbed topology if it's a new test case?
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 22, 2022

This pull request introduces 3 alerts when merging 877e47d into e22a588 - view on LGTM.com

new alerts:

  • 3 for Unused import

@xwjiang-ms
Copy link
Copy Markdown
Contributor Author

xwjiang-ms commented Sep 23, 2022

Dualtor don't support directed broadcast, so use xfail now, created an issue: sonic-net/sonic-buildimage#12167

@xwjiang-ms xwjiang-ms requested a review from wangxin September 23, 2022 07:27
ptfhost.copy(content=json.dumps(ptf_test_port_map), dest=PTF_TEST_PORT_MAP)


@pytest.mark.xfail
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add the xfail mark to conditional mark yaml file.
Currently, dir_bcast only fails on dualtor. It should be able to pass on other topologies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK


PTF_TEST_PORT_MAP = '/root/ptf_test_port_map.json'

def parse_mux_status(output_lines):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you take advantage of the existing show_and_parse method to avoid code duplication: https://github.com/sonic-net/sonic-mgmt/blob/master/tests/common/devices/sonic.py#L1387

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, that will be better

@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Sep 27, 2022

@xwjiang-ms Can you also resolve the merge conflicts?

@xwjiang-ms
Copy link
Copy Markdown
Contributor Author

@xwjiang-ms Can you also resolve the merge conflicts?

OK, I will solve it

xwjiang-ms and others added 2 commits September 29, 2022 13:41
1. Record vlan ip port pair in json file in case multi vlan
2. Use "show_and_parse" to parse duthost output
3. Do not skip dualtor but xfail in conditional mark
@xwjiang-ms xwjiang-ms requested a review from wangxin September 29, 2022 13:50
- "topo_type not in ['t0', 'm0', 'dualtor']"

ipfwd/test_dir_bcast.py:
xfail:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The xfail mark need to be specified under the same ipfwd/test_dir_bcast.py entry. Otherwise, we will have duplicated entries in this yaml file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, I will change it

@xwjiang-ms xwjiang-ms merged commit 62cf362 into sonic-net:master Sep 30, 2022
Azarack pushed a commit to Azarack/sonic-mgmt that referenced this pull request Oct 17, 2022
* Add dualtor support for directed bcast test

What is the motivation for this PR?
Directed bcast test only support t0 topo, but dualtor also support this function

How did you do it?
1. Use mgfacts to get src ports instead of hard code
2. Use json file to record src ports, vlan prefix and dst ports parir
3. Dualtor will forward dir bcast packets from active ports, so after toggling,
dst ports should be all active ports in "show mux status"
4. Do not skip dualtor but xfail in conditional mark

How did you verify/test it?
Run test

Any platform specific information?
Supported testbed topology if it's a new test case?
allen-xf pushed a commit to allen-xf/sonic-mgmt that referenced this pull request Oct 28, 2022
* Add dualtor support for directed bcast test

What is the motivation for this PR?
Directed bcast test only support t0 topo, but dualtor also support this function

How did you do it?
1. Use mgfacts to get src ports instead of hard code
2. Use json file to record src ports, vlan prefix and dst ports parir
3. Dualtor will forward dir bcast packets from active ports, so after toggling,
dst ports should be all active ports in "show mux status"
4. Do not skip dualtor but xfail in conditional mark

How did you verify/test it?
Run test

Any platform specific information?
Supported testbed topology if it's a new test case?
@xwjiang-ms xwjiang-ms deleted the dir_bcast_for_dualtor branch December 16, 2022 01:34
wangxin pushed a commit that referenced this pull request Feb 27, 2023
* Add dualtor support for directed bcast test

What is the motivation for this PR?
Directed bcast test only support t0 topo, but dualtor also support this function

How did you do it?
1. Use mgfacts to get src ports instead of hard code
2. Use json file to record src ports, vlan prefix and dst ports parir
3. Dualtor will forward dir bcast packets from active ports, so after toggling,
dst ports should be all active ports in "show mux status"
4. Do not skip dualtor but xfail in conditional mark

How did you verify/test it?
Run test

Any platform specific information?
Supported testbed topology if it's a new test case?
wangxin pushed a commit to xwjiang-ms/sonic-mgmt that referenced this pull request May 31, 2023
What is the motivation for this PR?
dir_bcast test always fails in t0-56 topo

How did you do it?
Add topo support and sync with master branch
ref PR: sonic-net#6395
xwjiang-ms added a commit that referenced this pull request May 31, 2023
* [202012]Fix dir bcast failure in to-56 topo
What is the motivation for this PR?
dir_bcast test always fails in t0-56 topo

How did you do it?
Add topo support and sync with master branch
ref PR: #6395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants