Updated VES version to latest
[integration/csit.git] / tests / usecases / 5G-bulkpm / BulkpmE2E.robot
1 *** Settings ***
2 Documentation     Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF
3 Library           RequestsLibrary
4 Library           OperatingSystem
5 Library           Collections
6 Library           Process
7 Resource          resources/bulkpm_keywords.robot
8
9
10 *** Variables ***
11 ${VESC_URL}                              http://%{VESC_IP}:8080
12 ${GLOBAL_APPLICATION_ID}                 robot-ves
13 ${VES_ANY_EVENT_PATH}                    /eventListener/v7
14 ${HEADER_STRING}                         content-type=application/json
15 ${EVENT_DATA_FILE}                       %{WORKSPACE}/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
16
17 ${TARGETURL_TOPICS}                      http://${DMAAP_MR_IP}:3904/topics
18 ${TARGETURL_SUBSCR}                      http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000
19 ${CLI_EXEC_CLI}                          curl -k https://${DR_PROV_IP}:8443/internal/prov
20 ${CLI_EXEC_CLI_DFC}                      docker exec dfc /bin/sh -c "ls /target | grep .gz"
21 ${CLI_EXEC_CLI_FILECONSUMER}             docker exec fileconsumer-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep .gz"
22
23 *** Test Cases ***
24
25 Send VES File Ready Event to VES Collector
26     [Tags]    Bulk_PM_E2E_01
27     [Documentation]   Send VES File Ready Event
28     ${evtdata}=   Get Event Data From File   ${EVENT_DATA_FILE}
29     ${headers}=   Create Header From String    ${HEADER_STRING}
30     ${resp}=  Publish Event To VES Collector    ${VESC_URL}  ${VES_ANY_EVENT_PATH}  ${headers}  ${evtdata}
31     Sleep     15s
32     ${resp}=  Publish Event To VES Collector    ${VESC_URL}  ${VES_ANY_EVENT_PATH}  ${headers}  ${evtdata}
33     Sleep     5s
34     ${resp}=  Publish Event To VES Collector    ${VESC_URL}  ${VES_ANY_EVENT_PATH}  ${headers}  ${evtdata}
35     Sleep     5s
36     ${resp}=  Publish Event To VES Collector    ${VESC_URL}  ${VES_ANY_EVENT_PATH}  ${headers}  ${evtdata}
37     Sleep     5s
38     Log    Receive HTTP Status code ${resp.status_code}
39     Should Be Equal As Strings  ${resp.status_code}     202
40
41 Check VES Notification Topic is existing in Message Router
42     [Tags]                          Bulk_PM_E2E_02
43     [Documentation]                 Get the VES Notification topic on message router
44     [Timeout]                       1 minute
45     Sleep                           10s
46     ${resp}=                        GetCall                         ${TARGETURL_TOPICS}
47     log                             ${TARGETURL_TOPICS}
48     log                             'JSON Response Code :'${resp}
49     ${topics}=                      Evaluate                        $resp.json().get('topics')
50     log                             ${topics}
51     ${ListLength}=                  Get Length                      ${topics}
52     log                             ${ListLength}
53     List Should Contain Value       ${topics}                       unauthenticated.VES_NOTIFICATION_OUTPUT
54
55 Verify Downloaded PM file from xNF exist on Data File Collector
56     [Tags]                          Bulk_PM_E2E_03
57     [Documentation]                 Check the PM XML file exists on the data file collector
58     ${cli_cmd_output}=              Run Process                     ${CLI_EXEC_CLI_DFC}                 shell=yes
59     Log                             ${cli_cmd_output.stdout}
60     Should Be Equal As Strings      ${cli_cmd_output.rc}            0
61     Should Contain                  ${cli_cmd_output.stdout}        xNF.pm.xml.gz
62
63
64 Verify Default Feed And File Consumer Subscription On Datarouter
65     [Tags]                          Bulk_PM_E2E_04
66     [Documentation]                 Verify Default Feed And File Consumer Subscription On Datarouter
67     ${cli_cmd_output}=              Run Process                     ${CLI_EXEC_CLI}                     shell=yes
68     Log                             ${cli_cmd_output.stdout}
69     Should Be Equal As Strings      ${cli_cmd_output.rc}            0
70     Should Contain                  ${cli_cmd_output.stdout}        https://dmaap-dr-prov/publish/1
71     Should Contain                  ${cli_cmd_output.stdout}        http://${DR_SUBSCIBER_IP}:7070
72
73
74 Verify Fileconsumer Receive PM file from Data Router
75     [Tags]                          Bulk_PM_E2E_05
76     [Documentation]                 Check  PM XML file exists on the File Consumer Simulator
77     ${cli_cmd_output}=              Run Process                     ${CLI_EXEC_CLI_FILECONSUMER}        shell=yes
78     Log                             ${cli_cmd_output.stdout}
79     Should Be Equal As Strings      ${cli_cmd_output.rc}            0
80     Should Contain                  ${cli_cmd_output.stdout}        xNF.pm.xml.gz