rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation 5G Bulk PM Usecase functionality |
| 3 | |
| 4 | Library RequestsLibrary |
| 5 | Library OperatingSystem |
| 6 | Library Collections |
| 7 | Library String |
| 8 | Library DateTime |
| 9 | Library SSHLibrary |
| 10 | Library JSONLibrary |
| 11 | Library Process |
| 12 | Library ONAPLibrary.JSON |
| 13 | Library ONAPLibrary.Utilities |
mrichomme | a717217 | 2020-05-15 14:42:12 +0200 | [diff] [blame] | 14 | Resource ../../resources/usecases/5gbulkpm_interface.robot |
| 15 | Resource ../../resources/mr_interface.robot |
| 16 | Resource ../../resources/dr_interface.robot |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 17 | Suite Setup Send File Ready Event to VES Collector test |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 18 | Suite Teardown Usecase Teardown |
| 19 | |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 20 | |
| 21 | |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 22 | *** Variables *** |
| 23 | ${INVENTORY_ENDPOINT} /dcae-service-types |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 24 | ${XNF_SFTP_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml |
| 25 | ${BLUEPRINT_TEMPLATE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/blueprintTemplate.json |
| 26 | ${FTP_FILE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/pmfiles/A20181002.0000-1000-0015-1000_5G.xml.gz |
| 27 | ${DEPLOYMENT_ENDPOINT} dcae-deployments |
| 28 | ${MR_TOPIC_CHECK_PATH} /topics |
| 29 | ${DR_SUB_CHECK_PATH} /internal/prov |
| 30 | ${MR_TOPIC_URL_PATH} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS/CG1/C1 |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 31 | ${MR_TOPIC_URL_PATH_FOR_POST} /events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 32 | ${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients |
| 33 | ${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters |
| 34 | ${PMMAPPER_HEALTH_CHECK_PATH} /healthcheck |
| 35 | ${JSON_DATA_FILE} ${EXECDIR}/robot/assets/usecases/5gbulkpm/Notification.json |
| 36 | ${VES_LISTENER_PATH} /eventListener/v7 |
| 37 | ${PMMAPPER_SUB_ROLE_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/sub.json |
| 38 | ${PMMAPPER_MR_CLUSTER_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/mr_clusters.json |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 39 | ${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 40 | ${SET_KNOWN_HOSTS_FILE_PATH} kubectl set env deployment/$(kubectl get deployment -n onap | grep datafile | awk '{print $1}') KNOWN_HOSTS_FILE_PATH=/home/datafile/.ssh/known_hosts -n onap |
| 41 | ${CHECK_ENV_SET} kubectl set env pod/$(kubectl get pod -n onap | grep datafile | awk '{print $1}') --list -n onap |
| 42 | ${GET_RSA_KEY} kubectl exec $(kubectl get pod -n onap | grep sftpserver | awk '{print $1}') -n onap -- ssh-keyscan -t rsa sftpserver > /tmp/known_hosts |
| 43 | ${COPY_RSA_KEY} kubectl cp /tmp/known_hosts $(kubectl get pod -n onap | grep datafile | awk '{print $1}'):/home/datafile/.ssh/known_hosts -n onap |
| 44 | ${CHECK_DFC_LOGS} kubectl logs $(kubectl get pod -n onap | grep datafile | awk '{print $1}') -n onap --tail=4 |
| 45 | ${EXPECTED_PRINT} StrictHostKeyChecking is enabled but environment variable KNOWN_HOSTS_FILE_PATH is not set or points to not existing file |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 46 | |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 47 | *** Test Cases *** |
| 48 | |
| 49 | Deploying Data File Collector |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 50 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 51 | ${headers}= Create Dictionary content-type=application/json |
| 52 | ${session}= Create Session dfc ${INVENTORY_SERVER} |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 53 | ${resp}= Get Request dfc ${INVENTORY_ENDPOINT}?typeName=k8s-datafile headers=${headers} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 54 | ${json}= Set Variable ${resp.json()} |
| 55 | ${serviceTypeId-Dfc} Set Variable ${json['items'][0]['typeId']} |
| 56 | ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\\") |
| 57 | ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 58 | Set Global Variable ${serviceTypeId-Dfc} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 59 | ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Dfc}", "inputs": {"tag_version": "${image}"}} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 60 | ${session}= Create Session deployment-dfc ${DEPLOYMENT_SERVER} |
| 61 | ${resp}= Put Request deployment-dfc /${DEPLOYMENT_ENDPOINT}/datafile data=${deployment_data} headers=${headers} |
| 62 | ${operationLink} Set Variable ${resp.json().get('links').get('status')} |
| 63 | ${operationId} Fetch From Right ${operationLink} / |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 64 | Wait Until Keyword Succeeds 5 minute 20 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} datafile ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 65 | |
| 66 | Deploying 3GPP PM Mapper |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 67 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 68 | ${clusterdata}= OperatingSystem.Get File ${PMMAPPER_MR_CLUSTER_DATA} |
| 69 | ${headers}= Create Dictionary content-type=application/json |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 70 | ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} |
| 71 | ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLUSTER_PATH} data=${clusterdata} headers=${headers} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 72 | ${session}= Create Session pmmapper ${INVENTORY_SERVER} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 73 | ${resp}= Get Request pmmapper ${INVENTORY_ENDPOINT}?typeName=k8s-pm-mapper headers=${headers} |
| 74 | ${json}= Set Variable ${resp.json()} |
| 75 | ${serviceTypeId-Pmmapper} Set Variable ${json['items'][0]['typeId']} |
| 76 | ${image} Get Regexp Matches ${json['items'][0]['blueprintTemplate']} nexus3(.)*?(?=\') |
| 77 | ${image} Replace String ${image}[0] nexus3.onap.org:10001 ${NEXUS3} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 78 | Set Global Variable ${serviceTypeId-Pmmapper} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 79 | ${deployment_data}= Set Variable {"inputs":{"client_password": "${GLOBAL_DCAE_PASSWORD}", "tag_version": "${image}"},"serviceTypeId": "${serviceTypeId-Pmmapper}"} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 80 | ${session}= Create Session deployment-pmmapper ${DEPLOYMENT_SERVER} |
| 81 | ${resp}= Put Request deployment-pmmapper /${DEPLOYMENT_ENDPOINT}/pmmapper data=${deployment_data} headers=${headers} |
| 82 | ${operationLink} Set Variable ${resp.json().get('links').get('status')} |
| 83 | ${operationId} Fetch From Right ${operationLink} / |
mrichomme | a717217 | 2020-05-15 14:42:12 +0200 | [diff] [blame] | 84 | Wait Until Keyword Succeeds 6 minute 10 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} pmmapper ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 85 | |
| 86 | Deploying SFTP Server As xNF |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 87 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 88 | ${blueprint}= OperatingSystem.Get File ${XNF_SFTP_BLUEPRINT_PATH} |
| 89 | ${templatejson}= Load JSON From File ${BLUEPRINT_TEMPLATE_PATH} |
| 90 | ${templatejson}= Update Value To Json ${templatejson} blueprintTemplate ${blueprint} |
| 91 | ${templatejson}= Update Value To Json ${templatejson} typeName sftpserver |
| 92 | ${json_data} Convert JSON To String ${templatejson} |
| 93 | ${headers}= Create Dictionary content-type=application/json |
| 94 | ${session}= Create Session sftp ${INVENTORY_SERVER} |
| 95 | ${resp}= Post Request sftp ${INVENTORY_ENDPOINT} data=${json_data} headers=${headers} |
| 96 | ${serviceTypeId-Sftp}= Set Variable ${resp.json().get('typeId')} |
| 97 | Set Global Variable ${serviceTypeId-Sftp} |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 98 | ${deployment_data}= Set Variable {"serviceTypeId": "${serviceTypeId-Sftp}" } |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 99 | ${session}= Create Session deployment-sftpserver ${DEPLOYMENT_SERVER} |
| 100 | ${resp}= Put Request deployment-sftpserver /${DEPLOYMENT_ENDPOINT}/sftpserver data=${deployment_data} headers=${headers} |
| 101 | ${operationLink}= Set Variable ${resp.json().get('links').get('status')} |
| 102 | ${operationId} Fetch From Right ${operationLink} / |
Krzysztof Kuzmicki | 52a02b2 | 2020-04-08 12:02:05 +0200 | [diff] [blame] | 103 | Wait Until Keyword Succeeds 2 minute 5 sec Deployment Status ${DEPLOYMENT_SERVER} ${DEPLOYMENT_ENDPOINT} sftpserver ${operationId} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 104 | |
| 105 | |
| 106 | Checking PERFORMANCE_MEASUREMENTS Topic In Message Router |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 107 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 108 | ${headers}= Create Dictionary content-type=application/json |
| 109 | ${subdata}= OperatingSystem.Get File ${PMMAPPER_SUB_ROLE_DATA} |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 110 | ${session}= Create Session dmaapbc ${DMAAP_BC_SERVER} |
| 111 | ${resp}= Post Request dmaapbc ${DMAAP_BC_MR_CLIENT_PATH} data=${subdata} headers=${headers} |
| 112 | Wait Until Keyword Succeeds 5 minute 5 sec Topic Validate success |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 113 | ${resp}= Run MR Get Request ${MR_TOPIC_CHECK_PATH} |
| 114 | Should Be Equal As Strings ${resp.status_code} 200 |
| 115 | ${topics}= Set Variable ${resp.json().get('topics')} |
| 116 | List Should Contain Value ${topics} org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS |
Krzysztof Kuzmicki | ae8615f | 2020-05-29 12:35:06 +0200 | [diff] [blame] | 117 | ${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 118 | Should Be Equal As Strings ${resp.status_code} 200 |
| 119 | |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 120 | Upload PM Files to xNF SFTP Server After Services Deployed |
| 121 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
| 122 | Upload PM Files to xNF SFTP Server ${FTP_FILE_PATH} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 123 | Set Global Variable ${epoch} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 124 | |
| 125 | DR Bulk PM Feed Check |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 126 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 127 | ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} |
| 128 | Should Contain ${resp.text} bulk_pm_feed |
| 129 | |
| 130 | DR PM Mapper Subscriber Check |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 131 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 132 | ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} |
| 133 | Should Contain ${resp.text} https://dcae-pm-mapper:8443/delivery |
| 134 | |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 135 | Sending File Ready Event to VES Collector After Services Deployed |
| 136 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
| 137 | Send File Ready Event to VES Collector ${epoch} |
rajendrajaiswal | 9b723a8 | 2019-11-25 12:18:51 +0000 | [diff] [blame] | 138 | |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 139 | Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic After Services Deployed |
| 140 | [Tags] 5gbulkpm 5gbulkpm_checking_sftp_rsa_key |
mrichomme | 5b52b59 | 2020-05-25 16:42:26 +0200 | [diff] [blame] | 141 | Wait Until Keyword Succeeds 5 minute 5 sec xNF PM File Validate perf3gpp_RnNode-Ericsson_pmMeasResult |
Katarzyna Wasiel | 7ebd4b3 | 2020-12-02 13:39:45 +0100 | [diff] [blame^] | 142 | |
| 143 | Setting Known_Hosts Environment Set |
| 144 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 145 | ${rc}= Run and Return RC ${SET_KNOWN_HOSTS_FILE_PATH} |
| 146 | Should Be Equal As Integers ${rc} 0 |
| 147 | Wait Until Keyword Succeeds 5 min 10s Check Known Hosts In Env ${CHECK_ENV_SET} |
| 148 | ${rc}= Run and Return RC ${GET_RSA_KEY} |
| 149 | Should Be Equal As Integers ${rc} 0 |
| 150 | ${rc}= Run and Return RC ${COPY_RSA_KEY} |
| 151 | Should Be Equal As Integers ${rc} 0 |
| 152 | |
| 153 | Uploading PM Files to xNF SFTP Server After Known_Host Set |
| 154 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 155 | Upload PM Files to xNF SFTP Server ${FTP_FILE_PATH} |
| 156 | Set Global Variable ${epoch} |
| 157 | |
| 158 | Sending File Ready Event to VES Collector After Known_Host Set |
| 159 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 160 | Send File Ready Event to VES Collector ${epoch} |
| 161 | |
| 162 | Verifying 3GPP Perf VES Content On PERFORMANCE_MEASUREMENTS Topic After Known_Host Set |
| 163 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 164 | Wait Until Keyword Succeeds 5 minute 5 sec xNF PM File Validate perf3gpp_RnNode-Ericsson_pmMeasResult |
| 165 | |
| 166 | Checking DFC Logs After Known_Hosts Set |
| 167 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 168 | ${dfc_logs}= Run Given Command On DFC Container ${CHECK_DFC_LOGS} |
| 169 | Should Not Contain ${dfc_logs} ${EXPECTED_PRINT} |
| 170 | |
| 171 | Changing RSA Key Known_Hosts |
| 172 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 173 | ${get_known_hosts_file}= OperatingSystem.Get File /tmp/known_hosts |
| 174 | ${change_rsa_key}= Replace String ${get_known_hosts_file} A a |
| 175 | Create File /tmp/known_hosts ${change_rsa_key} |
| 176 | ${rc}= Run and Return RC ${COPY_RSA_KEY} |
| 177 | Should Be Equal As Integers ${rc} 0 |
| 178 | |
| 179 | Uploading PM Files to xNF SFTP Server After RSA Key Change |
| 180 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 181 | Upload PM Files to xNF SFTP Server ${FTP_FILE_PATH} |
| 182 | Set Global Variable ${epoch} |
| 183 | |
| 184 | Sending File Ready Event to VES Collector After RSA Key Change |
| 185 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 186 | Send File Ready Event to VES Collector ${epoch} |
| 187 | |
| 188 | Checking DFC Logs After RSA Key Change |
| 189 | [Tags] 5gbulkpm_checking_sftp_rsa_key |
| 190 | Wait Until Keyword Succeeds 5 sec 30 sec Check Given Print In DFC LOG ${CHECK_DFC_LOGS} |