SysUeAppsContext.robot 6.78 KB
Newer Older
Yann Garcia's avatar
Yann Garcia committed
1
''[Documentation]   robot --outputdir ../../outputs ./SysUeAppContext.robot
2
...    Test Suite to validate Bandwidth Management API (APPCTX) operations.
3
4
5
6
7

*** Settings ***
Resource    environment/variables.txt
Resource    ../../pics.txt
Resource    ../../GenericKeywords.robot
8
Resource    resources/UeAppsContextAPI.robot
9
10
11
12
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false


*** Test Cases ***
13
14
15
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
16
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
17
18
    ...  Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
    Create application context    ${CREATE_APP_CTX}
Yann Garcia's avatar
Yann Garcia committed
19
    Check HTTP Response Status Code Is    201
20
21
    Check HTTP Response Body Json Schema Is   AppContext
    Should Be True    ${response['body']['appContext']['appInfo']['appName']} == ${APP_NAME}
22
23
    # Postamble
    Delete an application context    ${APP_CTX_ID}
24
25
26
27
28


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
29
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
30
    ...  Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
31
    Create application context    ${CREATE_APP_CTX_BR}
32
33
34
35
36
37
38
    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
39
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
40
41
42
43
44
45
46
    ...  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}
47
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
48
49
50
    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}
51
52
    # Postamble
    Delete an application context    ${APP_CTX_ID}
53
54
55
56
57


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
58
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
59
60
61
62
63
64
65
    ...  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
66
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
67
68
    Check HTTP Response Status Code Is    400
    Check ProblemDetails    400
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    # 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
118
119
120


*** Keywords ***
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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}
143
144
145
146
147
148
149
150
151
152
153


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}