diff --git a/scripts/run_integration_tests_aarch64.sh b/scripts/run_integration_tests_aarch64.sh index b81462cbd..79e62b3ea 100755 --- a/scripts/run_integration_tests_aarch64.sh +++ b/scripts/run_integration_tests_aarch64.sh @@ -142,6 +142,19 @@ update_workloads() { popd fi + VIRTIOFSD_RS="$WORKLOADS_DIR/virtiofsd-rs" + VIRTIOFSD_RS_DIR="virtiofsd_rs_build" + if [ ! -f "$VIRTIOFSD_RS" ]; then + pushd $WORKLOADS_DIR + git clone --depth 1 "https://gitlab.com/virtio-fs/virtiofsd-rs.git" $VIRTIOFSD_RS_DIR + pushd $VIRTIOFSD_RS_DIR + time cargo build --release + cp target/release/virtiofsd-rs $VIRTIOFSD_RS || exit 1 + popd + rm -rf $VIRTIOFSD_RS_DIR + popd + fi + BLK_IMAGE="$WORKLOADS_DIR/blk.img" MNT_DIR="mount_image" if [ ! -f "$BLK_IMAGE" ]; then diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index e046fd115..3f7ae4525 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -137,6 +137,20 @@ if [ ! -f "$VIRTIOFSD" ]; then popd fi +VIRTIOFSD_RS="$WORKLOADS_DIR/virtiofsd-rs" +VIRTIOFSD_RS_DIR="virtiofsd_rs_build" +if [ ! -f "$VIRTIOFSD_RS" ]; then + pushd $WORKLOADS_DIR + git clone --depth 1 "https://gitlab.com/virtio-fs/virtiofsd-rs.git" $VIRTIOFSD_RS_DIR + pushd $VIRTIOFSD_RS_DIR + time cargo build --release + cp target/release/virtiofsd-rs $VIRTIOFSD_RS || exit 1 + popd + rm -rf $VIRTIOFSD_RS_DIR + popd +fi + + BLK_IMAGE="$WORKLOADS_DIR/blk.img" MNT_DIR="mount_image" if [ ! -f "$BLK_IMAGE" ]; then diff --git a/tests/integration.rs b/tests/integration.rs index 890d36292..399764f8c 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -349,16 +349,23 @@ mod tests { (child, virtiofsd_socket_path) } - fn prepare_vhost_user_fs_daemon( + fn prepare_virtofsd_rs_daemon( tmp_dir: &TempDir, shared_dir: &str, _cache: &str, ) -> (std::process::Child, String) { + let mut workload_path = dirs::home_dir().unwrap(); + workload_path.push("workloads"); + + let mut virtiofsd_path = workload_path; + virtiofsd_path.push("virtiofsd-rs"); + let virtiofsd_path = String::from(virtiofsd_path.to_str().unwrap()); + let virtiofsd_socket_path = String::from(tmp_dir.path().join("virtiofs.sock").to_str().unwrap()); // Start the daemon - let child = Command::new(clh_command("vhost_user_fs")) + let child = Command::new(virtiofsd_path.as_str()) .args(&["--shared-dir", shared_dir]) .args(&["--socket", virtiofsd_socket_path.as_str()]) .spawn() @@ -3080,24 +3087,24 @@ mod tests { } #[test] - fn test_virtio_fs_dax_on_default_cache_size_w_vhost_user_fs_daemon() { - test_virtio_fs(true, None, "none", &prepare_vhost_user_fs_daemon, false) + fn test_virtio_fs_dax_on_default_cache_size_w_virtiofsd_rs_daemon() { + test_virtio_fs(true, None, "none", &prepare_virtofsd_rs_daemon, false) } #[test] - fn test_virtio_fs_dax_on_cache_size_1_gib_w_vhost_user_fs_daemon() { + fn test_virtio_fs_dax_on_cache_size_1_gib_w_virtiofsd_rs_daemon() { test_virtio_fs( true, Some(0x4000_0000), "none", - &prepare_vhost_user_fs_daemon, + &prepare_virtofsd_rs_daemon, false, ) } #[test] - fn test_virtio_fs_dax_off_w_vhost_user_fs_daemon() { - test_virtio_fs(false, None, "none", &prepare_vhost_user_fs_daemon, false) + fn test_virtio_fs_dax_off_w_virtiofsd_rs_daemon() { + test_virtio_fs(false, None, "none", &prepare_virtofsd_rs_daemon, false) } #[test] @@ -3114,14 +3121,14 @@ mod tests { #[test] #[cfg(target_arch = "x86_64")] - fn test_virtio_fs_hotplug_dax_on_w_vhost_user_fs_daemon() { - test_virtio_fs(true, None, "none", &prepare_vhost_user_fs_daemon, true) + fn test_virtio_fs_hotplug_dax_on_w_virtiofsd_rs_daemon() { + test_virtio_fs(true, None, "none", &prepare_virtofsd_rs_daemon, true) } #[test] #[cfg(target_arch = "x86_64")] - fn test_virtio_fs_hotplug_dax_off_w_vhost_user_fs_daemon() { - test_virtio_fs(false, None, "none", &prepare_vhost_user_fs_daemon, true) + fn test_virtio_fs_hotplug_dax_off_w_virtiofsd_rs_daemon() { + test_virtio_fs(false, None, "none", &prepare_virtofsd_rs_daemon, true) } #[test]