diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index 61da7d7e3..0ed84d9e3 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -172,6 +172,7 @@ sudo setcap cap_net_admin+ep target/release/vhost_user_net # We always copy a fresh version of our binary for our L2 guest. cp target/release/cloud-hypervisor $VFIO_DIR +cp target/release/ch-remote $VFIO_DIR # Enable KSM with some reasonable parameters so that it won't take too long # for the memory to be merged between two processes. diff --git a/tests/integration.rs b/tests/integration.rs index 8338bd399..83e573221 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2407,13 +2407,11 @@ mod tests { guest .ssh_command_l1("echo 1af4 1041 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id")?; guest.ssh_command_l1( - "sudo curl \ - --unix-socket /tmp/ch_api.sock \ - -i \ - -X PUT http://localhost/api/v1/vm.add-device \ - -H 'Accept: application/json' -H 'Content-Type: application/json' \ - -d '{\"path\":\"/sys/bus/pci/devices/0000:00:07.0\",\"id\":\"vfio123\"}'", + "sudo /mnt/ch-remote \ + --api-socket=/tmp/ch_api.sock \ + add-device path=/sys/bus/pci/devices/0000:00:07.0,id=vfio123", )?; + thread::sleep(std::time::Duration::new(10, 0)); // Let's also verify from the third virtio-net device passed to @@ -2448,12 +2446,9 @@ mod tests { // device through the "remove-device" command responsible for // unplugging VFIO devices. guest.ssh_command_l1( - "sudo curl \ - --unix-socket /tmp/ch_api.sock \ - -i \ - -X PUT http://localhost/api/v1/vm.remove-device \ - -H 'Accept: application/json' -H 'Content-Type: application/json' \ - -d '{\"id\":\"vfio123\"}'", + "sudo /mnt/ch-remote \ + --api-socket=/tmp/ch_api.sock \ + remove-device vfio123", )?; thread::sleep(std::time::Duration::new(10, 0));