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:
Yang Zhong
2019-09-18 10:47:33 +08:00
committed by Samuel Ortiz
parent 360980d93c
commit 6b06cec611
2 changed files with 102 additions and 3 deletions

View File

@@ -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