Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,12 @@ def microvm_factory(request, record_property, results_dir, netns_factory):
# if the test failed, save important files from the root of the uVM into `test_results` for troubleshooting
report = request.node.stash[PHASE_REPORT_KEY]
if "call" in report and report["call"].failed:
dmesg = utils.run_cmd(["dmesg", "-dPx"])
for uvm in uvm_factory.vms:
uvm_data = results_dir / uvm.id
uvm_data.mkdir()
uvm_data.joinpath("host-dmesg.log").write_text(dmesg.stdout)
uvm_data.joinpath("host-dmesg.log").write_text(
utils.run_cmd(["dmesg", "-dPx"]).stdout
)
shutil.copy(f"/firecracker/build/img/{platform.machine()}/id_rsa", uvm_data)

uvm_root = Path(uvm.chroot())
Expand Down
2 changes: 1 addition & 1 deletion tests/host_tools/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run(self):
guest_mem_bytes = self._vm.mem_size_bytes
try:
ps = psutil.Process(self._vm.firecracker_pid)
except psutil.NoSuchProcess:
except (psutil.NoSuchProcess, FileNotFoundError):
return
while not self._should_stop:
try:
Expand Down
3 changes: 2 additions & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ cmd_fix_perms() {
run_devctr \
--workdir "$CTR_FC_ROOT_DIR" \
-- \
chown -f -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR" "$CTR_TEST_RESULTS_DIR" "$CTR_CI_ARTIFACTS_PATH"
chown -f -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR" "$CTR_TEST_RESULTS_DIR" "$CTR_CI_ARTIFACTS_PATH" $@
}

# Builds the development container from its Dockerfile.
Expand Down Expand Up @@ -890,6 +890,7 @@ cmd_sandbox() {
cmd_build --release
ensure_ci_artifacts
cmd_sh "tmux new env PYTEST_ADDOPTS=--pdbcls=IPython.terminal.debugger:TerminalPdb PYTHONPATH=tests IPYTHONDIR=\$PWD/.ipython ipython -i ./tools/sandbox.py $@"
cmd_fix_perms ".ipython"
}

cmd_sandbox_native() {
Expand Down