Skip to content

Commit

Permalink
test(conftest): save ssh key on test failure
Browse files Browse the repository at this point in the history
Since ssh keys are now generated on the test machine, we need to
preserve the key in test artifacts to be able to debug a test failure.

Signed-off-by: Nikita Kalyazin <[email protected]>
  • Loading branch information
kalyazin authored and roypat committed Feb 4, 2025
1 parent 1bb9d18 commit 30c77f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import inspect
import json
import os
import platform
import shutil
import sys
import tempfile
Expand Down Expand Up @@ -340,6 +341,7 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
uvm_data = results_dir / uvm.id
uvm_data.mkdir()
uvm_data.joinpath("host-dmesg.log").write_text(dmesg.stdout)
shutil.copy(f"/firecracker/build/img/{platform.machine()}/id_rsa", uvm_data)

uvm_root = Path(uvm.chroot())
for item in os.listdir(uvm_root):
Expand Down

0 comments on commit 30c77f3

Please sign in to comment.