From 30c77f389437c3feb8b7afc9a9322541bb0cc019 Mon Sep 17 00:00:00 2001 From: Nikita Kalyazin Date: Mon, 3 Feb 2025 16:25:58 +0000 Subject: [PATCH] test(conftest): save ssh key on test failure 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 --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 41e0fbf2721..552ba25c4ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,6 +22,7 @@ import inspect import json import os +import platform import shutil import sys import tempfile @@ -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):