mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: use the new vhost-user-blk backend for integration tests
Use the new vhost-user-blk backend for the integration tests, eliminating the need for building vubd using the implementation in QEMU. Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
committed by
Rob Bradford
parent
ceafd4cee7
commit
c3eaa41b77
@@ -88,16 +88,14 @@ if [ ! -f "$VMLINUX_IMAGE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
VIRTIOFSD="$WORKLOADS_DIR/virtiofsd"
|
VIRTIOFSD="$WORKLOADS_DIR/virtiofsd"
|
||||||
VUBD="$WORKLOADS_DIR/vubd"
|
|
||||||
QEMU_DIR="qemu_build"
|
QEMU_DIR="qemu_build"
|
||||||
if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBD" ]; then
|
if [ ! -f "$VIRTIOFSD" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
git clone --depth 1 "https://github.com/sboeuf/qemu.git" -b "virtio-fs" $QEMU_DIR
|
git clone --depth 1 "https://github.com/sboeuf/qemu.git" -b "virtio-fs" $QEMU_DIR
|
||||||
pushd $QEMU_DIR
|
pushd $QEMU_DIR
|
||||||
./configure --prefix=$PWD --target-list=x86_64-softmmu
|
./configure --prefix=$PWD --target-list=x86_64-softmmu
|
||||||
make virtiofsd vhost-user-blk -j `nproc`
|
make virtiofsd -j `nproc`
|
||||||
cp virtiofsd $VIRTIOFSD
|
cp virtiofsd $VIRTIOFSD
|
||||||
cp vhost-user-blk $VUBD
|
|
||||||
popd
|
popd
|
||||||
rm -rf $QEMU_DIR
|
rm -rf $QEMU_DIR
|
||||||
sudo setcap cap_dac_override,cap_sys_admin+epi "virtiofsd"
|
sudo setcap cap_dac_override,cap_sys_admin+epi "virtiofsd"
|
||||||
|
|||||||
12
src/main.rs
12
src/main.rs
@@ -709,10 +709,6 @@ mod tests {
|
|||||||
let mut workload_path = dirs::home_dir().unwrap();
|
let mut workload_path = dirs::home_dir().unwrap();
|
||||||
workload_path.push("workloads");
|
workload_path.push("workloads");
|
||||||
|
|
||||||
let mut vubd_path = workload_path.clone();
|
|
||||||
vubd_path.push("vubd");
|
|
||||||
let vubd_path = String::from(vubd_path.to_str().unwrap());
|
|
||||||
|
|
||||||
let mut blk_file_path = workload_path.clone();
|
let mut blk_file_path = workload_path.clone();
|
||||||
blk_file_path.push(blk_img);
|
blk_file_path.push(blk_img);
|
||||||
let blk_file_path = String::from(blk_file_path.to_str().unwrap());
|
let blk_file_path = String::from(blk_file_path.to_str().unwrap());
|
||||||
@@ -720,9 +716,11 @@ mod tests {
|
|||||||
let vubd_socket_path = String::from(tmp_dir.path().join("vub.sock").to_str().unwrap());
|
let vubd_socket_path = String::from(tmp_dir.path().join("vub.sock").to_str().unwrap());
|
||||||
|
|
||||||
// Start the daemon
|
// Start the daemon
|
||||||
let child = Command::new(vubd_path.as_str())
|
let child = Command::new("target/release/vhost_user_blk")
|
||||||
.args(&["-b", blk_file_path.as_str()])
|
.args(&[
|
||||||
.args(&["-s", vubd_socket_path.as_str()])
|
"--backend",
|
||||||
|
format!("image={},sock={}", blk_file_path, vubd_socket_path).as_str(),
|
||||||
|
])
|
||||||
.spawn()
|
.spawn()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user