From 6e9a97229d0ee5d4bb2bbecd491fa366555a599f Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Thu, 1 Feb 2024 12:45:45 +0100 Subject: [PATCH] test(frontend): test nvme entities over HTTP Signed-off-by: Artsiom Koltun --- scripts/tests.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/scripts/tests.sh b/scripts/tests.sh index afd8867b..db05def5 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -130,8 +130,36 @@ curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12/nvmeP curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeRemoteControllers/nvmetcp12 # Frontend +# create +curl -X POST -f http://127.0.0.1:8082/v1/nvmeSubsystems?nvme_subsystem_id=subsys0 -d '{"spec": {"nqn": "nqn.2022-09.io.spdk:opitest1"}}' +curl -X POST -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces?nvme_namespace_id=namespace0 -d '{"spec": {"volume_name_ref": "Malloc1", "host_nsid": 10}}' +curl -X POST -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers?nvme_controller_id=ctrl0 -d '{"spec": {"trtype": "NVME_TRANSPORT_TYPE_TCP", "fabrics_id":{"traddr": "127.0.0.1", "trsvcid": "4421", "adrfam": "NVME_ADDRESS_FAMILY_IPV4"}}}' + +# get +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0 +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces/namespace0 +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers/ctrl0 + # list -# curl -X GET -f "http://127.0.0.1:8082/v1/nvmeSubsystems" | jq .nvmeSubsystems[1].spec.nqn +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers + +# stats +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0:stats +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces/namespace0:stats +curl -X GET -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers/ctrl0:stats + +# update +# update subsys returns not implemented error +#curl -X PATCH -k http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0 -d '{"spec": {"nqn": "nqn.2022-09.io.spdk:opitest1"}}' +curl -X PATCH -k http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces/namespace0 -d '{"spec": {"volume_name_ref": "Malloc1", "host_nsid": 10}}' +curl -X PATCH -k http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers/ctrl0 -d '{"spec": {"trtype": "NVME_TRANSPORT_TYPE_TCP", "fabrics_id":{"traddr": "127.0.0.1", "trsvcid": "4421", "adrfam": "NVME_ADDRESS_FAMILY_IPV4"}}}' + +# delete +curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeControllers/ctrl0 +curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0/nvmeNamespaces/namespace0 +curl -X DELETE -f http://127.0.0.1:8082/v1/nvmeSubsystems/subsys0 # this is last line docker-compose ps -a