autotest: vhost_filesystem_test (porting from nightly to autotest)
Add vhost-scsi and vhost-blk filesystem test cases with lvol and nvme back-end in nightly test Change-Id: Id2cccd9a45aaa995bef90415855835b93447f2e9 Signed-off-by: Chen Wang <chenx.wang@intel.com> Reviewed-on: https://review.gerrithub.io/390923 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b6aaba0852
commit
9e8415c688
@ -147,6 +147,14 @@ if [ $SPDK_TEST_VHOST -eq 1 ]; then
|
|||||||
timing_enter readonly
|
timing_enter readonly
|
||||||
run_test ./test/vhost/spdk_vhost.sh --readonly
|
run_test ./test/vhost/spdk_vhost.sh --readonly
|
||||||
timing_exit readonly
|
timing_exit readonly
|
||||||
|
|
||||||
|
timing_enter fs_integrity_scsi
|
||||||
|
run_test ./test/vhost/spdk_vhost.sh --fs-integrity-scsi
|
||||||
|
timing_exit fs_integrity_scsi
|
||||||
|
|
||||||
|
timing_enter fs_integrity_blk
|
||||||
|
run_test ./test/vhost/spdk_vhost.sh --fs-integrity-blk
|
||||||
|
timing_exit fs_integrity_blk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
timing_enter integrity_lvol_scsi
|
timing_enter integrity_lvol_scsi
|
||||||
|
@ -77,6 +77,16 @@ function cleanup_virsh() {
|
|||||||
rm $VM_BAK_IMG || true
|
rm $VM_BAK_IMG || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cleanup_lvol() {
|
||||||
|
echo "INFO: Removing lvol bdevs"
|
||||||
|
$rpc_py delete_bdev $lb_name
|
||||||
|
echo -e "\tINFO: lvol bdev $lb_name removed"
|
||||||
|
|
||||||
|
echo "INFO: Removing lvol stores"
|
||||||
|
$rpc_py destroy_lvol_store -u $lvol_store
|
||||||
|
echo -e "\tINFO: lvol stote $lvol_store removed"
|
||||||
|
}
|
||||||
|
|
||||||
timing_enter integrity_test
|
timing_enter integrity_test
|
||||||
|
|
||||||
# Backing image for VM
|
# Backing image for VM
|
||||||
@ -112,12 +122,20 @@ $rootdir/app/vhost/vhost -c $basedir/vhost.conf &
|
|||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
waitforlisten "$pid"
|
waitforlisten "$pid"
|
||||||
|
|
||||||
|
lvol_store=$($rpc_py construct_lvol_store Nvme0n1 lvs_0)
|
||||||
|
free_mb=$(get_lvs_free_mb "$lvol_store")
|
||||||
|
lb_name=$($rpc_py construct_lvol_bdev -u $lvol_store lbd_0 $free_mb)
|
||||||
|
|
||||||
if [[ "$VHOST_MODE" == "scsi" ]]; then
|
if [[ "$VHOST_MODE" == "scsi" ]]; then
|
||||||
$rpc_py construct_vhost_scsi_controller naa.0
|
$rpc_py construct_vhost_scsi_controller naa.0
|
||||||
$rpc_py add_vhost_scsi_lun naa.0 0 Nvme0n1
|
$rpc_py add_vhost_scsi_lun naa.0 0 $lb_name
|
||||||
else
|
else
|
||||||
$rpc_py construct_vhost_blk_controller naa.0 Nvme0n1
|
$rpc_py construct_vhost_blk_controller naa.0 $lb_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
trap "cleanup_lvol; cleanup_virsh; killprocess $pid; exit 1" SIGINT SIGTERM EXIT ERR
|
||||||
|
|
||||||
chmod 777 /tmp/naa.0
|
chmod 777 /tmp/naa.0
|
||||||
|
|
||||||
virsh create $basedir/vm_conf.xml
|
virsh create $basedir/vm_conf.xml
|
||||||
@ -143,6 +161,9 @@ rm $basedir/vm_conf.xml || true
|
|||||||
rm $basedir/vnet_conf.xml || true
|
rm $basedir/vnet_conf.xml || true
|
||||||
rm $basedir/vhost.conf || true
|
rm $basedir/vhost.conf || true
|
||||||
|
|
||||||
|
# Delete lvol bdev, destroy lvol store
|
||||||
|
cleanup_lvol
|
||||||
|
|
||||||
# Try to gracefully stop spdk vhost
|
# Try to gracefully stop spdk vhost
|
||||||
if /bin/kill -INT $pid; then
|
if /bin/kill -INT $pid; then
|
||||||
while /bin/kill -0 $pid; do
|
while /bin/kill -0 $pid; do
|
||||||
|
@ -16,56 +16,51 @@ else script=$blk_script;
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
trap "exit 1" SIGINT SIGTERM EXIT
|
trap "exit 1" SIGINT SIGTERM EXIT
|
||||||
for dev in $devs; do
|
|
||||||
mkfs_cmd="mkfs.$fs"
|
|
||||||
parted_cmd="parted -s /dev/${dev}"
|
|
||||||
if [ "ntfs" == $fs ]; then
|
|
||||||
mkfs_cmd+=" -f -F"
|
|
||||||
elif [ "btrfs" == $fs ]; then
|
|
||||||
mkfs_cmd+=" -f"
|
|
||||||
elif [ "fat" == $fs ]; then
|
|
||||||
mkfs_cmd+=" -I"
|
|
||||||
else
|
|
||||||
mkfs_cmd+=" -F"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "INFO: Creating partition table on disk using: $parted_cmd mklabel gpt"
|
for fs in $fs; do
|
||||||
$parted_cmd mklabel gpt
|
for dev in $devs; do
|
||||||
$parted_cmd mkpart primary 2048s 100%
|
mkfs_cmd="mkfs.$fs"
|
||||||
sleep 2
|
parted_cmd="parted -s /dev/${dev}"
|
||||||
|
|
||||||
mkfs_cmd+=" /dev/${dev}1"
|
echo "INFO: Creating partition table on disk using: $parted_cmd mklabel gpt"
|
||||||
echo "INFO: Creating filesystem using: $mkfs_cmd"
|
$parted_cmd mklabel gpt
|
||||||
$mkfs_cmd
|
$parted_cmd mkpart primary 2048s 100%
|
||||||
|
sleep 2
|
||||||
|
|
||||||
mkdir -p /mnt/${dev}dir
|
mkfs_cmd+=" /dev/${dev}1"
|
||||||
mount -o sync /dev/${dev}1 /mnt/${dev}dir
|
echo "INFO: Creating filesystem using: $mkfs_cmd"
|
||||||
mkdir -p /mnt/${dev}dir/linux-src
|
wipefs -a /dev/${dev}1
|
||||||
tar xf $basedir/linux-src.tar.gz -C /mnt/${dev}dir/linux-src --strip-components=1
|
$mkfs_cmd
|
||||||
sleep 2
|
|
||||||
|
|
||||||
# Now build SPDK
|
mkdir -p /mnt/${dev}dir
|
||||||
$MAKE -C /mnt/${dev}dir/linux-src defconfig
|
mount -o sync /dev/${dev}1 /mnt/${dev}dir
|
||||||
$MAKE -C /mnt/${dev}dir/linux-src
|
mkdir -p /mnt/${dev}dir/linux-src
|
||||||
# Print out space consumed on target device
|
tar xf $basedir/linux-src.tar.gz -C /mnt/${dev}dir/linux-src --strip-components=1
|
||||||
df -h /dev/$dev
|
sleep 2
|
||||||
rm -rf /mnt/${dev}dir/linux-src
|
|
||||||
done
|
|
||||||
|
|
||||||
for dev in $devs; do
|
# Now build SPDK
|
||||||
umount /mnt/${dev}dir
|
$MAKE -C /mnt/${dev}dir/linux-src defconfig
|
||||||
rm -rf /mnt/${dev}dir
|
$MAKE -C /mnt/${dev}dir/linux-src
|
||||||
|
# Print out space consumed on target device
|
||||||
|
df -h /dev/$dev
|
||||||
|
rm -rf /mnt/${dev}dir/linux-src
|
||||||
|
done
|
||||||
|
|
||||||
stats=( $(cat /sys/block/$dev/stat) )
|
for dev in $devs; do
|
||||||
echo ""
|
umount /mnt/${dev}dir
|
||||||
echo "$dev stats"
|
rm -rf /mnt/${dev}dir
|
||||||
printf "READ IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \
|
|
||||||
${stats[0]} ${stats[1]} ${stats[2]} ${stats[3]}
|
stats=( $(cat /sys/block/$dev/stat) )
|
||||||
printf "WRITE IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \
|
echo ""
|
||||||
${stats[4]} ${stats[5]} ${stats[6]} ${stats[7]}
|
echo "$dev stats"
|
||||||
printf "in flight: % 8u io ticks: % 8u time in queue: % 8u\n" \
|
printf "READ IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \
|
||||||
${stats[8]} ${stats[9]} ${stats[10]}
|
${stats[0]} ${stats[1]} ${stats[2]} ${stats[3]}
|
||||||
echo ""
|
printf "WRITE IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \
|
||||||
|
${stats[4]} ${stats[5]} ${stats[6]} ${stats[7]}
|
||||||
|
printf "in flight: % 8u io ticks: % 8u time in queue: % 8u\n" \
|
||||||
|
${stats[8]} ${stats[9]} ${stats[10]}
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
@ -86,11 +86,11 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-fs|--fs-integrity-scsi)
|
-fs|--fs-integrity-scsi)
|
||||||
echo 'Running filesystem integrity suite...'
|
echo 'Running filesystem integrity suite...'
|
||||||
./integrity/integrity_start.sh -i $VM_IMAGE -m scsi -f ntfs
|
./integrity/integrity_start.sh -i $VM_IMAGE -m scsi -f "xfs ntfs btrfs ext4"
|
||||||
;;
|
;;
|
||||||
-fb|--fs-integrity-blk)
|
-fb|--fs-integrity-blk)
|
||||||
echo 'Running filesystem integrity suite...'
|
echo 'Running filesystem integrity suite...'
|
||||||
./integrity/integrity_start.sh -i $VM_IMAGE -m blk -f ntfs
|
./integrity/integrity_start.sh -i $VM_IMAGE -m blk -f "xfs ntfs btrfs ext4"
|
||||||
;;
|
;;
|
||||||
-ils|--integrity-lvol-scsi)
|
-ils|--integrity-lvol-scsi)
|
||||||
echo 'Running lvol integrity suite...'
|
echo 'Running lvol integrity suite...'
|
||||||
|
Loading…
Reference in New Issue
Block a user