crosvm: Fix running plugins integration tests

BUG=none
TEST=run plugins tests

Change-Id: I791249c611ff2e5b7a345981a5a7ebe957cef3d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3515212
Reviewed-by: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Anton Romanov 2022-03-10 00:00:43 +00:00 committed by Commit Bot
parent 5586ff508c
commit fb1df15477
2 changed files with 5 additions and 1 deletions

View file

@ -62,11 +62,11 @@ fn build_plugin(src: &str) -> RemovePath {
.arg(&out_bin)
.arg("-L") // Path of shared object to link to.
.arg(&libcrosvm_plugin_dir)
.arg("-lcrosvm_plugin")
.arg("-Wl,-rpath") // Search for shared object in the same path when exec'd.
.arg(&libcrosvm_plugin_dir)
.args(&["-Wl,-rpath", "."]) // Also check current directory in case of sandboxing.
.args(&["-xc", "-"]) // Read source code from piped stdin.
.arg("-lcrosvm_plugin")
.stdin(Stdio::piped())
.spawn()
.expect("failed to spawn compiler");
@ -262,6 +262,8 @@ fn test_supported_cpuid() {
test_plugin(include_str!("plugin_supported_cpuid.c"));
}
// b:223675792
#[ignore]
#[test]
fn test_enable_cap() {
test_plugin(include_str!("plugin_enable_cap.c"));

View file

@ -55,6 +55,8 @@ DOCKER_ARGS = [
"--device /dev/vhost-vsock",
# Use tmpfs in the container for faster performance.
"--mount type=tmpfs,destination=/tmp",
# For plugin process jail
"--mount type=tmpfs,destination=/var/empty",
f"gcr.io/crosvm-packages/crosvm_dev:{IMAGE_VERSION}",
]