Commit 9614fd21 authored by Elian Kraja's avatar Elian Kraja
parents 6dc57c2b f8337756
Pipeline #1545 failed with stage
in 0 seconds
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -vx
#set -e
cd "$(dirname "$0")"
run_dir="$(pwd)"
./scripts/build-container.sh
./scripts/run-container.sh "${run_dir}"
exit $?
''[Documentation] robot --outputdir ../../outputs ./PlatBandwidthManager.robot
''[Documentation] robot --outputdir ../../outputs ./SysUeAppContext.robot
... Test Suite to validate Bandwidth Management API (BWA) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../pics.txt
Resource ../../GenericKeywords.robot
Resource resources/UEAppInterfaceAPI.robot
Resource resources/UeAppContextAPI.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
Creation of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_001_OK
... Check that the IUT acknowledges the creation of the application context when requested by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
Create application context ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['appInfo']['appName']} == ${APP_NAME}
# Postamble
Delete an application context ${APP_CTX_ID}
Creation of the application context with wrong parameters
[Documentation] TC_MEC_MEO_UEAPPCTX_001_BR
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
Create application context ${CREATE_APP_CTX_BR}
Check HTTP Response Status Code Is 400
Check ProblemDetails 400
Update of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_002_OK
... Check that the IUT updates the application callback reference when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX['callbackReference']}= ${CALLBACK_REFERENCE_1}
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 204
Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['callbackReference']} == ${CALLBACK_REFERENCE_1}
# Postamble
Delete an application context ${APP_CTX_ID}
Update of the application context with wrong parameters
[Documentation] TC_MEC_MEO_UEAPPCTX_002_BR
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX['callbackReference']}= '' # Empty string
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 400
Check ProblemDetails 400
# Postamble
Delete an application context ${APP_CTX_ID}
Update of the application context with unknown URI
[Documentation] TC_MEC_MEO_UEAPPCTX_002_NF
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX['callbackReference']}= ${CALLBACK_REFERENCE_1}
Update application context ${NON_EXISTENT_APP_CTX_ID} ${CREATE_APP_CTX}
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
# Postamble
Delete an application context ${APP_CTX_ID}
Delete of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_003_OK
... Check that the IUT deletes the application context when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
Delete application context ${APP_CTX_ID}
Check HTTP Response Status Code Is 204
Delete of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_003_NF
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
# AppCtx not created!
# Test Body
Delete application context ${APP_CTX_ID}
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
*** Keywords ***
Create application context
[Arguments] ${content}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/mx2/v2/app_contexts ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Update application context
[Arguments] ${context_id} ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Put /exampleAPI/mx2/v2/app_contexts/${context_id} ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Delete application context
[Arguments] ${context_id}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete /exampleAPI/mx2/v2/app_contexts/${context_id}
${output}= Output response
Set Suite Variable ${response} ${output}
......@@ -4,3 +4,13 @@ ${MEC-APP_SCHEMA} http
#${MEC-APP_HOST} 127.0.0.1
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${APP_CTX_ID} appCtx01
${NON_EXISTENT_APP_CTX_ID} appCtx99
${UE_APP_ID} ueIdAppCtx01
${APP_NAME} MyWornderfulApp
${WRONG_CREATE_APP_CTX} UnknownApp
${CALLBACK_REFERENCE} http://www.acme.com/MyWonderfulApp/v1
${CALLBACK_REFERENCE_1} http://www.acme.com/MyWonderfulApp/v2
${CREATE_APP_CTX} { "contextId": "${CREATE_APP_CTX}", "associateUeAppId": "${UE_APP_ID}", "callbackReference": "${CALLBACK_REFERENCE}", "appInfo": { "appName": "${APP_NAME}", "appProvider": "ACME & Co", "appSoftVersion": "1.0.0.1", "appDescription": "This is a wonderful test application", "referenceURL": "http://www.acme.com/MyWonderfulPackage", "appPackageSource": "MyWonderfulPackage" } }
${CREATE_APP_CTX_BR} { "context": "${CREATE_APP_CTX}", "associateUeAppId": "${UE_APP_ID}", "callbackReference": "${CALLBACK_REFERENCE}", "appInfo": { "appName": "${APP_NAME}", "appProvider": "ACME & Co", "appSoftVersion": "1.0.0.1", "appDescription": "This is a wonderful test application", "referenceURL": "http://www.acme.com/MyWonderfulPackage", "appPackageSource": "MyWonderfulPackage" } }
${SERVICE_CONT_BR} UnknownServiceCont
*** Settings ***
Resource ../environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
Library JSONSchemaLibrary schemas/
*** Keywords ***
*** Settings ***
Resource ../environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
Library JSONSchemaLibrary schemas/
*** Keywords ***
Create an application context
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/mx2/v2/app_contexts ${CREATE_APP_CTX}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is AppContext
Set Suite Variable ${APP_CTX_ID} ${response['body']['contextId']
Should Not Be Empty ${APP_CTX_ID}
Delete an application context
[Arguments] ${context_id}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete /exampleAPI/mx2/v2/app_contexts/${context_id}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 204
''[Documentation] robot --outputdir ../../outputs ./SysUeApplications.robot
... Test Suite to validate Bandwidth Management API (BWA) operations.
*** Settings ***
Resource ../UEAPPCTX/environment/variables.txt
Resource ../../pics.txt
Resource ../../GenericKeywords.robot
Resource ../UEAPPCTX/resources/UeAppContextAPI.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
Get the list of the application contexts
[Documentation] TC_MEC_MEO_UEAPPS_001_OK
... Check that the IUT responds with the list of user applications available when requested by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.3.3.1
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
Retrieve the application contexts list ${APP_NAME}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is AppInfo
Should Be True ${response['body']['appInfo']['appInfo'][0]['appName']} == ${APP_NAME}
# Postamble
Delete an application context ${APP_CTX_ID}
Get the list of the application contexts with wrong parameter
[Documentation] TC_MEC_MEO_UEAPPS_001_BR
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.3.3.1
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
Retrieve the application contexts list with serviceCont ${SERVICE_CONT_BR}
Check HTTP Response Status Code Is 400
Check ProblemDetails 400
# Postamble
Delete an application context ${APP_CTX_ID}
Get the list of the application contexts with wrong parameter
[Documentation] TC_MEC_MEO_UEAPPS_001_NF
... Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.3.3.1
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
# AppInfo not created
# Test Body
Retrieve the application contexts list ${APP_NAME}
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
*** Keywords ***
Retrieve the application contexts list
[Arguments] ${app_name}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/mx2/v2/app_list?appName=${app_name}
${output}= Output response
Set Suite Variable ${response} ${output}
Retrieve the application contexts list with serviceCont
[Arguments] ${service_cont}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/mx2/v2/app_list?serviceCont=${service_cont}
${output}= Output response
Set Suite Variable ${response} ${output}
This diff is collapsed.
......@@ -4,7 +4,6 @@ ${MEC-APP_SCHEMA} http
#${MEC-APP_HOST} 127.0.0.1
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${ETAG_LABEL} Location
${INVALID_ETAG} invalid_etag
${APP_INSTANCE_ID} appInst01
${NON_EXISTENT_APP_INSTANCE_ID} appInst99
......@@ -17,3 +16,5 @@ ${REQUEST_FOR_DELTAS_CHANGES} { "appInsId": "${APP_INSTANCE_ID}", "request
${REQUEST_FOR_DELTAS_CHANGES_BR} { "appInsId": "${APP_INSTANCE_ID}", "requestType": "UNKNOWN", "fixedBWPriority": "not defined in the present document", "fixedAllocation": "string", "allocationDirection": "00 = Downlink (towards the UE)"}
${response} {}
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${ETAG_VALUE}
......@@ -7,39 +7,40 @@ Library JSONSchemaLibrary schemas/
*** Keywords ***
Register Bandwidth Management Service
Register Bandwidth Management Service
... Register a Bandwidth Management Service
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/bwm/v1/bw_allocations ${REQUEST_FOR_BW_REQUIREMENTS}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is bwInfo
# Extract ETAG_VALUE
${etag_value}= ${response['status']['${etag_label}']}
# TODO Extract allocationId
${allocation_id}= 'todo'
[return] ${allocation_id} ${etag_value}
Unregister Bandwidth Management Service
... Unregister a Bandwidth Management Service
[Arguments] ${value}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete /exampleAPI/bwm/v1/bw_allocations/${value}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 204
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/bwm/v1/bw_allocations ${REQUEST_FOR_BW_REQUIREMENTS}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is bwInfo
# Extract ETAG_VALUE
Set Suite Variable ${ETAG_VALUE} ${response['status']['ETag']}
Should Not Be Empty ${ETAG_VALUE}
# TODO Extract allocationId not possible, information is missing in the standard doc
Set Suite Variable ${ALLOCATION_ID} ${response['body']['bwInfo']['allocationId']}
Should Not Be Empty ${ALLOCATION_ID}
Unregister Bandwidth Management Service
... Unregister a Bandwidth Management Service
[Arguments] ${value}
Should Be True ${PIC_MEC_PLAT} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete /exampleAPI/bwm/v1/bw_allocations/${value}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 204
Check AppInstanceId
......
#!/bin/bash
# Copyright ETSI 2019
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
set -vx
DOCKER_FILE=./scripts/docker/Dockerfile
if [ -f ${DOCKER_FILE} ]
then
#check and build stf569-rf image
DOCKER_ID=`docker ps -a | grep -e stf569-rf | awk '{ print $1 }'`
if [ ! -z "${DOCKER_ID}" ]
then
docker rm --force stf569-rf
fi
docker build --tag stf569-rf --force-rm -f ${DOCKER_FILE} .
if [ "$?" != "0" ]
then
echo "Docker build failed: $?"
exit -1
fi
docker image ls -a
docker inspect stf569-rf:latest
if [ "$?" != "0" ]
then
echo "Docker inspect failed: $?"
exit -2
fi
else
exit -3
fi
# That's all Floks
exit 0
FROM ubuntu:16.04
MAINTAINER ETSI STF 569
LABEL description="SFT569 Robot Framework Docker Image"
ENV TERM=xterm
ENV HOSTNAME docker-robot-STF569
ARG ssh_prv_key
RUN DEBIAN_FRONTEND=noninteractive apt update \
&& apt install python3 -y \
&& apt install python3-pip -y \
&& apt install openssh-server -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*
RUN echo "docker-robot-STF569" > /etc/hostname \
&& echo "root:etsi" | chpasswd
RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \
&& echo "etsi:etsi" | chpasswd \
&& adduser etsi sudo \
&& echo "etsi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN DEBIAN_FRONTEND=noninteractive \
&& mkdir -p /home/etsi/dev/robot \
&& cd /home/etsi/dev/robot
ADD . /home/etsi/dev/robot
RUN pip3 install robotframework
RUN DEBIAN_FRONTEND=noninteractive \
&& cd /home/etsi/dev/robot \
&& pip3 install -r requirements.txt \
&& chmod +x /home/etsi/dev/robot/scripts/*
CMD tail -f /dev/null
File mode changed from 100644 to 100755
......@@ -2,7 +2,9 @@
## Launch robot tests validator
/bin/bash /scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log
mkdir logs
/bin/bash scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log
## Filter failed Keywords
grep -r10n "| FAIL |" logs/robot_stdout.log | grep -v "Output:" | grep -v "Log:" | grep -v "Report:" > logs/failures.log
......@@ -18,4 +20,19 @@ ERRORS=`awk 'END{print NR}' logs/errors.log logs/failures.log`
if [ "${ERRORS}" -eq 0 ]; then
rm -f logs/errors.log
rm -f logs/failures.log
fi
\ No newline at end of file
fi
if [ ! -z logs/errors.log ]; then
cat logs/errors.log
fi
if [ ! -z logs/failures.log ]; then
cat logs/failures.log
fi
if [ ! -z logs/erros.log ] || [ ! -z logs.failures.log ]; then
echo "Errors are found. Job failed"
exit 1
fi
#!/bin/bash
# Copyright ETSI 2019
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
#set -vx
docker run stf569-rf:latest "/bin/bash" \
-c "cd /home/etsi/dev/robot \
&& sh scripts/run-all.bash \
&& ls -ltr logs/"
# That's all Floks
exit $?
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