Commit 8bd05da7 authored by Gabriele Scivoletto's avatar Gabriele Scivoletto
Browse files

MEC028 completed for AP_INFO and EXT_SUB

parent c93fc816
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -9,13 +9,12 @@ Library String
Library     OperatingSystem
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false


*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_001_OK
TC_MEC_MEC028_SRV_WAI_001_OK
    [Documentation] 
    ...  Check that the IUT responds with the list of WLAN Access Point
    ...  Reference "ETSI GS MEC 028 2.2.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo ##Outdated
    ...  Reference "ETSI GS MEC 028 2.3.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/ApInfo
    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Retrieve the access point information
@@ -28,11 +27,11 @@ TP_MEC_MEC028_SRV_WAI_001_OK
    END
    Should Be True    ${passed}
   
TP_MEC_MEC028_SRV_WAI_002_OK
TC_MEC_MEC028_SRV_WAI_002_OK
    [Documentation] 
    ...  Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter 
    ...  Reference "ETSI GS MEC 028 2.2.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo ##Outdated
    ...  Reference "ETSI GS MEC 028 2.3.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/ApInfo
    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Retrieve the access point information using filters    ${filter} 
@@ -46,11 +45,11 @@ TP_MEC_MEC028_SRV_WAI_002_OK
    Should Be True    ${passed}
   

TP_MEC_MEC028_SRV_WAI_002_BR
TC_MEC_MEC028_SRV_WAI_002_BR
    [Documentation] 
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application 
    ...  Reference "ETSI GS MEC 028 2.2.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo ##Outdated
    ...  Reference "ETSI GS MEC 028 2.3.1, clause 7.3.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/ApInfo
    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Retrieve the access point information using filters    ${bad_filter} 
@@ -79,3 +78,6 @@ Retrieve the access point information using filters
    GET     ${apiRoot}/${apiName}/${apiVersion}/queries/ap/ap_information?filter=${filter}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


      
+9 −4
Original line number Diff line number Diff line
@@ -4,11 +4,16 @@ ${apiName} wai
${apiVersion}     v2

${MEC-APP_SCHEMA}                   http
${MEC-APP_HOST}                     127.0.0.1
${MEC-APP_PORT}                     8082
${MEC-APP_HOST}                     mockoon
${MEC-APP_PORT}                     3001

${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
 
${MAC_ID}          macId01
${filter}                           (eq,apId/macId,macId01)
${bad_filter}                           (eq,apId/mac,macId01)
 No newline at end of file
${filter}                           macId01
${bad_filter}                           badMacId

${REGISTER_ACTION}        REGISTER
${REMOVE_ACTION}          REMOVE 
${NO_ACTION}              NO_ACTION
${DEVICE_ID_PLACEHOLDER}    PLACEHOLDER_DEVICEID
+0 −0

Empty file added.

+5 −5
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@
        "geolocation": {
          "properties": {
            "altitude": {
              "description": "The altitude value of location as defined in IETF RFC6225 [6]",
              "description": "The altitude value of location as defined in IETF RFC 6225 [6]",
              "format": "uint32",
              "type": "integer",
              "x-etsi-mec-cardinality": "0..1",
@@ -276,7 +276,7 @@
              "x-etsi-mec-origin-type": "Uint8"
            },
            "lat": {
              "description": "The latitude value of location as defined in IETF RFC6225 [6]",
              "description": "The latitude value of location as defined in IETF RFC�6225 [6]",
              "format": "int64",
              "type": "integer",
              "x-etsi-mec-cardinality": "1",
@@ -290,7 +290,7 @@
              "x-etsi-mec-origin-type": "Uint8"
            },
            "long": {
              "description": "The longitude value of location as defined in IETF RFC6225 [6]",
              "description": "The longitude value of location as defined in IETF RFC�6225 [6]",
              "format": "int64",
              "type": "integer",
              "x-etsi-mec-cardinality": "1",
@@ -375,7 +375,7 @@
          "x-etsi-mec-origin-type": "Uint16"
        },
        "channelUtilization": {
          "description": "The percentage of time, linearly scaled with 255 representing 100%, that the AP sensed the medium was busy, as indicated by either the physical or virtual Carrier Sense (CS) mechanism.",
          "description": "The percentage of time, linearly scaled with 255 representing 100�%, that the AP sensed the medium was busy, as indicated by either the physical or virtual Carrier Sense (CS) mechanism.",
          "format": "uint8",
          "type": "integer",
          "x-etsi-mec-cardinality": "1",
@@ -435,7 +435,7 @@
          "x-etsi-mec-origin-type": "Uint8"
        },
        "spatStreamUnderUtil": {
          "description": "The percentage of time, linearly scaled with 255 representing 100%, that the AP has underutilized spatial domain resources for given busy time of the medium.",
          "description": "The percentage of time, linearly scaled with 255 representing 100�%, that the AP has underutilized spatial domain resources for given busy time of the medium.",
          "format": "uint8",
          "type": "integer",
          "x-etsi-mec-cardinality": "1",
+74 −20
Original line number Diff line number Diff line
@@ -5,16 +5,21 @@
Resource    environment/variables.txt
Resource    ../../../pics.txt
Resource    ../../../GenericKeywords.robot
Library     Collections
Library     String
Library     OperatingSystem
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false

*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_008_OK
TC_MEC_MEC028_SRV_WAI_008_OK
    [Documentation] 
    ...  Check that the IUT responds with the list of Subscription"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription ##Outdated
    ...	 Reference "ETSI GS MEC 028 2.3.1, clause 7.6.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription 
    
    [Setup]  Create New Subscription Info    ${SUB_ID}
    Set Suite Variable    ${Location}    ${response['headers']['Location']}  

    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Retrieve existing subscription information  ${SUB_ID}
@@ -22,25 +27,31 @@ TP_MEC_MEC028_SRV_WAI_008_OK
    Check HTTP Response Body Json Schema Is   AssocStaSubscription
    Should Be Equal As Strings  ${response['body']['subscriptionType']}    ${SUB_TYPE}
    Should Be Equal As Strings  ${response['body']['callbackReference']}    ${CALLBACK_URI}
    Should Be Equal As Strings  ${response['body']['apId']['macId']}    ${MAC_ID}
    Should Be Equal As Strings  ${response['body']['apId']['bssid']}    ${BSSID}

    [TearDown]  Remove Subscription Info    ${Location}  
   
TP_MEC_MEC028_SRV_WAI_008_NF
TC_MEC_MEC028_SRV_WAI_008_NF
    [Documentation] 
    ...  Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription ##Outdated
    ...	 Reference "ETSI GS MEC 028 2.3.1, clause 7.6.3.1
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription 
    [Setup]  Remove Subscription Info Using SubId    ${SUB_ID}

    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Retrieve existing subscription information  ${NOT_EXISTING_SUB_ID}
    Check HTTP Response Status Code Is    404 


*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_009_OK
TC_MEC_MEC028_SRV_WAI_009_OK
    [Documentation] 
    ...  Check that the IUT responds with a Notification Subscription when it is modified"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.2
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription ##Outdated
    ...	 Reference "ETSI GS MEC 028 2.3.1, clause 7.6.3.2
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
    [Setup]  Create New Subscription Info    ${SUB_ID}
    Set Suite Variable    ${Location}    ${response['headers']['Location']} 

    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Modify existing subscription information  ${SUB_ID}   UpdateAssocStaSubscription.json
@@ -50,30 +61,39 @@ TP_MEC_MEC028_SRV_WAI_009_OK
    Should Be Equal As Strings  ${response['body']['callbackReference']}    ${NEW_CALLBACK_URI}
    Should Be Equal As Strings  ${response['body']['apId']['macId']}    ${MAC_ID}

TP_MEC_MEC028_SRV_WAI_009_BR
    [TearDown]  Remove Subscription Info    ${Location}  
   
TC_MEC_MEC028_SRV_WAI_009_BR
    [Documentation] 
    ...  Check that the IUT responds with an error when an invalid field is set in the subscription modification request"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.2
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription ##Outdated
    ...	 Reference "ETSI GS MEC 028 2.3.1, clause 7.6.3.2
    ...  https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.3.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Modify existing subscription information  ${SUB_ID}   UpdateAssocStaSubscription_BR.json
    Modify existing subscription information  ${BAD_REQUEST_SUB_ID}   UpdateAssocStaSubscription_BR.json
    Check HTTP Response Status Code Is    400


TP_MEC_MEC028_SRV_WAI_010_OK
TC_MEC_MEC028_SRV_WAI_010_OK
    [Documentation] 
    ...  Check that the IUT responds with 204 when an existing subscription is correctly deleted"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.5
    ...	 Reference "ETSI GS MEC 028 2.3.1, clause 7.6.3.5
    
    [Setup]  Create New Subscription Info    ${SUB_ID}
    Set Suite Variable    ${Location}    ${response['headers']['Location']} 

    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Remove existing subscription information  ${SUB_ID}
    Check HTTP Response Status Code Is    204  

TP_MEC_MEC028_SRV_WAI_010_NF
TC_MEC_MEC028_SRV_WAI_010_NF
    [Documentation] 
    ...  Check that the IUT responds with an error when an not existing subscription cannot be deleted"
    ...	 Reference "ETSI GS MEC 028 2.2.1, clause 7.6.3.5
    
    [Setup]  Remove Subscription Info Using SubId    ${NOT_EXISTING_SUB_ID}

    Should Be True    ${PIC_MEC_SYSTEM} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Remove existing subscription information  ${NOT_EXISTING_SUB_ID}
@@ -116,3 +136,37 @@ Remove existing subscription information
    DELETE     ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Create New Subscription Info
    [Arguments]     ${content}   
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
     
    ${file}=    Catenate    SEPARATOR=    jsons/    CreateAssocStaSubscription    .json
    ${body}=    Get File    ${file}
    ${json_data}=    Evaluate    json.loads('''${body}''')    json
    Log    Original JSON: ${json_data}
    ${new_href}=    Set Variable    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}/${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID}
    Set To Dictionary    ${json_data["_links"]["self"]}    href=${new_href}
    ${modified_json_string}=    Evaluate    json.dumps(${json_data})
    
    POST   ${apiRoot}/${apiName}/${apiVersion}/subscriptions   ${modified_json_string}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Remove Subscription Info 
    [Arguments]     ${delete_url}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
     
    DELETE    ${delete_url}

Remove Subscription Info Using SubId
    [Arguments]     ${SUB_ID}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    DELETE     ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}/${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID}
 No newline at end of file
Loading