diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index d4a3dc447..bae2caf3c 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -78,7 +78,6 @@ if [ ! -f "$VMLINUX_IMAGE" ]; then fi VIRTIOFSD="$WORKLOADS_DIR/virtiofsd" -VUBRIDGE="$WORKLOADS_DIR/vubridge" VUBD="$WORKLOADS_DIR/vubd" QEMU_DIR="qemu_build" if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBRIDGE" ] || [ ! -f "$VUBD" ]; then @@ -86,9 +85,8 @@ if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBRIDGE" ] || [ ! -f "$VUBD" ]; then git clone --depth 1 "https://github.com/sboeuf/qemu.git" -b "virtio-fs" $QEMU_DIR pushd $QEMU_DIR ./configure --prefix=$PWD --target-list=x86_64-softmmu - make virtiofsd tests/vhost-user-bridge vhost-user-blk -j `nproc` + make virtiofsd vhost-user-blk -j `nproc` cp virtiofsd $VIRTIOFSD - cp tests/vhost-user-bridge $VUBRIDGE cp vhost-user-blk $VUBD popd rm -rf $QEMU_DIR @@ -141,6 +139,7 @@ sudo ip link set vfio-tap1 up cargo build sudo setcap cap_net_admin+ep target/debug/cloud-hypervisor +sudo setcap cap_net_admin+ep target/debug/vhost_user_net # We always copy a fresh version of our binary for our L2 guest. cp target/debug/cloud-hypervisor $VFIO_DIR diff --git a/src/main.rs b/src/main.rs index 1a375f232..7d5a187a3 100755 --- a/src/main.rs +++ b/src/main.rs @@ -1237,15 +1237,18 @@ mod tests { let mut clear = ClearDiskConfig::new(); let guest = Guest::new(&mut clear); - let mut workload_path = dirs::home_dir().unwrap(); - workload_path.push("workloads"); - - let mut vubridge_path = workload_path.clone(); - vubridge_path.push("vubridge"); - let vubridge_path = String::from(vubridge_path.to_str().unwrap()); - // Start the daemon - let mut daemon_child = Command::new(vubridge_path.as_str()).spawn().unwrap(); + let mut daemon_child = Command::new("target/debug/vhost_user_net") + .args(&[ + "--backend", + format!( + "ip={},mask=255.255.255.0,sock=/tmp/vunet.sock", + guest.network.host_ip + ) + .as_str(), + ]) + .spawn() + .unwrap(); let mut cloud_child = Command::new("target/debug/cloud-hypervisor") .args(&["--cpus", "1"]) @@ -1266,13 +1269,17 @@ mod tests { ]) .args(&[ "--vhost-user-net", - "mac=52:54:00:02:d9:01,sock=/tmp/vubr.sock", + format!("mac={},sock=/tmp/vunet.sock", guest.network.guest_mac).as_str(), ]) - .args(&["--net", guest.default_net_string().as_str()]) .spawn() .unwrap(); - // 2 network interfaces + default localhost ==> 3 interfaces + // 1 network interface + default localhost ==> 2 interfaces + // It's important to note that this test is fully exercising the + // vhost-user-net implementation and the associated backend since + // it does not define any --net network interface. That means all + // the ssh communication in that test happens through the network + // interface backed by vhost-user-net. aver_eq!( tb, guest @@ -1281,7 +1288,7 @@ mod tests { .trim() .parse::() .unwrap_or_default(), - 3 + 2 ); guest.ssh_command("sudo shutdown -h now")?;