Skip to content

Commit 30c77f3

Browse files
kalyazinroypat
authored andcommitted
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 <[email protected]>
1 parent 1bb9d18 commit 30c77f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import inspect
2323
import json
2424
import os
25+
import platform
2526
import shutil
2627
import sys
2728
import tempfile
@@ -340,6 +341,7 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
340341
uvm_data = results_dir / uvm.id
341342
uvm_data.mkdir()
342343
uvm_data.joinpath("host-dmesg.log").write_text(dmesg.stdout)
344+
shutil.copy(f"/firecracker/build/img/{platform.machine()}/id_rsa", uvm_data)
343345

344346
uvm_root = Path(uvm.chroot())
345347
for item in os.listdir(uvm_root):

0 commit comments

Comments
 (0)