ccfa496849f3b889eba080d44da5a5fb6a512857
[integration/csit.git] / tests / dcaegen2-pmmapper / pmmapper / pmmapper.robot
1 *** Settings ***
2 Documentation     Testing PM Mapper functionality
3 Resource          ../../common.robot
4 Library           Collections
5 Library           json
6 Library           OperatingSystem
7 Library           RequestsLibrary
8 Library           HttpLibrary.HTTP
9 Library           String
10 Library           Process
11
12
13 *** Variables ***
14 ${BC_URL}                     http://${DMAAPBC_IP}:8080/webapi
15 ${CLI_EXEC_CLI}               curl http://${CBS_IP}:10000/service_component/pmmapper
16 ${FEED1_DATA}                 { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" }
17
18
19 *** Test Cases ***
20
21 Verify pmmapper configuration in consul through CBS
22     [Tags]                          PM_MAPPER_01
23     [Documentation]                 Verify pmmapper configuraiton in consul through CBS
24     ${cli_cmd_output}=              Run Process                     ${CLI_EXEC_CLI}                     shell=yes
25     Log                             ${cli_cmd_output.stdout}
26     Should Contain                  ${cli_cmd_output.stdout}        pm-mapper-filter
27
28 Create DR Feed through Bus Controller
29     [Tags]                          PM_MAPPER_02
30     [Documentation]                 Create Feed on Data Router through Bus Controller
31     ${resp}=                        PostCall    ${BC_URL}/feeds    ${FEED1_DATA}
32     Should Be Equal As Integers     ${resp.status_code}  200
33
34 *** Keywords ***
35
36 PostCall
37     [Arguments]    ${url}           ${data}
38     ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json
39     ${resp}=       Evaluate    requests.post('${url}',data='${data}', headers=${headers},verify=False)    requests
40     [Return]       ${resp}