Skip to content

L1 tests reboot device - #84

Draft
StepanVovkPLV wants to merge 1 commit into
masterfrom
l1_tests_reboot_device
Draft

L1 tests reboot device#84
StepanVovkPLV wants to merge 1 commit into
masterfrom
l1_tests_reboot_device

Conversation

@StepanVovkPLV

Copy link
Copy Markdown
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
Copy Markdown
CollaboratorAuthor

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
StepanVovkPLVforce-pushed the l1_tests_reboot_device branch 4 times, most recently from bde955a to 4ba1a94CompareMarch 28, 2023 16:25
Comment threadDentOS_Framework/DentOsTestbed/src/dent_os_testbed/test/conftest.py Outdated
@StepanVovkPLV
StepanVovkPLVforce-pushed the l1_tests_reboot_device branch 3 times, most recently from 761b676 to 35ca1d6CompareApril 6, 2023 06:56
@yuriilisovskyiyuriilisovskyi added the PR Created public PR label Apr 12, 2023
@github-actions

This comment was marked as resolved.

@StepanVovkPLV
StepanVovkPLVforce-pushed the l1_tests_reboot_device branch from 131ad5d to 20ffb68CompareJune 1, 2023 19:41
@github-actions

This comment was marked as resolved.

@StepanVovkPLV
StepanVovkPLVforce-pushed the l1_tests_reboot_device branch from f410ad9 to 5b01ffbCompareJune 1, 2023 19:44
Comment on lines +100 to +103
if reboot_after_test:
if reboot_after_test.name == item.name:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ifreboot_after_test:
ifreboot_after_test.name==item.name:
ifreboot_after_testandreboot_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
Copy Markdown
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() fordevindevices]
up_ports= [dev.run_cmd('onlpd') fordevindevices]
awaitasyncio.gather(*to_reboot)
awaitasyncio.gather(*up_ports)
awaitasyncio.gather(*[dev.reboot() fordevindevices])
# https://github.com/dentproject/dentOS/issues/152#issuecomment-973264204
awaitasyncio.gather(*[dev.run_cmd('onlpd') fordevindevices])

Signed-off-by: Stepan Vovk <stepan.vovk@plvision.eu>
@StepanVovkPLV
StepanVovkPLVforce-pushed the l1_tests_reboot_device branch from 2f19191 to fe531c5CompareJuly 20, 2023 07:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PRCreated public PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@StepanVovkPLV@SerhiyBoikoPLV@yuriilisovskyi