Skip to content

Fix test_neighbor_mac on t1-lag and t1-64-lag#13314

Merged
bingwang-ms merged 4 commits intosonic-net:masterfrom
byu343:fix-test-neighbor-mac
Jul 10, 2024
Merged

Fix test_neighbor_mac on t1-lag and t1-64-lag#13314
bingwang-ms merged 4 commits intosonic-net:masterfrom
byu343:fix-test-neighbor-mac

Conversation

@byu343
Copy link
Contributor

@byu343 byu343 commented Jun 14, 2024

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

A recent change applies this test to the topo of t1 and t1-variants:
#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so IP address cannot be set to it.

How did you do it?

The fix here is to remove the intf from the portchanenl before testing it.
Skip the test if Ethernet0 is not available or down at the beginning of test
Assert Ethernet0 is in routed state after removing it from portchannel

How did you verify/test it?

Run the test on t1-lag and t1-64-lag topo.

  • The test can pass
  • Verified in the log that removing and adding the member to PortChannel succeeded

Any platform specific information?

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

Documentation

Copy link
Collaborator

Choose a reason for hiding this comment

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

better to add a wait_until logic here to wait and check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS
Copy link
Collaborator

@byu343 conflicts need to resolve.

@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from f364049 to 17062f4 Compare June 20, 2024 18:34
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/arp/test_neighbor_mac.py:57:121: E501 line too long (162 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/arp/test_neighbor_mac.py:59:85: E502 the backslash is redundant between brackets
tests/arp/test_neighbor_mac.py:59:85: E211 whitespace before '['

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from 35d0086 to d811bec Compare June 20, 2024 22:01
@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 21, 2024

Please re-run the PR test.

@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from d811bec to 4a444eb Compare June 21, 2024 01:05
@StormLiangMS
Copy link
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

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

Copy link
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

LGTM

@ZhaohuiS
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

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

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 25, 2024

Have triggered to rerun the failed jobs.

@StormLiangMS
Copy link
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@siqbal1986 siqbal1986 self-requested a review June 25, 2024 19:17
@StormLiangMS
Copy link
Collaborator

@byu343 code conflict.

@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from 4a444eb to a96e16f Compare July 2, 2024 17:31
@byu343
Copy link
Contributor Author

byu343 commented Jul 2, 2024

@byu343 code conflict.

Code conflict has been fixed

byu343 added 3 commits July 3, 2024 16:24
A recent change sets this test to t1-only:
sonic-net#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from a96e16f to 1bb3018 Compare July 3, 2024 23:24
@StormLiangMS
Copy link
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@byu343 byu343 force-pushed the fix-test-neighbor-mac branch from 1bb3018 to 96f18cd Compare July 5, 2024 17:24
@bingwang-ms bingwang-ms merged commit 35efc04 into sonic-net:master Jul 10, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 10, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
sonic-net#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 10, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
sonic-net#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #13607

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #13608

mssonicbld pushed a commit that referenced this pull request Jul 10, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
mssonicbld pushed a commit that referenced this pull request Jul 12, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 30, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
sonic-net#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #13879

mssonicbld pushed a commit that referenced this pull request Jul 30, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
* Fix test_neighbor_mac on t1-lag and t1-64-lag

A recent change sets this test to t1-only:
sonic-net#12952

The test can pass on topo t1 without any change.

For t1-lag or t1-64-lag, the Ethernet0 to test is in portchannel, so
IP address cannot be set to it. The fix here is to delete the intf
from the portchanenl before testing it.
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.

8 participants