summaryrefslogtreecommitdiffstats
path: root/src/spdk/test/openstack
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/test/openstack
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/test/openstack')
-rwxr-xr-xsrc/spdk/test/openstack/install_devstack.sh51
-rwxr-xr-xsrc/spdk/test/openstack/run_openstack_tests.sh77
2 files changed, 128 insertions, 0 deletions
diff --git a/src/spdk/test/openstack/install_devstack.sh b/src/spdk/test/openstack/install_devstack.sh
new file mode 100755
index 000000000..cb9c9acf8
--- /dev/null
+++ b/src/spdk/test/openstack/install_devstack.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+testdir=$(readlink -f $(dirname $0))
+rootdir=$(readlink -f $testdir/../..)
+
+function usage() {
+ [[ -n $2 ]] && (
+ echo "$2"
+ echo ""
+ )
+ echo "Devstack installation script"
+ echo "Usage: $(basename $1) [OPTIONS]"
+ echo "--branch=BRANCH Define which version of openstack"
+ echo " should be installed. Default is master."
+ echo "-h, --help Print help and exit"
+
+ exit 0
+}
+
+branch="master"
+while getopts 'h-:' optchar; do
+ case "$optchar" in
+ -)
+ case "$OPTARG" in
+ help) usage $0 ;;
+ branch=*) branch="${OPTARG#*=}" ;;
+ esac
+ ;;
+ h) usage $0 ;;
+ *) usage $0 "Invalid argument '$OPTARG'" ;;
+ esac
+done
+
+cd /opt/stack/devstack
+su -c "./unstack.sh" -s /bin/bash stack
+
+cd /opt/stack
+rm -rf cinder devstack glance keystone heat horizon neutron nova placement requirements tacker tacker-horizon tempest
+
+if [[ $branch == "master" ]]; then
+ su -c "git clone https://opendev.org/openstack-dev/devstack" -s /bin/bash stack
+else
+ su -c "git clone https://opendev.org/openstack-dev/devstack -b stable/$branch" -s /bin/bash stack
+fi
+cp $rootdir/scripts/vagrant/local.conf /opt/stack/devstack/local.conf
+
+cd /opt/stack/devstack
+sudo sed -i "s|http://download.cirros-cloud.net|https://download.cirros-cloud.net|g" stackrc
+su -c "./stack.sh" -s /bin/bash stack
+source openrc admin admin
+openstack volume type create SPDK --public
diff --git a/src/spdk/test/openstack/run_openstack_tests.sh b/src/spdk/test/openstack/run_openstack_tests.sh
new file mode 100755
index 000000000..3bbd57d29
--- /dev/null
+++ b/src/spdk/test/openstack/run_openstack_tests.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+
+testdir=$(readlink -f $(dirname $0))
+rootdir=$(readlink -f $testdir/../..)
+rpc_py=$rootdir/scripts/rpc.py
+source $rootdir/test/common/autotest_common.sh
+source $rootdir/test/nvmf/common.sh
+TEST_TRANSPORT='rdma'
+
+nvmftestinit
+
+function finish_test() {
+ {
+ "$rpc_py" bdev_lvol_delete_lvstore -l lvs0
+ kill -9 $rpc_proxy_pid
+ rm "$testdir/conf.json"
+ } || :
+}
+
+cat <<- JSON > "$testdir/conf.json"
+ {"subsystems":[
+ $("$rootdir/scripts/gen_nvme.sh" --json)
+ ]}
+JSON
+
+nvmfappstart -m 0x3 -p 0 -s 1024 --json $testdir/conf.json
+
+trap 'finish_test; process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
+
+$rpc_py bdev_nvme_set_hotplug -e
+timing_enter run_rpc_proxy
+$rootdir/scripts/rpc_http_proxy.py 127.0.0.1 3333 secret secret &
+rpc_proxy_pid=$!
+timing_exit run_rpc_proxy
+
+timing_enter configure_spdk
+$rpc_py bdev_get_bdevs
+$rpc_py bdev_lvol_delete_lvstore -l lvs0 || true
+$rpc_py bdev_lvol_create_lvstore Nvme0n1 lvs0
+$rpc_py bdev_get_bdevs
+timing_exit configure_spdk
+
+timing_enter restart_cinder
+sudo systemctl restart devstack@c-*
+sleep 10
+timing_exit restart_cinder
+
+# Start testing spdk with openstack using tempest (openstack tool that allow testing an openstack functionalities)
+# In this tests is checked if spdk can correctly cooperate with openstack spdk driver
+timing_enter tempest_tests
+current_dir=$(pwd)
+cd /opt/stack/tempest
+tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume
+tox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_list_get_volume_attachments
+tox -e all -- tempest.api.compute.volumes.test_volume_snapshots.VolumesSnapshotsTestJSON.test_volume_snapshot_create_get_list_delete
+tox -e all -- tempest.api.compute.volumes.test_volumes_get.VolumesGetTestJSON.test_volume_create_get_delete
+tox -e all -- tempest.api.compute.volumes.test_volumes_list.VolumesTestJSON.test_volume_list
+tox -e all -- tempest.api.volume.test_versions.VersionsTest.test_list_versions
+tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend
+tox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend_when_volume_has_snapshot
+tox -e all -- tempest.api.volume.test_volumes_get.VolumesSummaryTest.test_show_volume_summary
+tox -e all -- tempest.api.volume.test_volumes_list.VolumesListTestJSON.test_volume_list
+tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_delete_with_volume_in_use
+tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_get_list_update_delete
+tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_offline_delete_online
+tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot
+tox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot_no_size
+tox -e all -- tempest.api.volume.test_volumes_snapshots_list.VolumesSnapshotListTestJSON.test_snapshot_list_param_limit
+cd $current_dir
+timing_exit tempest_tests
+
+timing_enter test_cleanup
+finish_test
+
+trap - SIGINT SIGTERM EXIT
+nvmftestfini
+timing_exit test_cleanup