mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: add test case for vhost-user-blk
Currently we need use backend device from Qemu to test vhost-user-blk device. Once the rust backend is ready, we will replace it. Signed-off-by: Yang Zhong <yang.zhong@intel.com>
This commit is contained in:
@@ -79,21 +79,30 @@ fi
|
||||
|
||||
VIRTIOFSD="$WORKLOADS_DIR/virtiofsd"
|
||||
VUBRIDGE="$WORKLOADS_DIR/vubridge"
|
||||
VUBD="$WORKLOADS_DIR/vubd"
|
||||
QEMU_DIR="qemu_build"
|
||||
if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBRIDGE" ]; then
|
||||
if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBRIDGE" ] || [ ! -f "$VUBD" ]; then
|
||||
pushd $WORKLOADS_DIR
|
||||
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 -j `nproc`
|
||||
make virtiofsd tests/vhost-user-bridge vhost-user-blk -j `nproc`
|
||||
cp virtiofsd $VIRTIOFSD
|
||||
cp tests/vhost-user-bridge $VUBRIDGE
|
||||
cp vhost-user-blk $VUBD
|
||||
popd
|
||||
rm -rf $QEMU_DIR
|
||||
sudo setcap cap_dac_override,cap_sys_admin+epi "virtiofsd"
|
||||
popd
|
||||
fi
|
||||
|
||||
BLKFILE="$WORKLOADS_DIR/blk"
|
||||
if [ ! -f "$BLKFILE" ]; then
|
||||
pushd $WORKLOADS_DIR
|
||||
dd if=/dev/zero of=$BLKFILE bs=1M count=64
|
||||
popd
|
||||
fi
|
||||
|
||||
SHARED_DIR="$WORKLOADS_DIR/shared_dir"
|
||||
if [ ! -d "$SHARED_DIR" ]; then
|
||||
mkdir -p $SHARED_DIR
|
||||
|
||||
Reference in New Issue
Block a user