Skip to content

Commit 61cc755

Browse files
committed
test(backend): test nvme entities over HTTP
Signed-off-by: Artsiom Koltun <artsiom.koltun@intel.com>
1 parent 5d8b8d7 commit 61cc755

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

scripts/tests.sh

+27-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ grep "Total" log.txt
8080
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeRemoteController "{name: 'nvmeRemoteControllers/nvmetcp12'}"
8181
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmePath "{name: 'nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0'}"
8282

83-
# check http gateway is responding on List commands
84-
curl -X GET -f "http://127.0.0.1:8082/v1/nvmeRemoteControllers" | jq '.nvmeRemoteControllers[0].name'
85-
curl -X GET -f "http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths" | jq .nvmePaths[0].name
86-
curl -X GET -f "http://127.0.0.1:8082/v1/nvmeSubsystems" | jq .nvmeSubsystems[1].spec.nqn
87-
8883
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmePath "{name: 'nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0'}"
8984
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmeRemoteController "{name: 'nvmeRemoteControllers/nvmetcp12'}"
9085
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmeNamespace "{name : 'subsystems/subsystem1/namespaces/namespace1'}"
@@ -111,5 +106,32 @@ grep "Total" log.txt
111106
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmeController "{name : 'subsystems/subsystem2/controllers/controller2'}"
112107
"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmeSubsystem "{name : 'subsystems/subsystem2'}"
113108

109+
110+
# HTTP gateway to Nvme
111+
# Backend
112+
# create
113+
curl -X POST -f http://127.0.0.1:8082/v1/nvmeRemoteControllers?nvme_remote_controller_id=nvmetcp12 -d '{"multipath": "NVME_MULTIPATH_MULTIPATH"}'
114+
curl -X POST -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths?nvme_path_id=nvmetcp12path0 -d "{\"traddr\":\"${SPDK_IP}\", \"trtype\":\"NVME_TRANSPORT_TYPE_TCP\", \"fabrics\":{\"subnqn\":\"nqn.2016-06.io.spdk:cnode1\", \"trsvcid\":\"4444\", \"adrfam\":\"NVME_ADDRESS_FAMILY_IPV4\", \"hostnqn\":\"nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c\"}}"
115+
116+
# get
117+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12
118+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0
119+
# list
120+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers | jq '.nvmeRemoteControllers[0].name'
121+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths | jq .nvmePaths[0].name
122+
# stats
123+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12:stats
124+
curl -X GET -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0:stats
125+
# update
126+
curl -X PATCH -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12 -d '{"multipath": "NVME_MULTIPATH_MULTIPATH"}'
127+
curl -X PATCH -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths -d '{"traddr":"127.0.0.1", "trtype":"NVME_TRANSPORT_TYPE_TCP", "fabrics":{"subnqn":"nqn.2019-06.io.spdk:0", "trsvcid":"4420", "adrfam":"NVME_ADDRESS_FAMILY_IPV4", "hostnqn":"nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c"}}'
128+
# delete
129+
curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0
130+
curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12
131+
132+
# Frontend
133+
# list
134+
# curl -X GET -f "http://127.0.0.1:8082/v1/nvmeSubsystems" | jq .nvmeSubsystems[1].spec.nqn
135+
114136
# this is last line
115137
docker-compose ps -a

0 commit comments

Comments
 (0)