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