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