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