From 25fb8de082f74e3b3dc8fcbdcbba5ea37ca40756 Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Fri, 23 Sep 2022 09:50:25 +0200 Subject: [PATCH] test/sma: add test for multiple bus support for NVMe/vfio_user plugin Add test to cover issue where device couldn't be found on non-first attached bus. Signed-off-by: Artsiom Koltun Change-Id: Ie876596c56a08a6f9b5c8b2283dfd6399fd8fffd Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14652 Reviewed-by: Konrad Sztyber Reviewed-by: Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins --- test/sma/vfiouser_qemu.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/sma/vfiouser_qemu.sh b/test/sma/vfiouser_qemu.sh index 4449966eb..372352e8a 100755 --- a/test/sma/vfiouser_qemu.sh +++ b/test/sma/vfiouser_qemu.sh @@ -113,7 +113,9 @@ mkdir -p "${VFO_ROOT_PATH}" used_vms=$vm_no vm_kill_all -vm_setup --os="$VM_IMAGE" --disk-type=virtio --force=$vm_no --qemu-args="-qmp tcp:localhost:10005,server,nowait -device pci-bridge,chassis_nr=1,id=pci.spdk.0" +vm_setup --os="$VM_IMAGE" --disk-type=virtio --force=$vm_no --qemu-args="-qmp tcp:localhost:10005,server,nowait \ +-device pci-bridge,chassis_nr=1,id=pci.spdk.0 \ +-device pci-bridge,chassis_nr=2,id=pci.spdk.1" # Run pre-configured VM and wait for them to start vm_run $vm_no @@ -137,6 +139,8 @@ $rootdir/scripts/sma.py -c <( buses: - name: 'pci.spdk.0' count: 32 + - name: 'pci.spdk.1' + count: 32 qmp_addr: 127.0.0.1 qmp_port: 10005 crypto: @@ -262,6 +266,14 @@ detach_volume "$device1" "$uuid0" delete_device "$device0" delete_device "$device1" +# Create device with allocation on second bus +device3=$(create_device 42 0 | jq -r '.handle') +vm_check_subsys_nqn $vm_no nqn.2016-06.io.spdk:vfiouser-42 + +# Verify that device can be found on second bus and properly deleted +delete_device "$device3" +NOT vm_check_subsys_nqn $vm_no nqn.2016-06.io.spdk:vfiouser-42 + key0=1234567890abcdef1234567890abcdef device0=$(create_device 0 0 | jq -r '.handle') uuid0=$(rpc_cmd bdev_get_bdevs -b null0 | jq -r '.[].uuid')