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

[arp] Allow use of discontiguous ports with ARP tests. #3776

Merged
merged 2 commits into from Apr 26, 2022

Conversation

tcusto
Copy link
Contributor

@tcusto tcusto commented Jul 12, 2021

Description of PR

Summary:
Allow use of discontiguous ports with ARP tests.

Type of change

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

Back port request

  • 201911

Approach

What is the motivation for this PR?

This change allows the ARP tests to run when not all front panel ports are connected to the fanout. Support was added for this configuration in PR 2517.

How did you do it?

Instead of picking first two ports on the card, do a show interface and find the first two ports that are admin up. Then proceed with the existing logic to move the port out of port channel if it is present.

How did you verify/test it?

Ran test_arpall.py on a card with non-adjacent ports.

15:22:54 conftest.intfs_for_test L0093 INFO | Selected ints are Ethernet1 and Ethernet11

=============================== warnings summary ===============================
/usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:538
/usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:538: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 5 passed, 1 warnings in 175.22 seconds ====================

Any platform specific information?

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

Documentation

@tcusto tcusto requested a review from a team as a code owner July 12, 2021 17:01
@anshuv-mfst anshuv-mfst requested a review from a team August 3, 2021 23:13
@rlhui rlhui requested a review from smaheshm September 8, 2021 18:51
intf1 = ports[0]
intf2 = ports[1]
# Select first 2 ports that are admin 'up'
if duthost.is_multi_asic:
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to avoid using "is_multi_asic" in the test logic. Use 'sonic.py', or 'sonic_asic.py' to add new APIs if required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed in the latest commit

@smaheshm
Copy link
Contributor

Copy link
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

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

Please use the suggested API.

# Select port index 0 & 1 two interfaces for testing
intf1 = ports[0]
intf2 = ports[1]
# Select first 2 ports that are admin 'up'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would testbed yaml file include ports that are admin down? If all the ports in testbed file are admin up, we don't need the change in the test, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

yaml file contains the testbed topology information. Sometimes the links are not up, not necessarily because of 'admin' state. It's good to get working ports for testing to reduce flakiness.

harish-kalyanaraman pushed a commit to harish-kalyanaraman/sonic-mgmt that referenced this pull request Nov 18, 2021
@sanmalho-git
Copy link
Contributor

get_active_ip_interfaces returns the port channel interfaces as well. If we use get_active_ip_interfaces, we would have to add logic to differentiate between PortChannel and port IP interfaces, and if PortChannel, use its members. This would result in much more code changes.

@sanmalho-git
Copy link
Contributor

@smaheshm have incorporated your review comments. Could you please review again and help get this PR merged - Thanks.

mannytaheri pushed a commit to mannytaheri/sonic-mgmt that referenced this pull request Mar 9, 2022
@smaheshm
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for addressing the comments.

@judyjoseph judyjoseph merged commit 6a3c545 into sonic-net:master Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants