xref: /spdk/test/openstack/run_openstack_tests.sh (revision d73077b84a71985da1db1c9847ea7c042189bae2)
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	{
14		"$rpc_py" bdev_lvol_delete_lvstore -l lvs0
15		kill -9 $rpc_proxy_pid
16		rm "$testdir/conf.json"
17	} || :
18}
19
20$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $testdir/conf.json
21
22nvmfappstart -m 0x3 -p 0 -s 1024 --json $testdir/conf.json
23
24trap 'finish_test; process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
25
26$rpc_py bdev_nvme_set_hotplug -e
27timing_enter run_rpc_proxy
28$rootdir/scripts/rpc_http_proxy.py 127.0.0.1 3333 secret secret &
29rpc_proxy_pid=$!
30timing_exit run_rpc_proxy
31
32timing_enter configure_spdk
33$rpc_py bdev_get_bdevs
34$rpc_py bdev_lvol_delete_lvstore -l lvs0 || true
35$rpc_py bdev_lvol_create_lvstore Nvme0n1 lvs0
36$rpc_py bdev_get_bdevs
37timing_exit configure_spdk
38
39timing_enter restart_cinder
40sudo systemctl restart devstack@c-*
41sleep 10
42timing_exit restart_cinder
43
44# Start testing spdk with openstack using tempest (openstack tool that allow testing an openstack functionalities)
45# In this tests is checked if spdk can correctly cooperate with openstack spdk driver
46timing_enter tempest_tests
47current_dir=$(pwd)
48cd /opt/stack/tempest
49tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume
50tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_list_get_volume_attachments
51tox -e all -- tempest.api.compute.volumes.test_volume_snapshots.VolumesSnapshotsTestJSON.test_volume_snapshot_create_get_list_delete
52tox -e all -- tempest.api.compute.volumes.test_volumes_get.VolumesGetTestJSON.test_volume_create_get_delete
53tox -e all -- tempest.api.compute.volumes.test_volumes_list.VolumesTestJSON.test_volume_list
54tox -e all -- tempest.api.volume.test_versions.VersionsTest.test_list_versions
55tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend
56tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend_when_volume_has_snapshot
57tox -e all -- tempest.api.volume.test_volumes_get.VolumesSummaryTest.test_show_volume_summary
58tox -e all -- tempest.api.volume.test_volumes_list.VolumesListTestJSON.test_volume_list
59tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_delete_with_volume_in_use
60tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_get_list_update_delete
61tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_offline_delete_online
62tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot
63tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot_no_size
64tox -e all -- tempest.api.volume.test_volumes_snapshots_list.VolumesSnapshotListTestJSON.test_snapshot_list_param_limit
65cd $current_dir
66timing_exit tempest_tests
67
68timing_enter test_cleanup
69finish_test
70
71trap - SIGINT SIGTERM EXIT
72nvmftestfini
73timing_exit test_cleanup
74