From a81c1aafc4216d06ad049843f1c8cc3119027cb9 Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Thu, 13 Nov 2025 14:17:32 +0100 Subject: [PATCH 1/7] `make test`: Add the ability to pick which test to ran via var This allows you to run only a specific test e.g. `make test TEST=tsi-udp` If TEST is not specified all test will be run. Signed-off-by: Matej Hrica --- Makefile | 4 +++- tests/run.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 69aa8660c..269edcb34 100644 --- a/Makefile +++ b/Makefile @@ -181,5 +181,7 @@ test-prefix/lib64/libkrun.pc: $(LIBRARY_RELEASE_$(OS)) test-prefix: test-prefix/lib64/libkrun.pc +TEST ?= all + test: test-prefix - cd tests; LD_LIBRARY_PATH="$$(realpath ../test-prefix/lib64/)" PKG_CONFIG_PATH="$$(realpath ../test-prefix/lib64/pkgconfig/)" ./run.sh + cd tests; LD_LIBRARY_PATH="$$(realpath ../test-prefix/lib64/)" PKG_CONFIG_PATH="$$(realpath ../test-prefix/lib64/pkgconfig/)" ./run.sh test --test-case "$(TEST)" diff --git a/tests/run.sh b/tests/run.sh index b977b658b..7e2b4f9d4 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -17,10 +17,10 @@ cargo build -p runner export KRUN_TEST_GUEST_AGENT_PATH="target/$GUEST_TARGET_ARCH/debug/guest-agent" if [ -z "${KRUN_NO_UNSHARE}" ] && which unshare 2>&1 >/dev/null; then - unshare --user --map-root-user --net -- /bin/sh -c "ifconfig lo 127.0.0.1 && exec target/debug/runner $@" + unshare --user --map-root-user --net -- /bin/sh -c "ifconfig lo 127.0.0.1 && exec target/debug/runner $*" else echo "WARNING: Running tests without a network namespace." echo "Tests may fail if the required network ports are already in use." echo - target/debug/runner $@ + target/debug/runner "$@" fi From 68cd5f70808a2faed7c2876509bcb3e71db7a917 Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Thu, 27 Nov 2025 16:01:59 +0100 Subject: [PATCH 2/7] tests: Crate all test dirs under a single temp dir Instead of creating a tmp dir with random suffix for each test, create a tmp dir with the suffix for the whole run of the test. This allows the user to more easily view results of a run under a single directory. This also adds a --base-dir flag for overriding the test directory, and --keep-all which doesn't delete any of the files generated by the test. Signed-off-by: Matej Hrica --- Makefile | 3 ++- tests/run.sh | 14 +++++++--- tests/runner/src/main.rs | 55 +++++++++++++++++++++++++++++++--------- 3 files changed, 56 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 269edcb34..83dc540d0 100644 --- a/Makefile +++ b/Makefile @@ -182,6 +182,7 @@ test-prefix/lib64/libkrun.pc: $(LIBRARY_RELEASE_$(OS)) test-prefix: test-prefix/lib64/libkrun.pc TEST ?= all +TEST_FLAGS ?= test: test-prefix - cd tests; LD_LIBRARY_PATH="$$(realpath ../test-prefix/lib64/)" PKG_CONFIG_PATH="$$(realpath ../test-prefix/lib64/pkgconfig/)" ./run.sh test --test-case "$(TEST)" + cd tests; RUST_LOG=trace LD_LIBRARY_PATH="$$(realpath ../test-prefix/lib64/)" PKG_CONFIG_PATH="$$(realpath ../test-prefix/lib64/pkgconfig/)" ./run.sh test --test-case "$(TEST)" $(TEST_FLAGS) diff --git a/tests/run.sh b/tests/run.sh index 7e2b4f9d4..128b3e546 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,4 +1,4 @@ -#/bin/sh +#!/bin/sh # This script has to be run with the working directory being "test" # This runs the tests on the libkrun instance found by pkg-config. @@ -16,11 +16,19 @@ cargo build -p runner export KRUN_TEST_GUEST_AGENT_PATH="target/$GUEST_TARGET_ARCH/debug/guest-agent" +# Build runner args: pass through all arguments +RUNNER_ARGS="$*" + +# Add --base-dir if KRUN_TEST_BASE_DIR is set +if [ -n "${KRUN_TEST_BASE_DIR}" ]; then + RUNNER_ARGS="${RUNNER_ARGS} --base-dir ${KRUN_TEST_BASE_DIR}" +fi + if [ -z "${KRUN_NO_UNSHARE}" ] && which unshare 2>&1 >/dev/null; then - unshare --user --map-root-user --net -- /bin/sh -c "ifconfig lo 127.0.0.1 && exec target/debug/runner $*" + unshare --user --map-root-user --net -- /bin/sh -c "ifconfig lo 127.0.0.1 && exec target/debug/runner ${RUNNER_ARGS}" else echo "WARNING: Running tests without a network namespace." echo "Tests may fail if the required network ports are already in use." echo - target/debug/runner "$@" + target/debug/runner ${RUNNER_ARGS} fi diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index 449b5d50c..0956406dc 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -1,10 +1,11 @@ use anyhow::Context; use clap::Parser; use nix::sys::resource::{getrlimit, setrlimit, Resource}; +use std::env; +use std::fs; use std::panic::catch_unwind; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; -use std::{env, mem}; use tempdir::TempDir; use test_cases::{test_cases, Test, TestCase, TestSetup}; @@ -30,17 +31,17 @@ fn start_vm(test_setup: TestSetup) -> anyhow::Result<()> { Ok(()) } -fn run_single_test(test_case: &str) -> anyhow::Result { +fn run_single_test(test_case: &str, base_dir: &Path, keep_all: bool) -> anyhow::Result { let executable = env::current_exe().context("Failed to detect current executable")?; - let tmp_dir = - TempDir::new(&format!("krun-test-{test_case}")).context("Failed to create tmp dir")?; + let test_dir = base_dir.join(test_case); + fs::create_dir(&test_dir).context("Failed to create test directory")?; let child = Command::new(&executable) .arg("start-vm") .arg("--test-case") .arg(test_case) .arg("--tmp-dir") - .arg(tmp_dir.path()) + .arg(&test_dir) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -56,17 +57,30 @@ fn run_single_test(test_case: &str) -> anyhow::Result { match result { Ok(()) => { println!("[{test_case}]: OK"); + if !keep_all { + let _ = fs::remove_dir_all(&test_dir); + } Ok(true) } Err(_e) => { - println!("[{test_case}]: FAIL (dir {:?} kept)", tmp_dir.path()); - mem::forget(tmp_dir); + println!("[{test_case}]: FAIL (dir {:?} kept)", test_dir); Ok(false) } } } -fn run_tests(test_case: &str) -> anyhow::Result<()> { +fn run_tests(test_case: &str, base_dir: Option, keep_all: bool) -> anyhow::Result<()> { + // Create the base directory - either use provided path or create a temp one + let base_dir = match base_dir { + Some(path) => { + fs::create_dir_all(&path).context("Failed to create base directory")?; + path + } + None => TempDir::new("libkrun-tests") + .context("Failed to create temp base directory")? + .into_path(), + }; + let mut num_tests = 1; let mut num_ok: usize = 0; @@ -75,17 +89,22 @@ fn run_tests(test_case: &str) -> anyhow::Result<()> { num_tests = test_cases.len(); for TestCase { name, test: _ } in test_cases { - num_ok += run_single_test(name).context(name)? as usize; + num_ok += run_single_test(name, &base_dir, keep_all).context(name)? as usize; } } else { - num_ok += run_single_test(test_case).context(test_case.to_string())? as usize; + num_ok += run_single_test(test_case, &base_dir, keep_all).context(test_case.to_string())? + as usize; } let num_failures = num_tests - num_ok; if num_failures > 0 { + eprintln!("(See test artifacts at: {})", base_dir.display()); println!("\nFAIL (PASSED {num_ok}/{num_tests})"); anyhow::bail!("") } else { + if keep_all { + eprintln!("(See test artifacts at: {})", base_dir.display()); + } println!("\nOK (PASSED {num_ok}/{num_tests})"); } @@ -98,6 +117,12 @@ enum CliCommand { /// Specify which test to run or "all" #[arg(long, default_value = "all")] test_case: String, + /// Base directory for test artifacts + #[arg(long)] + base_dir: Option, + /// Keep all test artifacts even on success + #[arg(long)] + keep_all: bool, }, StartVm { #[arg(long)] @@ -111,6 +136,8 @@ impl Default for CliCommand { fn default() -> Self { Self::Test { test_case: "all".to_string(), + base_dir: None, + keep_all: false, } } } @@ -127,6 +154,10 @@ fn main() -> anyhow::Result<()> { match command { CliCommand::StartVm { test_case, tmp_dir } => start_vm(TestSetup { test_case, tmp_dir }), - CliCommand::Test { test_case } => run_tests(&test_case), + CliCommand::Test { + test_case, + base_dir, + keep_all, + } => run_tests(&test_case, base_dir, keep_all), } } From f7531390e46232c98a150dd21cff91902cd8c75a Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Fri, 28 Nov 2025 13:48:49 +0100 Subject: [PATCH 3/7] tests: Save the log of each test into a file instead of printing it Signed-off-by: Matej Hrica --- tests/runner/src/main.rs | 7 +++++-- tests/test_cases/src/lib.rs | 5 ----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index 0956406dc..51eb8dc78 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -2,7 +2,7 @@ use anyhow::Context; use clap::Parser; use nix::sys::resource::{getrlimit, setrlimit, Resource}; use std::env; -use std::fs; +use std::fs::{self, File}; use std::panic::catch_unwind; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -36,6 +36,9 @@ fn run_single_test(test_case: &str, base_dir: &Path, keep_all: bool) -> anyhow:: let test_dir = base_dir.join(test_case); fs::create_dir(&test_dir).context("Failed to create test directory")?; + let log_path = test_dir.join("log.txt"); + let log_file = File::create(&log_path).context("Failed to create log file")?; + let child = Command::new(&executable) .arg("start-vm") .arg("--test-case") @@ -44,7 +47,7 @@ fn run_single_test(test_case: &str, base_dir: &Path, keep_all: bool) -> anyhow:: .arg(&test_dir) .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .stderr(Stdio::piped()) + .stderr(log_file) .spawn() .context("Failed to start subprocess for test")?; diff --git a/tests/test_cases/src/lib.rs b/tests/test_cases/src/lib.rs index 551a89b2d..dfe5211a0 100644 --- a/tests/test_cases/src/lib.rs +++ b/tests/test_cases/src/lib.rs @@ -78,11 +78,6 @@ pub trait Test { /// Checks the output of the (host) process which started the VM fn check(self: Box, child: Child) { let output = child.wait_with_output().unwrap(); - let err = String::from_utf8(output.stderr).unwrap(); - if !err.is_empty() { - eprintln!("{}", err); - } - assert_eq!(String::from_utf8(output.stdout).unwrap(), "OK\n"); } } From e58722030060f8928c5ec42deb84d4152ac3d9db Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Thu, 27 Nov 2025 16:10:58 +0100 Subject: [PATCH 4/7] tests: Make runner output pretty, tabulated, visible when test hangs Signed-off-by: Matej Hrica --- tests/runner/src/main.rs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index 51eb8dc78..f756d473d 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -31,7 +31,12 @@ fn start_vm(test_setup: TestSetup) -> anyhow::Result<()> { Ok(()) } -fn run_single_test(test_case: &str, base_dir: &Path, keep_all: bool) -> anyhow::Result { +fn run_single_test( + test_case: &str, + base_dir: &Path, + keep_all: bool, + max_name_len: usize, +) -> anyhow::Result { let executable = env::current_exe().context("Failed to detect current executable")?; let test_dir = base_dir.join(test_case); fs::create_dir(&test_dir).context("Failed to create test directory")?; @@ -39,6 +44,12 @@ fn run_single_test(test_case: &str, base_dir: &Path, keep_all: bool) -> anyhow:: let log_path = test_dir.join("log.txt"); let log_file = File::create(&log_path).context("Failed to create log file")?; + eprint!( + "[{test_case}] {:. anyhow:: match result { Ok(()) => { - println!("[{test_case}]: OK"); + eprintln!("OK"); if !keep_all { let _ = fs::remove_dir_all(&test_dir); } Ok(true) } Err(_e) => { - println!("[{test_case}]: FAIL (dir {:?} kept)", test_dir); + eprintln!("FAIL"); Ok(false) } } @@ -88,15 +99,18 @@ fn run_tests(test_case: &str, base_dir: Option, keep_all: bool) -> anyh let mut num_ok: usize = 0; if test_case == "all" { - let test_cases = test_cases(); - num_tests = test_cases.len(); + let all_tests = test_cases(); + num_tests = all_tests.len(); + let max_name_len = all_tests.iter().map(|t| t.name.len()).max().unwrap_or(0); - for TestCase { name, test: _ } in test_cases { - num_ok += run_single_test(name, &base_dir, keep_all).context(name)? as usize; + for TestCase { name, test: _ } in all_tests { + num_ok += + run_single_test(name, &base_dir, keep_all, max_name_len).context(name)? as usize; } } else { - num_ok += run_single_test(test_case, &base_dir, keep_all).context(test_case.to_string())? - as usize; + let max_name_len = test_case.len(); + num_ok += run_single_test(test_case, &base_dir, keep_all, max_name_len) + .context(test_case.to_string())? as usize; } let num_failures = num_tests - num_ok; @@ -108,7 +122,7 @@ fn run_tests(test_case: &str, base_dir: Option, keep_all: bool) -> anyh if keep_all { eprintln!("(See test artifacts at: {})", base_dir.display()); } - println!("\nOK (PASSED {num_ok}/{num_tests})"); + eprintln!("\nOK ({num_ok}/{num_tests} passed)"); } Ok(()) From ad4b5099588b53eaf1275eca1981e59859e6bb1d Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Fri, 28 Nov 2025 14:03:43 +0100 Subject: [PATCH 5/7] tests: Add --github-summary to generate formatted markdown file Signed-off-by: Matej Hrica --- tests/runner/src/main.rs | 115 ++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 21 deletions(-) diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index f756d473d..d3d3a702a 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -3,12 +3,19 @@ use clap::Parser; use nix::sys::resource::{getrlimit, setrlimit, Resource}; use std::env; use std::fs::{self, File}; +use std::io::Write; use std::panic::catch_unwind; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use tempdir::TempDir; use test_cases::{test_cases, Test, TestCase, TestSetup}; +struct TestResult { + name: String, + passed: bool, + log_path: PathBuf, +} + fn get_test(name: &str) -> anyhow::Result> { let tests = test_cases(); tests @@ -36,7 +43,7 @@ fn run_single_test( base_dir: &Path, keep_all: bool, max_name_len: usize, -) -> anyhow::Result { +) -> anyhow::Result { let executable = env::current_exe().context("Failed to detect current executable")?; let test_dir = base_dir.join(test_case); fs::create_dir(&test_dir).context("Failed to create test directory")?; @@ -68,22 +75,76 @@ fn run_single_test( test.check(child); }); - match result { - Ok(()) => { - eprintln!("OK"); - if !keep_all { - let _ = fs::remove_dir_all(&test_dir); - } - Ok(true) - } - Err(_e) => { - eprintln!("FAIL"); - Ok(false) + let passed = result.is_ok(); + if passed { + eprintln!("OK"); + if !keep_all { + let _ = fs::remove_dir_all(&test_dir); } + } else { + eprintln!("FAIL"); + } + + Ok(TestResult { + name: test_case.to_string(), + passed, + log_path, + }) +} + +fn write_github_summary( + results: &[TestResult], + num_ok: usize, + num_tests: usize, +) -> anyhow::Result<()> { + let summary_path = env::var("GITHUB_STEP_SUMMARY") + .context("GITHUB_STEP_SUMMARY environment variable not set")?; + + let mut file = fs::OpenOptions::new() + .create(true) + .append(true) + .open(&summary_path) + .context("Failed to open GITHUB_STEP_SUMMARY")?; + + let all_passed = num_ok == num_tests; + let status = if all_passed { "✅" } else { "❌" }; + + writeln!( + file, + "## {status} Integration Tests ({num_ok}/{num_tests} passed)\n" + )?; + + for result in results { + let icon = if result.passed { "✅" } else { "❌" }; + let log_content = fs::read_to_string(&result.log_path).unwrap_or_default(); + + writeln!(file, "
")?; + writeln!(file, "{icon} {}\n", result.name)?; + writeln!(file, "```")?; + // Limit log size to avoid huge summaries (2 MiB limit) + const MAX_LOG_SIZE: usize = 2 * 1024 * 1024; + let truncated = if log_content.len() > MAX_LOG_SIZE { + format!( + "... (truncated, showing last 1 MiB) ...\n{}", + &log_content[log_content.len() - MAX_LOG_SIZE..] + ) + } else { + log_content + }; + writeln!(file, "{truncated}")?; + writeln!(file, "```")?; + writeln!(file, "
\n")?; } + + Ok(()) } -fn run_tests(test_case: &str, base_dir: Option, keep_all: bool) -> anyhow::Result<()> { +fn run_tests( + test_case: &str, + base_dir: Option, + keep_all: bool, + github_summary: bool, +) -> anyhow::Result<()> { // Create the base directory - either use provided path or create a temp one let base_dir = match base_dir { Some(path) => { @@ -95,22 +156,29 @@ fn run_tests(test_case: &str, base_dir: Option, keep_all: bool) -> anyh .into_path(), }; - let mut num_tests = 1; - let mut num_ok: usize = 0; + let mut results: Vec = Vec::new(); if test_case == "all" { let all_tests = test_cases(); - num_tests = all_tests.len(); let max_name_len = all_tests.iter().map(|t| t.name.len()).max().unwrap_or(0); for TestCase { name, test: _ } in all_tests { - num_ok += - run_single_test(name, &base_dir, keep_all, max_name_len).context(name)? as usize; + results.push(run_single_test(name, &base_dir, keep_all, max_name_len).context(name)?); } } else { let max_name_len = test_case.len(); - num_ok += run_single_test(test_case, &base_dir, keep_all, max_name_len) - .context(test_case.to_string())? as usize; + results.push( + run_single_test(test_case, &base_dir, keep_all, max_name_len) + .context(test_case.to_string())?, + ); + } + + let num_tests = results.len(); + let num_ok = results.iter().filter(|r| r.passed).count(); + + // Write GitHub Actions summary if requested + if github_summary { + write_github_summary(&results, num_ok, num_tests)?; } let num_failures = num_tests - num_ok; @@ -140,6 +208,9 @@ enum CliCommand { /// Keep all test artifacts even on success #[arg(long)] keep_all: bool, + /// Write test results to GitHub Actions job summary ($GITHUB_STEP_SUMMARY) + #[arg(long)] + github_summary: bool, }, StartVm { #[arg(long)] @@ -155,6 +226,7 @@ impl Default for CliCommand { test_case: "all".to_string(), base_dir: None, keep_all: false, + github_summary: false, } } } @@ -175,6 +247,7 @@ fn main() -> anyhow::Result<()> { test_case, base_dir, keep_all, - } => run_tests(&test_case, base_dir, keep_all), + github_summary, + } => run_tests(&test_case, base_dir, keep_all, github_summary), } } From 6da81e04ee275fe278e23f91a14ca45b593abfc9 Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Fri, 28 Nov 2025 14:05:48 +0100 Subject: [PATCH 6/7] CI: Generate test summary Markdown and upload test logs Signed-off-by: Matej Hrica --- .github/workflows/integration_tests.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index d45bc691b..0d659cf64 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -52,4 +52,14 @@ jobs: run: curl -L -o /tmp/libkrunfw-5.0.0-x86_64.tgz https://github.com/containers/libkrunfw/releases/download/v5.0.0/libkrunfw-5.0.0-x86_64.tgz && mkdir tmp && tar xf /tmp/libkrunfw-5.0.0-x86_64.tgz -C tmp && sudo mv tmp/lib64/* /lib/x86_64-linux-gnu - name: Integration tests - run: RUST_LOG=trace KRUN_ENOMEM_WORKAROUND=1 KRUN_NO_UNSHARE=1 make test + run: KRUN_ENOMEM_WORKAROUND=1 KRUN_NO_UNSHARE=1 KRUN_TEST_BASE_DIR=/tmp/libkrun-tests make test TEST_FLAGS="--keep-all --github-summary" + + - name: Upload test logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-logs + path: | + /tmp/libkrun-tests/ + !/tmp/libkrun-tests/**/guest-agent + if-no-files-found: ignore From 11b93976236ea53bdc326a4bda623604c901c302 Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Fri, 28 Nov 2025 15:09:04 +0100 Subject: [PATCH 7/7] tests: Run all test at TRACE log level Since we don't spam the stderr/terminal anymore, let's run at maximum verbosity by default. Signed-off-by: Matej Hrica --- tests/test_cases/src/test_multiport_console.rs | 2 +- tests/test_cases/src/test_tsi_tcp_guest_connect.rs | 2 +- tests/test_cases/src/test_tsi_tcp_guest_listen.rs | 2 +- tests/test_cases/src/test_vm_config.rs | 2 +- tests/test_cases/src/test_vsock_guest_connect.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_cases/src/test_multiport_console.rs b/tests/test_cases/src/test_multiport_console.rs index 71edf1581..b9c4c1fd6 100644 --- a/tests/test_cases/src/test_multiport_console.rs +++ b/tests/test_cases/src/test_multiport_console.rs @@ -50,7 +50,7 @@ mod host { impl Test for TestMultiportConsole { fn start_vm(self: Box, test_setup: TestSetup) -> anyhow::Result<()> { unsafe { - krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_WARN))?; + krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_TRACE))?; let ctx = krun_call_u32!(krun_create_ctx())?; krun_call!(krun_disable_implicit_console(ctx))?; diff --git a/tests/test_cases/src/test_tsi_tcp_guest_connect.rs b/tests/test_cases/src/test_tsi_tcp_guest_connect.rs index 9ec07a7f8..038501b37 100644 --- a/tests/test_cases/src/test_tsi_tcp_guest_connect.rs +++ b/tests/test_cases/src/test_tsi_tcp_guest_connect.rs @@ -30,7 +30,7 @@ mod host { let listener = self.tcp_tester.create_server_socket(); thread::spawn(move || self.tcp_tester.run_server(listener)); unsafe { - krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_WARN))?; + krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_TRACE))?; let ctx = krun_call_u32!(krun_create_ctx())?; krun_call!(krun_set_vm_config(ctx, 1, 512))?; setup_fs_and_enter(ctx, test_setup)?; diff --git a/tests/test_cases/src/test_tsi_tcp_guest_listen.rs b/tests/test_cases/src/test_tsi_tcp_guest_listen.rs index fa4d108bf..9838ed893 100644 --- a/tests/test_cases/src/test_tsi_tcp_guest_listen.rs +++ b/tests/test_cases/src/test_tsi_tcp_guest_listen.rs @@ -34,7 +34,7 @@ mod host { self.tcp_tester.run_client(); }); - krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_WARN))?; + krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_TRACE))?; let ctx = krun_call_u32!(krun_create_ctx())?; let port_mapping = format!("{PORT}:{PORT}"); let port_mapping = CString::new(port_mapping).unwrap(); diff --git a/tests/test_cases/src/test_vm_config.rs b/tests/test_cases/src/test_vm_config.rs index e94666bcb..9ccae5de1 100644 --- a/tests/test_cases/src/test_vm_config.rs +++ b/tests/test_cases/src/test_vm_config.rs @@ -17,7 +17,7 @@ mod host { impl Test for TestVmConfig { fn start_vm(self: Box, test_setup: TestSetup) -> anyhow::Result<()> { unsafe { - krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_WARN))?; + krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_TRACE))?; let ctx = krun_call_u32!(krun_create_ctx())?; krun_call!(krun_set_vm_config(ctx, self.num_cpus, self.ram_mib))?; setup_fs_and_enter(ctx, test_setup)?; diff --git a/tests/test_cases/src/test_vsock_guest_connect.rs b/tests/test_cases/src/test_vsock_guest_connect.rs index d1aeb4243..bb0482f29 100644 --- a/tests/test_cases/src/test_vsock_guest_connect.rs +++ b/tests/test_cases/src/test_vsock_guest_connect.rs @@ -63,7 +63,7 @@ mod host { thread::spawn(move || server(listener)); unsafe { - krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_WARN))?; + krun_call!(krun_set_log_level(KRUN_LOG_LEVEL_TRACE))?; let ctx = krun_call_u32!(krun_create_ctx())?; krun_call!(krun_add_vsock_port( ctx,