1#!/usr/bin/env bash 2 3testdir=$(readlink -f $(dirname $0)) 4rootdir=$(readlink -f $testdir/../..) 5 6set -- "--iso" "--transport=tcp" "$@" 7 8source $rootdir/test/common/autotest_common.sh 9source $rootdir/test/nvmf/common.sh 10 11rpc_py=$rootdir/scripts/rpc.py 12 13HUGE_EVEN_ALLOC=yes HUGEMEM=1024 nvmftestinit 14 15function finish_test() { 16 { 17 "$rpc_py" bdev_lvol_delete_lvstore -l lvs0 18 kill -9 $rpc_proxy_pid 19 rm "$testdir/conf.json" 20 } || : 21} 22 23function tox() { 24 source /opt/stack/devstack/openrc "$(type -P tox)" "$@" 25} 26 27$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $testdir/conf.json 28 29nvmfappstart -m 0x3 -p 0 -s 1024 --json $testdir/conf.json 30 31trap 'finish_test; process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT 32 33$rpc_py bdev_nvme_set_hotplug -e 34timing_enter run_rpc_proxy 35$rootdir/scripts/rpc_http_proxy.py 127.0.0.1 3333 secret secret & 36rpc_proxy_pid=$! 37timing_exit run_rpc_proxy 38 39timing_enter configure_spdk 40$rpc_py bdev_get_bdevs 41$rpc_py bdev_lvol_delete_lvstore -l lvs0 || true 42$rpc_py bdev_lvol_create_lvstore Nvme0n1 lvs0 43$rpc_py bdev_get_bdevs 44timing_exit configure_spdk 45 46timing_enter restart_cinder 47sudo systemctl restart devstack@* 48sleep 20 49timing_exit restart_cinder 50 51rxe_cfg status 52 53# Start testing spdk with openstack using tempest (openstack tool that allow testing an openstack functionalities) 54# In this tests is checked if spdk can correctly cooperate with openstack spdk driver 55timing_enter tempest_tests 56current_dir=$(pwd) 57cd /opt/stack/tempest 58tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume 59tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_list_get_volume_attachments 60tox -e all -- tempest.api.compute.volumes.test_volume_snapshots.VolumesSnapshotsTestJSON.test_volume_snapshot_create_get_list_delete 61tox -e all -- tempest.api.compute.volumes.test_volumes_get.VolumesGetTestJSON.test_volume_create_get_delete 62tox -e all -- tempest.api.compute.volumes.test_volumes_list.VolumesTestJSON.test_volume_list 63tox -e all -- tempest.api.volume.test_versions.VersionsTest.test_list_versions 64tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend 65tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend_when_volume_has_snapshot 66tox -e all -- tempest.api.volume.test_volumes_get.VolumesSummaryTest.test_show_volume_summary 67tox -e all -- tempest.api.volume.test_volumes_list.VolumesListTestJSON.test_volume_list 68tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_delete_with_volume_in_use 69tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_get_list_update_delete 70tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_offline_delete_online 71tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot 72tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot_no_size 73tox -e all -- tempest.api.volume.test_volumes_snapshots_list.VolumesSnapshotListTestJSON.test_snapshot_list_param_limit 74cd $current_dir 75timing_exit tempest_tests 76 77timing_enter test_cleanup 78finish_test 79 80trap - SIGINT SIGTERM EXIT 81nvmftestfini 82timing_exit test_cleanup 83