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

Fix for GCU Dhcp_Relay issue in KVM test failure #9800

Merged
merged 16 commits into from
Sep 8, 2023
Merged

Fix for GCU Dhcp_Relay issue in KVM test failure #9800

merged 16 commits into from
Sep 8, 2023

Conversation

ridahanif96
Copy link
Contributor

@ridahanif96 ridahanif96 commented Sep 1, 2023

Why I did it
This PR is created to resolve GCU DHCP_Relay issues in kvm test failure in Update submodule sonic-utilities to the latest HEAD

Summary: Fixed PR issues in fixture/duthost_utilites.py to solve vlan member addition changes on Port

Signed-off-by: Rida Hanif rida.hanif@xflowresearch.com

@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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/generic_config_updater/test_dhcp_relay.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

tests/generic_config_updater/test_dhcp_relay.py:48:17: F841 local variable 'switchport_mode_result' is assigned to but never used
tests/generic_config_updater/test_dhcp_relay.py:48:42: F821 undefined name 'duthost'

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>

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 1, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@ridahanif96
Copy link
Contributor Author

ridahanif96 commented Sep 2, 2023

@mssonicbld @liushilongbuaa @gechiang I have created this PR to resolve the DHCP_Realy failure issue, but KVM tests are still failing here.
We have added a switchport mode command which needs to be checked always from now onward whenever VLAN members are configured in SONIC. We have updated sonic-utilities & sonic-mgmt earlier with HLD PR.
There was a recent change in DHCP_relay as well due to which this KVM test failure occurs.
What issue i am facing with this PR is that the current mgmt repo is not able to invoke the updated sonic-utilities repo, therefore it is showing following error:

{"changed": false, "cmds": ["config vlan add 108", "config interface ip add Vlan108 192.168.8.1/24", "config vlan add 109", "config interface ip add Vlan109 192.168.9.1/24", "config switchport mode trunk Ethernet4", "config vlan member add 108 Ethernet4", "config vlan member add 109 Ethernet4"], "delta": "0:00:04.600182", "end": "2023-09-02 12:27:53.114145", "failed": true, "failed_cmds": ["config switchport mode trunk Ethernet4"], "msg": "At least running one of the commands failed", "results": [{"cmd": "config vlan add 108", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0},
{"cmd": "config interface ip add Vlan108 192.168.8.1/24", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0}, {"cmd": "config vlan add 109", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0}, {"cmd": "config interface ip add Vlan109 192.168.9.1/24", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0},
{"cmd": "config switchport mode trunk Ethernet4", "cmd_with_timeout": "", "err_msg": "", "rc": 2, "stderr": "Usage: config [OPTIONS] COMMAND [ARGS]...\nTry "config -h" for help.\n\nError: No such command "switchport".\n", "stderr_lines": ["Usage: config [OPTIONS] COMMAND [ARGS]...", "Try "config -h" for help.", "", "Error: No such command "switchport"."], "stdout": "", "stdout_lines": [], "timeout": 0}, {"cmd": "config vlan member add 108 Ethernet4", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0}, {"cmd": "config vlan member add 109 Ethernet4", "cmd_with_timeout": "", "err_msg": "", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "timeout": 0}], "start": "2023-09-02 12:27:48.513963"}

These errors are different from Update submodule sonic-utilities PR which can be verified as below:

{"cmd": "config vlan member add 108 Ethernet4", "cmd_with_timeout": "", "err_msg": "", "rc": 2, "stderr": "Usage: config vlan member add [OPTIONS] port\nTry "config vlan member add -h" for help.\n\nError: Ethernet4 is in routed mode!\nUse switchport mode command to change port mode\n", "stderr_lines": ["Usage: config vlan member add [OPTIONS] port", "Try "config vlan member add -h" for help.", "", "Error: Ethernet4 is in routed mode!", "Use switchport mode command to change port mode"], "stdout": "", "stdout_lines": [], "timeout": 0},

{"cmd": "config vlan member add 109 Ethernet4", "cmd_with_timeout": "", "err_msg": "", "rc": 2, "stderr": "Usage: config vlan member add [OPTIONS] port\nTry "config vlan member add -h" for help.\n\nError: Ethernet4 is in routed mode!\nUse switchport mode command to change port mode\n", "stderr_lines": ["Usage: config vlan member add [OPTIONS] port", "Try "config vlan member add -h" for help.", "", "Error: Ethernet4 is in routed mode!", "Use switchport mode command to change port mode"], "stdout": "", "stdout_lines": [], "timeout": 0}], "start": "2023-08-31 16:11:31.354762"}

Is there a way we can skip failing tests just for this PR to resolve kvm test failure? if this is possible we can do it to resolve this current issue. It might also be possible that you @mssonicbld add these proposed changes in your PR to solve this failure or add me as collaborator in PR to help.

@liushilongbuaa
Copy link
Contributor

@yejianquan , do you know who can help review this PR?

@liushilongbuaa
Copy link
Contributor

@ridahanif96 , mssonicbld is automation account.

@ridahanif96
Copy link
Contributor Author

@ridahanif96 , mssonicbld is automation account.

Ok Thanks.

@yejianquan
Copy link
Collaborator

yejianquan commented Sep 5, 2023

+ @jcaiMR @kellyyeh as the DHCP owner

@jcaiMR
Copy link
Contributor

jcaiMR commented Sep 5, 2023

@ridahanif96 Would you please change title to gcu dhcp_relay, since it may confuse with dhcp_relay/test_dhcp_relay.py.

@ridahanif96 ridahanif96 changed the title Fix for DHCP_Relay issue in KVM test failure Fix for GCU Dhcp_Relay issue in KVM test failure Sep 5, 2023
@ridahanif96
Copy link
Contributor Author

@ridahanif96 Would you please change title to gcu dhcp_relay, since it may confuse with dhcp_relay/test_dhcp_relay.py.

Done

@ridahanif96
Copy link
Contributor Author

ridahanif96 commented Sep 8, 2023

All KVM failure resolved @liushilongbuaa @yejianquan please review this PR.
I have added a compatible logic to pass current KVM image along with passing advance utilites PR Once this PR is merged, all dependency will be resolved.
Thanks!

Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

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

LGTM

AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
Why I did it
This PR is created to resolve GCU DHCP_Relay issues in kvm test failure in Update submodule sonic-utilities to the latest HEAD

Summary: Fixed PR issues in fixture/duthost_utilites.py to solve vlan addition changes on Port

Signed-off-by: Rida Hanif rida.hanif@xflowresearch.com
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.

6 participants