119359f86SPawel Kaminski#!/usr/bin/env bash 2eb53c232Spaul luse# SPDX-License-Identifier: BSD-3-Clause 3eb53c232Spaul luse# Copyright (C) 2019 Intel Corporation 4eb53c232Spaul luse# All rights reserved. 5eb53c232Spaul luse# 619359f86SPawel Kaminskitestdir=$(readlink -f $(dirname $0)) 719359f86SPawel Kaminskirootdir=$(readlink -f $testdir/../..) 80c25e6fbSMichal Berger 95fd83ebdSKrzysztof Karasset -- "--iso" "--transport=tcp" "$@" 100c25e6fbSMichal Berger 1119359f86SPawel Kaminskisource $rootdir/test/common/autotest_common.sh 1219359f86SPawel Kaminskisource $rootdir/test/nvmf/common.sh 1319359f86SPawel Kaminski 149b0730b3SKrzysztof Karasrpc_py=$rootdir/scripts/rpc.py 159b0730b3SKrzysztof Karas 16*0070858eSMichal BergerHUGEMEM=1024 nvmftestinit 1719359f86SPawel Kaminski 18844c8ec3SMichal Bergerfunction finish_test() { 19ddc069c5SMichal Berger { 20ddc069c5SMichal Berger "$rpc_py" bdev_lvol_delete_lvstore -l lvs0 2119359f86SPawel Kaminski kill -9 $rpc_proxy_pid 22ddc069c5SMichal Berger rm "$testdir/conf.json" 23ddc069c5SMichal Berger } || : 2419359f86SPawel Kaminski} 2519359f86SPawel Kaminski 2603d45020SKrzysztof Karasfunction tox() { 2703d45020SKrzysztof Karas source /opt/stack/devstack/openrc "$(type -P tox)" "$@" 2803d45020SKrzysztof Karas} 2903d45020SKrzysztof Karas 308c3e71f0STomasz Zawadzki$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $testdir/conf.json 319f815a83SMichal Berger 328cc72fe4SMichal Bergernvmfappstart -m 0x3 -p 0 -s 1024 --json $testdir/conf.json 3319359f86SPawel Kaminski 3415df8980SPawel Kaminskitrap 'finish_test; process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT 3515df8980SPawel Kaminski 3615df8980SPawel Kaminski$rpc_py bdev_nvme_set_hotplug -e 3719359f86SPawel Kaminskitiming_enter run_rpc_proxy 3819359f86SPawel Kaminski$rootdir/scripts/rpc_http_proxy.py 127.0.0.1 3333 secret secret & 3919359f86SPawel Kaminskirpc_proxy_pid=$! 4019359f86SPawel Kaminskitiming_exit run_rpc_proxy 4119359f86SPawel Kaminski 4219359f86SPawel Kaminskitiming_enter configure_spdk 432c49e910SMaciej Wawryk$rpc_py bdev_get_bdevs 444c049618SMaciej Wawryk$rpc_py bdev_lvol_delete_lvstore -l lvs0 || true 45de756853SMaciej Wawryk$rpc_py bdev_lvol_create_lvstore Nvme0n1 lvs0 462c49e910SMaciej Wawryk$rpc_py bdev_get_bdevs 4719359f86SPawel Kaminskitiming_exit configure_spdk 4819359f86SPawel Kaminski 4919359f86SPawel Kaminskitiming_enter restart_cinder 50257d06f7SMaciej Wawryksudo systemctl restart devstack@* 51257d06f7SMaciej Wawryksleep 20 5219359f86SPawel Kaminskitiming_exit restart_cinder 5319359f86SPawel Kaminski 540c25e6fbSMichal Bergerrxe_cfg status 550c25e6fbSMichal Berger 5619359f86SPawel Kaminski# Start testing spdk with openstack using tempest (openstack tool that allow testing an openstack functionalities) 5719359f86SPawel Kaminski# In this tests is checked if spdk can correctly cooperate with openstack spdk driver 5819359f86SPawel Kaminskitiming_enter tempest_tests 5919359f86SPawel Kaminskicurrent_dir=$(pwd) 6019359f86SPawel Kaminskicd /opt/stack/tempest 6119359f86SPawel Kaminskitox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume 6219359f86SPawel Kaminskitox -e all -- tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_list_get_volume_attachments 6319359f86SPawel Kaminskitox -e all -- tempest.api.compute.volumes.test_volume_snapshots.VolumesSnapshotsTestJSON.test_volume_snapshot_create_get_list_delete 6419359f86SPawel Kaminskitox -e all -- tempest.api.compute.volumes.test_volumes_get.VolumesGetTestJSON.test_volume_create_get_delete 6519359f86SPawel Kaminskitox -e all -- tempest.api.compute.volumes.test_volumes_list.VolumesTestJSON.test_volume_list 6619359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_versions.VersionsTest.test_list_versions 6719359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend 6819359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_extend.VolumesExtendTest.test_volume_extend_when_volume_has_snapshot 6919359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_get.VolumesSummaryTest.test_show_volume_summary 7019359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_list.VolumesListTestJSON.test_volume_list 7119359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_delete_with_volume_in_use 7219359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_get_list_update_delete 7319359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_snapshot_create_offline_delete_online 7419359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot 7519359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots.VolumesSnapshotTestJSON.test_volume_from_snapshot_no_size 7619359f86SPawel Kaminskitox -e all -- tempest.api.volume.test_volumes_snapshots_list.VolumesSnapshotListTestJSON.test_snapshot_list_param_limit 7719359f86SPawel Kaminskicd $current_dir 7819359f86SPawel Kaminskitiming_exit tempest_tests 7919359f86SPawel Kaminski 8019359f86SPawel Kaminskitiming_enter test_cleanup 8119359f86SPawel Kaminskifinish_test 8219359f86SPawel Kaminski 8319359f86SPawel Kaminskitrap - SIGINT SIGTERM EXIT 8419359f86SPawel Kaminskinvmftestfini 8519359f86SPawel Kaminskitiming_exit test_cleanup 86