Grant.robot 4.29 KB
Newer Older
Elian Kraja's avatar
Elian Kraja committed
1
2
3
4
5
''[Documentation]   robot --outputdir ./outputs ./SRV/UETAG/PlatUeIdentity.robot
...    Test Suite to validate UE Identity Tag (UETAG) operations.

*** Settings ***
Resource    environment/variables.txt
6
Resource    ../../../GenericKeywords.robot
Elian Kraja's avatar
Elian Kraja committed
7
8
9
10
11
12
13
Library     REST    ${MEO_SCHEMA}://${MEO_HOST}:${MEO_PORT}    ssl_verify=false
Library     OperatingSystem




*** Test Cases ***
14
15
TC_MEC_MEC010p2_MEO_GRANT_001_OK
    [Documentation]  
Elian Kraja's avatar
Elian Kraja committed
16
17
18
19
20
21
22
23
24
25
26
27
    ...  Check that MEO sends a synchronous grant response when a grant request is requested
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.2.2-1 (GrantRequest)
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRequest
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is   Grant



28
TC_MEC_MEC010p2_MEO_GRANT_001_BR
Elian Kraja's avatar
Elian Kraja committed
29
30
31
32
33
34
35
36
37
38
    [Documentation]   TP_MEC_MEO_GRANT_001_BR
    ...  Check that MEO responds with an error when it receives a malformed request when a new grant request is performed
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRejectedRequest
    Check HTTP Response Status Code Is    400



39
TC_MEC_MEC010p2_MEO_GRANT_002_OK
Elian Kraja's avatar
Elian Kraja committed
40
41
42
43
44
45
46
47
48
49
50
    [Documentation]   TP_MEC_MEO_GRANT_002_OK
    ...  Check that MEO sends a asynchronous grant response when a grant request is requested
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRequest
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body is Empty


51
TC_MEC_MEC010p2_MEO_GRANT_003_OK
Elian Kraja's avatar
Elian Kraja committed
52
53
54
55
56
57
58
59
60
61
62
63
    [Documentation]    TP_MEC_MEO_GRANT_003_OK
    ...  Check that MEO sends the status of a grant request when a query on a granting ID is performed.
    ...  The process of creating the grant is ongoing, no grant is available yet 
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Get an individual grant    ${grantId}
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body is Empty
    
    
    
64
TC_MEC_MEC010p2_MEO_GRANT_003_NF
Elian Kraja's avatar
Elian Kraja committed
65
66
67
68
69
70
71
72
73
    [Documentation]    TP_MEC_MEO_GRANT_003_NF
    ...    Check that MEO responds with an error when it receives a request for returning a grant referred with a wrong ID
    ...    ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Get an individual grant    ${non_existant_grant_id}
    Check HTTP Response Status Code Is    404
    
    

74
TC_MEC_MEC010p2_MEO_GRANT_004_OK
Elian Kraja's avatar
Elian Kraja committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    [Documentation]    TP_MEC_MEO_GRANT_004_OK
    ...  Check that MEO sends the status of a grant request when a query on a granting ID is performed 
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS 
    Get an individual grant    ${grantId}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   Grant    



*** Keywords ***
Create a GRANT request
    [Arguments]    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
92
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
Elian Kraja's avatar
Elian Kraja committed
93
    ${body}=    Get File    ${file}
94
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants    ${body}    allow_redirects=false
Elian Kraja's avatar
Elian Kraja committed
95
96
97
98
99
100
101
102
103
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get an individual grant
    [Arguments]    ${grantId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
104
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}    allow_redirects=false
Elian Kraja's avatar
Elian Kraja committed
105
106
107
108
109
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}