Skip to content

Added adding static route before startup interfaces#14699

Merged
bingwang-ms merged 5 commits intosonic-net:masterfrom
alawing:alawing/fixecmptests2
Oct 1, 2024
Merged

Added adding static route before startup interfaces#14699
bingwang-ms merged 5 commits intosonic-net:masterfrom
alawing:alawing/fixecmptests2

Conversation

@alawing
Copy link
Contributor

@alawing alawing commented Sep 23, 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?

There are new arp and ndp behaviors when shutdown the interfaces:

How did you do it?

We changed and fixed the way of previous fixing to match the new arp and ndp behaviors when shutdown the interfaces:
#14251
We added adding static route before startup interfaces when running testing.

How did you verify/test it?

Tested the script

Any platform specific information?

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

Documentation

@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/ecmp/test_fgnhg.py:275:13: E117 over-indented
tests/ecmp/test_fgnhg.py:281:1: E302 expected 2 blank lines, found 1
tests/ecmp/test_fgnhg.py:344:5: E265 block comment should start with '# '
tests/ecmp/test_fgnhg.py:413:5: E265 block comment should start with '# '

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/ecmp/test_fgnhg.py:275:13: E117 over-indented
tests/ecmp/test_fgnhg.py:289:5: E265 block comment should start with '# '

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>

@bingwang-ms
Copy link
Collaborator

/azp run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

duthost.shell("sudo arp -s {0} {1}".format(ip, mac))
else:
logger.info("adding ipv6 static arp entry for ip %s on DUT" % (ip))
duthost.shell("sudo ip -6 neigh replace {0} lladdr {1} dev Vlan{2}".format(ip, mac, DEFAULT_VLAN_ID))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the static neighbor removed?

Copy link
Contributor Author

@alawing alawing Sep 26, 2024

Choose a reason for hiding this comment

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

From 202205 and newer version. When testing shut down an interface, the neighbor/Arp tables will lose the static neighbor

Copy link
Collaborator

Choose a reason for hiding this comment

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

My concern is the statically added neighbor will be there permanently, which may impact other tests running after test_fgnhg. Suggest adding a cleanup to remove the statically programmed neigh

Copy link
Contributor Author

@alawing alawing Sep 26, 2024

Choose a reason for hiding this comment

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

Neighbor entries will be flushed when reloading config after tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

i thought we fixed it by sonic-net/sonic-swss#2469

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i thought we fixed it by sonic-net/sonic-swss#2469

That PR is not fixing the issue we have on this test.

@bingwang-ms bingwang-ms requested a review from prsunny September 26, 2024 17:10
@bingwang-ms bingwang-ms merged commit c49a013 into sonic-net:master Oct 1, 2024
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #14868

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14869

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #14870

mssonicbld pushed a commit that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
mssonicbld pushed a commit that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
mssonicbld pushed a commit that referenced this pull request Oct 8, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Oct 10, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
* added static routes before interface startup

* fixed ipv6 from add to replace

* address comments

* fix pre-commit issue
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.

6 participants