Skip to content

Commit ced5f36

Browse files
committed
Intruduce an E2E testing framework
Add a tests directory containing an E2E testing framework. The tests are E2E in the sense that they use the public API of libkrun to start a VM and run a test program in the guest. Note that currently this is limited that there are no userspace program or libraries (not even libc) in the guest apart from `guest-agent`, which is part of the testing framework. `guest-agent` is a statically linked Rust executable, that executes the guest part of each test. In the future this can be extended to run tests with specific images and allow the use of system libraries by the test program. Signed-off-by: Matej Hrica <[email protected]>
1 parent 9a09300 commit ced5f36

File tree

18 files changed

+825
-3
lines changed

18 files changed

+825
-3
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = [ "krun-sys","src/libkrun"]
2+
members = ["krun-sys", "src/libkrun"]
33
resolver = "2"
44

55
[profile.dev]
@@ -8,3 +8,4 @@ resolver = "2"
88
[profile.release]
99
#panic = "abort"
1010
lto = true
11+
debug = true

tests/Cargo.lock

+351
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[workspace]
2+
members = ["runner", "guest-agent", "macros", "test_cases"]
3+
resolver = "2"

tests/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# End-to-end tests
2+
The testing framework here allows you to write code to configure libkrun (using the public API) and run some specific
3+
code in the guest.

tests/guest-agent/Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "guest-agent"
3+
edition = "2021"
4+
5+
[dependencies]
6+
test_cases = { path = "../test_cases", features = ["guest"] }
7+
anyhow = "1.0.95"

0 commit comments

Comments
 (0)