Skip to content

Commit

Permalink
add link up cmd to fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanVovkPLV committed Jun 1, 2023
1 parent 20ffb68 commit f410ad9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def pytest_collection_finish(session):
global reboot_after_test
for item in session.items:
# Save the name of the last L1 test in session
if "test_l1" in item.name:
if 'test_l1' in item.name:
reboot_after_test = session.items[-1]
break

Expand All @@ -100,7 +100,7 @@ def pytest_runtest_setup(item):
if reboot_after_test:
if reboot_after_test.name == item.name:
# Add `reboot_device` fixture to last L1 test
item.fixturenames.append("reboot_device")
item.fixturenames.append('reboot_device')


def pytest_runtest_teardown(item, nextitem):
Expand Down Expand Up @@ -174,7 +174,9 @@ async def reboot_device(testbed):
yield
devices = await _get_dent_devs_from_testbed(testbed)
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)


@pytest_asyncio.fixture()
Expand Down

0 comments on commit f410ad9

Please sign in to comment.