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

set-2 cases and enhancing set-1 smartswitch cases #16020

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

Conversation

nissampa
Copy link
Contributor

@nissampa nissampa commented Dec 11, 2024

==========================================================================================

Test Plan Link:
https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/Smartswitch-test-plan.md

Test Cases in this PR:
1.4 Check DPU console
1.8 Check the NTP date and timezone between DPU and NPU
1.9 Check the State of DPUs
1.10 Check the Health of DPUs
1.13 Check Memory on DPU
1.14 Check DPU status and pcie Link after memory exhaustion on Switch
1.15 Check DPU status and pcie Link after memory exhaustion on DPU
1.16 Check DPU status and pcie Link after restart pmon
1.18 Check DPU status and pcie Link after kernel panic on Switch
1.19 Check DPU status and pcie Link after kernel panic on DPU

==========================================================================================

File: smartswitch/platform_tests/test_show_platform_dpu.py
Test Cases:

test_restart_pmon
test_system_health_state
test_dpu_console
test_npu_dpu_date
test_dpu_memory
test_system_health_summary

==========================================================================================

File: smartswitch/platform_tests/test_reload_dpu.py
Test Cases:

test_kernel_panic_on_switch
test_memory_exhaustion_on_switch
test_kernel_panic_on_dpu
test_memory_exhaustion_on_dpu

==========================================================================================

UT Logs:

smartswitch_PR_logs.zip

==========================================================================================

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa nissampa requested a review from vvolam January 17, 2025 16:51
@prgeor prgeor self-requested a review January 23, 2025 02:33
@@ -3,6 +3,7 @@
"""
import logging
import pytest
import re
from tests.common.devices.sonic import * # noqa: F401,F403
from tests.common.platform.device_utils import platform_api_conn # noqa: F401,F403
Copy link
Contributor

Choose a reason for hiding this comment

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

This import is not required. You can also remove "noqa" tags where platform_api_conn is used. For example,

-def num_dpu_modules(platform_api_conn): # noqa F811
+def num_dpu_modules(platform_api_conn):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

F811 was introduced here in this commit by yotongzhang-microsoft on smartswitch files as well.
So, I followed the same suit.

475f52f#diff-1ff5cd58b35cd3c24b8e95e46748a838458539db3f66b1bf0915980c82d94416

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, can you please fix it in the files you are modifying? As I mentioned previously in one of the comment, this can be simply avoided by removing import of platform_api_conn line at 7. Please give it a try. I have already tried it locally and that works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we go ahead and remove line 7 totally ?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

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 will change it, test it and update it here.

Copy link
Contributor

@vvolam vvolam left a comment

Choose a reason for hiding this comment

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

Please cleanup all flake8 "noqa" tags.

Copy link
Contributor

@vvolam vvolam left a comment

Choose a reason for hiding this comment

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

Please recheck the assertion logs, most of them seems to be opposite in case of assertion is raised on failure.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa nissampa requested a review from vvolam January 24, 2025 21:23
from tests.smartswitch.common.device_utils_dpu import * # noqa: F401,F403,E501
from tests.common.helpers.platform_api import chassis, module # noqa: F401
from tests.common.helpers.platform_api import module
from tests.smartswitch.common.device_utils_dpu import ( # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to add noqa here? What is the error otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was similar to that line 7 of importing platform_conn.

Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't get you? What is the Flake8 error you are getting here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since importing fixtures as part of import, it gives me flake8 error. Without import test is giving me error.

tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
executable="/bin/bash")

logging.info("Waiting for ssh connection to switch")
wait_for_startup(duthost, localhost, 100, 400)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this delay and timeout in secs? Is this sufficient for all vendors? Also, could you please add a comment above about the time metric used here?

@oleksandrivantsiv - for Viz

tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved
tests/smartswitch/platform_tests/test_reload_dpu.py Outdated Show resolved Hide resolved

command = ('python -c "import pexpect; '
'child = pexpect.spawn(\'python /usr/local/bin/dpu-tty.py -n dpu%s\'); ' # noqa: E501
'child.expect(r\' \'); '
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the expectation same on all vendor devices?

@oleksandrivantsiv for viz

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

3 participants