Skip to content

[Advanced_reboot] Add test for two loopbacks in warm reboot test #7324

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kellyyeh
Copy link
Contributor

@kellyyeh kellyyeh commented Jan 24, 2023

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
  • 202205

Approach

What is the motivation for this PR?

Fill warm-reboot test gap for when there are two loopback addresses

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

yxieca
yxieca previously approved these changes Feb 13, 2023
@@ -617,7 +621,9 @@ def setUp(self):

self.generate_from_t1()
self.generate_from_vlan()
self.generate_ping_dut_lo()
self.generate_ping_dut_lo(self.lo_prefix)
#if self.lo_prefix2 != '':
Copy link
Contributor

Choose a reason for hiding this comment

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

This part is commented. I think we do want to call generate_ping_dut_lo with second lo.

@@ -50,6 +50,10 @@ def __init__(self, request, duthosts, duthost, ptfhost, localhost, tbinfo, creds
'service-warm-restart' in kwargs['rebootType']), \
"Please set rebootType var."

sonic_hwsku = duthost.sonichost.facts["hwsku"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This part (skipping on 3800) is not relevant to the PR. Please remove.

@@ -673,6 +680,7 @@ def __runPtfRunner(self, rebootOper=None):
"dut_mac": self.rebootData['dut_mac'],
"vlan_mac": self.rebootData['vlan_mac'],
"lo_prefix": self.rebootData['lo_prefix'],
"lo_prefix2": self.rebootData['lo_prefix2'],
Copy link
Contributor

Choose a reason for hiding this comment

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

This will throw KeyError when lo_prefix2 key is not found in dict. That can happen when len(self.mgFacts['minigraph_lo_interfaces']) <= 1

@vaibhavhd
Copy link
Contributor

Added some comments. Also, let's wait to merge this PR until the test_advanced_reboot is added as part of PR tests.

@wangxin
Copy link
Collaborator

wangxin commented Feb 21, 2023

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing ansible/roles/test/files/ptftests/advanced-reboot.py
Fixing tests/common/fixtures/advanced_reboot.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1

ansible/roles/test/files/ptftests/advanced-reboot.py: failed parsing with CPython 3.10.6:

Traceback (most recent call last):
File "/home/vsts/.cache/pre-commit/repo2s0ri_en/py_env-python3/lib/python3.10/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

vaibhavhd
vaibhavhd previously approved these changes Feb 23, 2023
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing ansible/roles/test/files/ptftests/advanced-reboot.py

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

ansible/roles/test/files/ptftests/advanced-reboot.py:2306:22: F821 undefined name 'xrange'
ansible/roles/test/files/ptftests/advanced-reboot.py:2307:32: F821 undefined name 'ping_dut_macjump_packet'
tests/common/fixtures/advanced_reboot.py:181:121: E501 line too long (126 > 120 characters)
tests/common/fixtures/advanced_reboot.py:597:121: E501 line too long (123 > 120 characters)
tests/common/fixtures/advanced_reboot.py:721:13: E122 continuation line missing indentation or outdented
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

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.

5 participants