ci: Extend vhost-user-blk test to validate the content

This commit extends the existing integration test related to
vhost-user-blk by validating the block image contains one file
"foo" containing "bar".

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-09-18 13:23:02 -07:00
committed by Samuel Ortiz
parent 6b06cec611
commit 0a229ef4f5
2 changed files with 32 additions and 6 deletions

View File

@@ -96,10 +96,17 @@ if [ ! -f "$VIRTIOFSD" ] || [ ! -f "$VUBRIDGE" ] || [ ! -f "$VUBD" ]; then
popd
fi
BLKFILE="$WORKLOADS_DIR/blk"
if [ ! -f "$BLKFILE" ]; then
BLK_IMAGE="$WORKLOADS_DIR/blk.img"
MNT_DIR="mount_image"
if [ ! -f "$BLK_IMAGE" ]; then
pushd $WORKLOADS_DIR
dd if=/dev/zero of=$BLKFILE bs=1M count=64
fallocate -l 16M $BLK_IMAGE
mkfs.ext4 -j $BLK_IMAGE
mkdir $MNT_DIR
sudo mount -t ext4 $BLK_IMAGE $MNT_DIR
sudo bash -c "echo bar > $MNT_DIR/foo"
sudo umount $BLK_IMAGE
rm -r $MNT_DIR
popd
fi