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

L1 tests reboot device #84

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

StepanVovkPLV
Copy link
Collaborator

Objective: if in collected tests we have at least one test_l1 we will sort the list with collected test items, and to the last test of the list(which will be last L1 test) we add additional fixture which will reboot device

  • in def pytest_collection_modifyitems(session, config, items) will perform sorting of ALL the items based on the key provided
  • in pytest_collection_finish(session) hook we will select last test within current session and set the test where to add reboot fixture
  • in async def reboot_device(testbed) will perform reboot of the device
  • in pytest_runtest_setup(item): we modify the last item in sorted session.items list and add rebot_device fixture

yield
devices = await _get_dent_devs_from_testbed(testbed)
to_reboot = [dev.reboot() for dev in devices]
# up_ports = [dev.run_cmd("sudo onlpdump -S") for dev in devices]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can not perform onlpdump on the device. -> cmd not found

@StepanVovkPLV StepanVovkPLV force-pushed the l1_tests_reboot_device branch 4 times, most recently from bde955a to 4ba1a94 Compare March 28, 2023 16:25
@StepanVovkPLV StepanVovkPLV force-pushed the l1_tests_reboot_device branch 3 times, most recently from 761b676 to 35ca1d6 Compare April 6, 2023 06:56
@yuriilisovskyi yuriilisovskyi added the PR Created public PR label Apr 12, 2023
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

Comment on lines +100 to +103
if reboot_after_test:
if reboot_after_test.name == item.name:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if reboot_after_test:
if reboot_after_test.name == item.name:
if reboot_after_test and reboot_after_test.name == item.name:

Comment on lines +176 to +181
to_reboot = [dev.reboot() for dev in devices]
up_ports = [dev.run_cmd('onlpd') for dev in devices]
await asyncio.gather(*to_reboot)
await asyncio.gather(*up_ports)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
to_reboot = [dev.reboot() for dev in devices]
up_ports = [dev.run_cmd('onlpd') for dev in devices]
await asyncio.gather(*to_reboot)
await asyncio.gather(*up_ports)
await asyncio.gather(*[dev.reboot() for dev in devices])
# https://github.com/dentproject/dentOS/issues/152#issuecomment-973264204
await asyncio.gather(*[dev.run_cmd('onlpd') for dev in devices])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Created public PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants