Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dualtor]: Add utilities for dual ToR mocking #2945

Merged
merged 4 commits into from
Feb 16, 2021

Conversation

theasianpianist
Copy link
Contributor

@theasianpianist theasianpianist commented Feb 6, 2021

  • Apply config DB tables to mock dual ToR setup
  • Apply kernel configurations (neighbor entries and route)
  • Apply orchagent config to mock dual ToR setup

Signed-off-by: Lawrence Lee [email protected]

Description of PR

Summary:
Closes #2808

Type of change

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

Approach

What is the motivation for this PR?

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?

Documentation

* Apply config DB tables to mock dual ToR setup
* Apply kernel configurations (neighbor entries and route)
* Apply orchagent config to mock dual ToR setup

Signed-off-by: Lawrence Lee <[email protected]>
@theasianpianist theasianpianist requested review from prsunny and a team February 6, 2021 02:20
'''

dut = duthosts[rand_one_dut_hostname]
lo_facts = dut.get_running_config_facts()['LOOPBACK_INTERFACE']
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, is this picking up Loopback0 ip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just whichever is listed first. If the config came from a minigraph generated by sonic-mgmt, it will always be Loopback0. Also, the single ToR config only has a single Loopback interface regardless.

tests/common/dualtor/dual_tor_mock.py Outdated Show resolved Hide resolved
tests/common/dualtor/dual_tor_mock.py Outdated Show resolved Hide resolved
* Use `ip * replace` instead of `add` and `delete`
* Make variable names better

Signed-off-by: Lawrence Lee <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Feb 11, 2021

This pull request introduces 1 alert when merging 08c44be into ad98413 - view on LGTM.com

new alerts:

  • 1 for Unused import

Signed-off-by: Lawrence Lee <[email protected]>
@yxieca yxieca merged commit bf26ec9 into sonic-net:master Feb 16, 2021
@theasianpianist theasianpianist deleted the dual-tor-mock branch May 13, 2021 22:52
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.

Dual ToR Mock Utility
3 participants