Commit 094ceddc authored by Stavros Sachtouris's avatar Stavros Sachtouris

Separate compute from storage tests

Distinct with a directory structure
Create curl functional tests
parent 293dfd59
......@@ -131,8 +131,8 @@ environment variables:
$ export OS_TPL="13"
$ export RESOURCE_TPL="6f1f7205-cf4c-4b8c-ae77-7c419747bcbd"
The USER_PROXY is only needed if you run the rOCCI-based "run_function_tests.sh",
while TOKEN is only needed if you run the "run_curl_tests.sh" script.
The USER_PROXY is only needed if you run the rOCCI-based "rocci/*.sh",
while TOKEN is only needed if you run the "curl/*.sh" script.
You can setup a docker client for testing. Follow the
"soi/tests/functional/README.md" instructions and test the application with the
......@@ -144,7 +144,7 @@ the container.
Examples
--------
For the examples below we assume server is running on localhost (port 8080) and authentication token is $TOKEN. For the HTTP requests we are using **curl**. All
these tests are also programmed in "soi/tests/functional/run_curl_tests.sh"
these tests are also programmed in "soi/tests/functional/curl/"
* Retrieve all registered Kinds, Actions and Mixins:
......
......@@ -22,7 +22,7 @@ FROM egifedcloud/fedcloud-userinterface:latest
MAINTAINER Stavros Sachtouris <saxtouri@grnet.gr>
RUN apt update && apt install ca-policy-egi-core curl openssh-client -y
COPY run_functional_tests.sh /data/
COPY run_curl_tests.sh /data/
COPY curl /data/curl
COPY storage /data/storage
COPY run.sh /data/
CMD ["/bin/bash", "/data/run.sh"]
......@@ -7,7 +7,7 @@ Build the image
This will build a new image, which can be pushed or kept local.
Alternatively, you can, of course, use the grnet repository to build the image:
Alternatively, you can use the grnet repository to build the image:
::
......@@ -43,7 +43,13 @@ export SNF_OCCI_DEBUG=true
Unset the variable for a less verbose execution
To run the "run_functional_tests.sh" script, you must set some variables,
There are two equivalent sets of functional tests prepared in two separate
directories. The ones based on the rOCCI client are under `rocci` directory,
the ones based on curl are under the `curl` directory. In the following we will
assume you want to run the tests for "compute" (server) functionalities, but
you should explore and run all tests.
To run the "rocci/compute.sh" script, you must set some variables,
either when you RUN the container or while you are inside the container.
::
......@@ -53,7 +59,7 @@ either when you RUN the container or while you are inside the container.
OS_TPL
RESOURCE_TPL
For the "run_curl_tests.sh" you need a similar set of enviroment variables.
For the "curl/compute.sh" you need a similar set of enviroment variables.
::
......
#!/bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "Check vars ..."
if [ -z "$OCCI_ENDPOINT" ]; then echo "E: OCCI_ENDPOINT not set"; exit 1; fi;
echo "OCCI_ENDPOINT = ${OCCI_ENDPOINT}"
if [ -z "$TOKEN" ]; then echo "E: TOKEN not set"; exit 1; fi;
echo "TOKEN = ${TOKEN}"
echo "Vars OK, run tests"
echo
if [ -z "$SNF_OCCI_DEBUG" ]; then
XARGS="-s";
else
XARGS="-v";
fi
BASE_CMD="curl ${XARGS} -H'X-Auth-Token: ${TOKEN}'"
VM_INFO="/tmp/vm.info"
echo "Create a volume"
echo "Meaning: kamaki volume create --name \"My Test Volume\" \\"
echo " --size 10 --volume-type 2"
CMD="${BASE_CMD} -X'POST' $OCCI_ENDPOINT/storage/ \
-H 'Category: storage; \
scheme=\"http://schemas.ogf.org/occi/infrastructure#\"; \
class=\"kind\"' \
-H 'X-OCCI-Attribute: occi.core.title=\"My Test Volume\"'
-H 'X-OCCI-Attribute: occi.storage.size=10'"
echo $CMD
VOLUME_URL=$(eval $CMD)
echo ${VOLUME_URL}
VOLUME_ID=(`echo $VOLUME_URL|awk '{n=split($0,a,"/"); print a[n];}'`)
echo
echo
echo "List volumes"
echo "Meaning: kamaki volume list"
CMD="${BASE_CMD} $OCCI_ENDPOINT/storage/"
echo "$CMD"
eval $CMD
echo
echo
echo "Get volume information"
echo "Meaning: kamaki volume info ${VOLUME_ID}"
CMD="${BASE_CMD} $OCCI_ENDPOINT/storage/${VOLUME_ID}"
echo "$CMD"
eval $CMD
echo
echo
echo "Delete a volume"
echo "Meaning: kamaki volume delete ${VOLUME_ID}"
CMD="${BASE_CMD} -X'DELETE' $OCCI_ENDPOINT/storage/${VOLUME_ID}"
echo "$CMD"
eval $CMD
echo
echo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment