PlatAppSubscriptions.robot 5.92 KB
Newer Older
1
2
3
4
5
6
*** Settings ***

Documentation
...    A test suite for validating Application Subscriptions (APPSUB) operations.

Resource    ../../GenericKeywords.robot
Elian Kraja's avatar
Elian Kraja committed
7
8
9
Resource    environment/variables.txt
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem    
10

Elian Kraja's avatar
Elian Kraja committed
11
Default Tags    TC_MEC_SRV_APPSUB
12
13
14
15


*** Test Cases ***

Elian Kraja's avatar
Elian Kraja committed
16
TC_MEC_SRV_APPSUB_001_OK
17
18
19
20
    [Documentation]
    ...    Check that the IUT responds with a list of subscriptions for notifications
    ...    on services availability when queried by a MEC Application
    ...
21
22
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/MecAppSuptApiSubscriptionLinkList
23
24

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
25
    Get Subscriptions list    ${APP_INSTANCE_ID}
26
    Check HTTP Response Status Code Is    200
Elian Kraja's avatar
Elian Kraja committed
27
    Check HTTP Response Body Json Schema Is    SubscriptionsLinkList
28
29


Elian Kraja's avatar
Elian Kraja committed
30
TC_MEC_SRV_APPSUB_001_NF
31
32
33
34
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...
35
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.1
36
37

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
38
    Get Subscriptions list    ${NON_EXISTENT_APP_INSTANCE_ID}
39
40
41
    Check HTTP Response Status Code Is    404


Elian Kraja's avatar
Elian Kraja committed
42
TC_MEC_SRV_APPSUB_002_OK
43
44
45
46
    [Documentation]
    ...    Check that the IUT acknowledges the subscription by a MEC Application
    ...    to notifications on service availability events
    ...
47
48
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription
49
50

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
51
    Create new subscription    ${APP_INSTANCE_ID}    AppTerminationNotificationSubscription
52
53
54
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    AppTerminationNotificationSubscription
    Check HTTP Response Header Contains    Location
Elian Kraja's avatar
Elian Kraja committed
55
56
    Check Response Contains    ${response['body']}    subscriptionType    AppTerminationNotificationSubscription
    Check Response Contains    ${response['body']}    callbackReference    ${APP_TERM_NOTIF_CALLBACK_URI}
57
58


Elian Kraja's avatar
Elian Kraja committed
59
TC_MEC_SRV_APPSUB_003_OK
60
61
62
63
    [Documentation]
    ...    Check that the IUT responds with the information on a specific subscription
    ...    when queried by a MEC Application
    ...
64
65
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription
66
67

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
68
    Get individual subscription    ${APP_INSTANCE_ID}    ${SUBSCRIPTION_ID}
69
70
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    AppTerminationNotificationSubscription
Elian Kraja's avatar
Elian Kraja committed
71
    Check Response Contains    ${response['body']}    subscriptionType    AppTerminationNotificationSubscription
72
73


Elian Kraja's avatar
Elian Kraja committed
74
TC_MEC_SRV_APPSUB_003_NF
75
76
77
78
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...
79
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.1
80
81

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
82
    Get individual subscription    ${APP_INSTANCE_ID}    ${NON_EXISTENT_SUBSCRIPTION_ID}
83
84
85
    Check HTTP Response Status Code Is    404


Elian Kraja's avatar
Elian Kraja committed
86
TC_MEC_SRV_APPSUB_004_OK
87
88
89
90
    [Documentation]
    ...    Check that the IUT acknowledges the unsubscribe from service availability event notifications
    ...    when commanded by a MEC Application
    ...
91
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.5
92
93

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
94
    Remove subscription    ${APP_INSTANCE_ID}    ${SUBSCRIPTION_ID}
95
96
97
    Check HTTP Response Status Code Is    204


Elian Kraja's avatar
Elian Kraja committed
98
TC_MEC_SRV_APPSUB_004_NF
99
100
101
102
103
104
105
    [Documentation]
    ...    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 011 V2.0.9, clause 7.2.4.3.5

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
Elian Kraja's avatar
Elian Kraja committed
106
    Remove subscription    ${NON_EXISTENT_APP_INSTANCE_ID}    ${SUBSCRIPTION_ID}
107
    Check HTTP Response Status Code Is    404
Elian Kraja's avatar
Elian Kraja committed
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145


*** Keywords ***
Get Subscriptions List
    [Arguments]    ${appInstanceId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Create new subscription    
    [Arguments]    ${appInstanceId}    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    Post    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/subscriptions    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    

Get individual subscription    
    [Arguments]    ${appInstanceId}    ${subscriptionId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Remove subscription  
    [Arguments]    ${appInstanceId}    ${subscriptionId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}