Commit 4f599a74 authored by lopezaguilar's avatar lopezaguilar
Browse files

Refactoring to analyse all the checks and review the operation to be...

Refactoring to analyse all the checks and review the operation to be controlled in the analysis of the TS
parent aaa90a4e
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -30,11 +30,11 @@ In order to install the ETSI NGSI-LD Test Suite, download the configuration scri


- For MacOS and Ubuntu, download the following file:
- For MacOS and Ubuntu, download the following file:


```$ curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/windows11/scripts/configure.sh > configure.sh```
```$ curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/scripts/configure.sh > configure.sh```


- For Windows, using Powershell download the following file (curl is an alias for Invoke-WebRequest in Powershell):
- For Windows, using Powershell download the following file (curl is an alias for Invoke-WebRequest in Powershell):


```> curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/windows11/scripts/configure.ps1 > configure.ps1```
```> curl https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/scripts/configure.ps1 > configure.ps1```


- For MacOS and Ubuntu, be sure that you have the proper execution permissions of the file and the user is included 
- For MacOS and Ubuntu, be sure that you have the proper execution permissions of the file and the user is included 
in the sudoers group, then execute the following script:
in the sudoers group, then execute the following script:
@@ -100,7 +100,7 @@ Now, you can launch the tests with the following command in MacOS or Linux:


```$ robot --outputdir ./results .```  
```$ robot --outputdir ./results .```  


For Windows system, you can lauch the tests with the following command:
For Windows system, you can launch the tests with the following command:


```> robot --outputdir .\results .\TP\NGSI-LD```
```> robot --outputdir .\results .\TP\NGSI-LD```


@@ -146,8 +146,8 @@ Robot Framework. Our recommendations are:


- Install [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server)
- Install [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server)


- Define as variable the path of the working directory. In Settings > Languages & Frameworks > Robot Framework (Project), 
- Define as variable the path of the working directory. In Settings > Languages & Frameworks > Robot Framework 
insert the following: `{"EXECDIR": "{path}/auth-test-suite"}`
(Project), insert the following: `{"EXECDIR": "{path}/auth-test-suite"}`.




### Run configurations (PyCharm)
### Run configurations (PyCharm)
+6 −6
Original line number Original line Diff line number Diff line
@@ -22,25 +22,25 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building
    [Tags]    e-query    5_7_2
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response1}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response1.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response2}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response2.status_code}
    ${third_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${third_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${third_entity_id}
    Set Suite Variable    ${third_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response3}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${third_entity_id}
    ...    ${third_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response3.status_code}
    @{entities_ids_to_be_compared}=    Create List    ${first_entity_id}    ${second_entity_id}
    @{entities_ids_to_be_compared}=    Create List    ${first_entity_id}    ${second_entity_id}
    ${entities_ids_to_be_retrieved}=    Catenate    SEPARATOR=,    ${first_entity_id}    ${second_entity_id}
    ${entities_ids_to_be_retrieved}=    Catenate    SEPARATOR=,    ${first_entity_id}    ${second_entity_id}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${entity_type}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${entity_type}
+10 −10
Original line number Original line Diff line number Diff line
@@ -28,34 +28,34 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking
    [Tags]    e-query    5_7_2
    [Tags]    e-query    5_7_2
    ${building_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${building_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${building_entity_id}
    Set Suite Variable    ${building_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response1}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${building_filename}
    ...    ${building_entity_id}
    ...    ${building_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response1.status_code}
    ${vehicle_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${vehicle_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    Set Suite Variable    ${vehicle_entity_id}
    Set Suite Variable    ${vehicle_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response2}=    Create Entity Selecting Content Type
    ...    ${vehicle_filename}
    ...    ${vehicle_filename}
    ...    ${vehicle_entity_id}
    ...    ${vehicle_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response2.status_code}
    ${parking_entity_id}=    Generate Random Entity Id    ${parking_id_prefix}
    ${parking_entity_id}=    Generate Random Entity Id    ${parking_id_prefix}
    Set Suite Variable    ${parking_entity_id}
    Set Suite Variable    ${parking_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response3}=    Create Entity Selecting Content Type
    ...    ${parking_filename}
    ...    ${parking_filename}
    ...    ${parking_entity_id}
    ...    ${parking_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response3.status_code}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${vehicle_entity_type}    ${parking_entity_type}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${vehicle_entity_type}    ${parking_entity_type}
    ${response}=    Query Entities    entity_types=${entity_types_to_be_retrieved}    accept=${CONTENT_TYPE_LD_JSON}
    ${response}=    Query Entities    entity_types=${entity_types_to_be_retrieved}    accept=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    200    ${response.status_code}
    Check Response Status Code    200    ${response.status_code}
    @{entities_ids_to_be_compared}=    Create List    ${vehicle_entity_id}    ${parking_entity_id}
    @{entities_ids_to_be_compared}=    Create List    ${vehicle_entity_id}    ${parking_entity_id}
    Check Response Body Containing List Containing Entity Elements With Different Types
    Check Response Body Containing List Containing Entity Elements With Different Types
    ...    ${expectation_filename}
    ...    filename=${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    entities_representation_ids=${entities_ids_to_be_compared}
    ...    ${response.json()}
    ...    response_body=${response.json()}
    ...    ${True}
    ...    ignore_core_context_version=${True}




*** Keywords ***
*** Keywords ***
+7 −7
Original line number Original line Diff line number Diff line
@@ -23,18 +23,18 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.*
    [Tags]    e-query    5_7_2
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response1}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response1.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response2}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response2.status_code}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${entity_type}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    ${entity_type}
    @{entities_ids_to_be_compared}=    Create List    ${second_entity_id}    ${first_entity_id}
    @{entities_ids_to_be_compared}=    Create List    ${second_entity_id}    ${first_entity_id}
    ${response}=    Query Entities
    ${response}=    Query Entities
@@ -42,9 +42,9 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.*
    ...    entity_types=${entity_types_to_be_retrieved}
    ...    entity_types=${entity_types_to_be_retrieved}
    Check Response Status Code    200    ${response.status_code}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing Entity Elements
    Check Response Body Containing List Containing Entity Elements
    ...    ${expectation_filename}
    ...    expectation_filename=${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    entities_ids=${entities_ids_to_be_compared}
    ...    ${response.json()}
    ...    response_body=${response.json()}




*** Keywords ***
*** Keywords ***
+4 −10
Original line number Original line Diff line number Diff line
@@ -25,18 +25,18 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego
    [Tags]    e-query    5_7_2
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response1}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response1.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${create_response2}=    Create Entity Selecting Content Type
    ...    ${filename2}
    ...    ${filename2}
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${create_response2.status_code}
    ${attributes_to_be_retrieved}=    Catenate
    ${attributes_to_be_retrieved}=    Catenate
    ...    SEPARATOR=,
    ...    SEPARATOR=,
    ...    ${attribute_airqualitylevel}
    ...    ${attribute_airqualitylevel}
@@ -49,12 +49,6 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego
    ...    ${entities_ids_to_be_compared}
    ...    ${entities_ids_to_be_compared}
    ...    ${response.json()}
    ...    ${response.json()}


    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing Entity Elements
    ...    ${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    ${response.json()}



*** Keywords ***
*** Keywords ***
Delete Entities
Delete Entities
Loading