diff options
author | efiacor <fiachra.corcoran@est.tech> | 2023-03-14 18:19:10 +0000 |
---|---|---|
committer | efiacor <fiachra.corcoran@est.tech> | 2023-03-14 18:43:39 +0000 |
commit | 5014a4ffcfdca9a08cb172036e709c3fd93ac3d5 (patch) | |
tree | 7fc897acc32a6a8b56ed036a79eb7e442094efaf /robot | |
parent | 8cbfadcfa9bd2cc1b062040f30e02f5be99e0ac8 (diff) |
[ROBOT] Clean up 5gbulkpm
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I4656d05892fa16dfe4ac05a096140fd9d8a511ee
Issue-ID: OOM-3100
Diffstat (limited to 'robot')
-rw-r--r-- | robot/assets/helm/pm-https-server/Chart.yaml | 2 | ||||
-rw-r--r-- | robot/assets/templates/dcaemod/compspec_with_config_volume.jinja | 61 | ||||
-rw-r--r-- | robot/assets/templates/dcaemod/compspec_without_config_volume.jinja | 57 | ||||
-rw-r--r-- | robot/assets/templates/dfc/consul.jinja | 31 | ||||
-rw-r--r-- | robot/assets/templates/dfc/notification.jinja | 2 | ||||
-rw-r--r-- | robot/assets/usecases/5gbulkpm/k8s-https.yaml | 78 | ||||
-rw-r--r-- | robot/assets/usecases/5gbulkpm/k8s-sftp.yaml | 29 | ||||
-rw-r--r-- | robot/assets/usecases/5gbulkpm/mr_clusters.json | 6 | ||||
-rw-r--r-- | robot/assets/usecases/5gbulkpm/sub.json | 10 | ||||
-rw-r--r-- | robot/resources/chart_museum.robot | 9 | ||||
-rw-r--r-- | robot/resources/dcae/inventory.robot | 46 | ||||
-rw-r--r-- | robot/resources/dcaemod_interface.robot | 310 | ||||
-rw-r--r-- | robot/resources/strimzi_kafka.robot | 23 | ||||
-rw-r--r-- | robot/resources/usecases/5gbulkpm_helm_interface.robot | 143 | ||||
-rw-r--r-- | robot/testsuites/dcaemod.robot | 97 |
15 files changed, 84 insertions, 820 deletions
diff --git a/robot/assets/helm/pm-https-server/Chart.yaml b/robot/assets/helm/pm-https-server/Chart.yaml index 6d95377a..a29ff791 100644 --- a/robot/assets/helm/pm-https-server/Chart.yaml +++ b/robot/assets/helm/pm-https-server/Chart.yaml @@ -24,4 +24,4 @@ appVersion: 1.0.1 dependencies: - name: repositoryGenerator version: x.x-x - repository: '@chart-museum' + repository: 'https://nexus3.onap.org/repository/onap-helm-testing/' diff --git a/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja b/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja deleted file mode 100644 index 958decd9..00000000 --- a/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja +++ /dev/null @@ -1,61 +0,0 @@ -{"owner": "owner-name", "spec": -{ - "self": { - "version": "1.0.0", - "name": "{{comp_spec_name}}", - "description": "Dummy DCAE app with config volume", - "component_type": "docker" - }, - "streams": { - "subscribes": [], - "publishes": [] - }, - "services": { - "calls": [], - "provides": [] - }, - "parameters": [], - "auxilary": { - "helm": { - "service": { - "type": "ClusterIP", - "name": "{{comp_spec_name}}", - "ports": [{ - "name": "http", - "port": 80 - }] - } - }, - "healthcheck": { - "type": "HTTP", - "interval": "45s", - "timeout": "15s", - "port": 80, - "endpoint": "/" - }, - "volumes": [{ - "config_volume": { - "name": "{{config_map_name}}" - }, - "container": { - "bind": "{{volume_mount_path}}" - } - }], - "ports": [ - "80:0", - "99:0" - ], - "tls_info":{ - "cert_directory":"/opt/app/dcae-certificate/", - "use_tls": false, - "use_external_tls": false - } - }, - "artifacts": [ - { - "type": "docker image", - "uri": "docker.io/nginx:latest" - } - ] -} -}
\ No newline at end of file diff --git a/robot/assets/templates/dcaemod/compspec_without_config_volume.jinja b/robot/assets/templates/dcaemod/compspec_without_config_volume.jinja deleted file mode 100644 index 361a9934..00000000 --- a/robot/assets/templates/dcaemod/compspec_without_config_volume.jinja +++ /dev/null @@ -1,57 +0,0 @@ -{"owner": "owner-name", "spec": -{ - "self": { - "version": "1.0.0", - "name": "{{comp_spec_name}}", - "description": "Dummy DCAE app", - "component_type": "docker" - }, - "streams": { - "subscribes": [], - "publishes": [] - }, - "services": { - "calls": [], - "provides": [] - }, - "parameters": [], - "auxilary": { - "helm": { - "service": { - "type": "ClusterIP", - "name": "{{comp_spec_name}}", - "ports": [{ - "name": "http", - "port": 80 - }] - } - }, - "healthcheck": { - "type": "HTTP", - "interval": "45s", - "timeout": "15s", - "port": 80, - "endpoint": "/" - }, - "ports": [ - "80:0", - "99:0" - ], - "log_info": { - "log_directory": "/opt/logs/test" - }, - - "tls_info":{ - "cert_directory":"/opt/app/dcae-certificate/", - "use_tls": false, - "use_external_tls": false - } - }, - "artifacts": [ - { - "type": "docker image", - "uri": "docker.io/nginx:latest" - } - ] -} -}
\ No newline at end of file diff --git a/robot/assets/templates/dfc/consul.jinja b/robot/assets/templates/dfc/consul.jinja deleted file mode 100644 index f630f976..00000000 --- a/robot/assets/templates/dfc/consul.jinja +++ /dev/null @@ -1,31 +0,0 @@ -{ - "service_calls": [], - "streams_publishes": { - "PM_MEAS_FILES": { - "dmaap_info": "<<feed0>>", - "type": "data_router" - } - }, - "dmaap.certificateConfig.keyCert": "/opt/app/datafile/etc/cert/cert.p12", - "dmaap.certificateConfig.keyPasswordPath": "/opt/app/datafile/etc/cert/p12.pass", - "dmaap.certificateConfig.trustedCa": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.certificateConfig.trustedCaPasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.enableDmaapCertAuth": true, - "dmaap.certificateConfig.httpsHostnameVerify": {{httpsHostnameVerify}}, - "dmaap.security.keyStorePasswordPath": "/opt/app/datafile/etc/cert/jks.pass", - "dmaap.security.keyStorePath": "/opt/app/datafile/etc/cert/cert.jks", - "dmaap.security.trustStorePasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.trustStorePath": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.dmaapConsumerConfiguration.consumerGroup": "OpenDcae-c12", - "dmaap.dmaapConsumerConfiguration.consumerId": "C12", - "dmaap.dmaapConsumerConfiguration.timeoutMs": -1, - "sftp.security.strictHostKeyChecking": true, - "streams_subscribes": { - "dmaap_subscriber": { - "type": "message_router", - "dmaap_info": { - "topic_url": "https://message-router:3905/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - } - } - } -}
\ No newline at end of file diff --git a/robot/assets/templates/dfc/notification.jinja b/robot/assets/templates/dfc/notification.jinja index 83396c29..0c28c277 100644 --- a/robot/assets/templates/dfc/notification.jinja +++ b/robot/assets/templates/dfc/notification.jinja @@ -22,7 +22,7 @@ { "name": "{{pm_file}}", "hashMap": { - "location": "https://{{https_server_host}}:443/{{pm_file}}", + "location": "http://{{https_server_host}}:8080/{{pm_file}}", "compression": "gzip", "fileFormatType": "{{fileFormatType}}", "fileFormatVersion": "{{fileFormatVersion}}" diff --git a/robot/assets/usecases/5gbulkpm/k8s-https.yaml b/robot/assets/usecases/5gbulkpm/k8s-https.yaml deleted file mode 100644 index ac1d69a1..00000000 --- a/robot/assets/usecases/5gbulkpm/k8s-https.yaml +++ /dev/null @@ -1,78 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: - - 'http://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml' - - 'plugin:k8splugin?version=>=3.4.2,<4.0.0' -inputs: - tag_version: - type: string - description: Docker image to be used - default: 'nexus3.onap.org:10001/onap/org.onap.integration.nfsimulator.pmhttpsserver:latest' - replicas: - type: integer - description: Number of instances - default: 1 - external_cert_cert_type: - type: string - description: Output type - default: 'PEM' - external_cert_ca_name: - type: string - description: Name of Certificate Authority configured on CertService side. - default: 'RA' - external_cert_common_name: - type: string - description: Common name which should be present in certificate. - default: 'https-server' - external_cert_sans: - type: string - description: 'List of Subject Alternative Names (SANs) which should be present - in certificate. Delimiter - , Should contain common_name value and other FQDNs - under which given component is accessible.' - default: 'https-server' - external_cert_use_external_tls: - type: boolean - description: Flag to indicate external tls enable/disable. - default: true - service_component_type: - type: string - default: "https-server" - service_component_name_override: - type: string - default: "https-server" - enable_tls: - type: boolean - default: false -node_templates: - httpsserver: - type: dcae.nodes.ContainerizedServiceComponent - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - - '8080:0' - - '443:0' - properties: - service_component_type: { get_input: service_component_type } - service_component_name_override: { get_input: service_component_name_override } - image: { get_input: tag_version } - replicas: { get_input: replicas } - always_pull_image: true - tls_info: - cert_directory: '/etc/apache2/certs/' - use_tls: - get_input: enable_tls - external_cert: - external_cert_directory: '/etc/apache2/certs/' - use_external_tls: - get_input: external_cert_use_external_tls - cert_type: - get_input: external_cert_cert_type - ca_name: - get_input: external_cert_ca_name - external_certificate_parameters: - common_name: - get_input: external_cert_common_name - sans: - get_input: external_cert_sans diff --git a/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml b/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml deleted file mode 100644 index 568fdf2a..00000000 --- a/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml +++ /dev/null @@ -1,29 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: - - 'http://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml' - - 'plugin:k8splugin?version=>=3.4.2,<4.0.0' -inputs: - tag_version: - type: string - description: Docker image to be used - default: 'atmoz/sftp' - replicas: - type: integer - description: Number of instances - default: 1 -node_templates: - sftpserver: - type: dcae.nodes.ContainerizedServiceComponent - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - SFTP_USERS: bulkpm:bulkpm:::upload - ports: - - '22:32222' - properties: - service_component_type: sftpserver - service_component_name_override: sftpserver - image: { get_input: tag_version } - replicas: { get_input: replicas } diff --git a/robot/assets/usecases/5gbulkpm/mr_clusters.json b/robot/assets/usecases/5gbulkpm/mr_clusters.json deleted file mode 100644 index 9e732d2a..00000000 --- a/robot/assets/usecases/5gbulkpm/mr_clusters.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dcaeLocationName": "san-francisco", - "fqdn": "message-router", - "topicProtocol": "http", - "topicPort": "3904" -} diff --git a/robot/assets/usecases/5gbulkpm/sub.json b/robot/assets/usecases/5gbulkpm/sub.json deleted file mode 100644 index 45554b9a..00000000 --- a/robot/assets/usecases/5gbulkpm/sub.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dcaeLocationName": "san-francisco", - "fqtn": "org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS", - "clientIdentity": "dcae@dcae.onap.org", - "action": [ - "view", - "pub", - "sub" - ] -} diff --git a/robot/resources/chart_museum.robot b/robot/resources/chart_museum.robot index 75accc68..b2a1e925 100644 --- a/robot/resources/chart_museum.robot +++ b/robot/resources/chart_museum.robot @@ -10,6 +10,15 @@ Library String ${registry_ovveride} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} *** Keywords *** +Add OOM test chart repository + [Documentation] Add OOM test chart repository to helm in robot/xtesting pod + [Arguments] ${chart_repo_name} ${chart_repo_fqdn} + ${helm_repo_add}= Set Variable helm repo add ${chart_repo_name} ${chart_repo_fqdn} + ${command_output} = Run And Return Rc And Output ${helm_repo_add} + Should Be Equal As Integers ${command_output[0]} 0 + ${command_output} = Run And Return Rc And Output helm repo update + Should Be Equal As Integers ${command_output[0]} 0 + Add chart repository [Documentation] Add chart repository to helm in robot/xtesting pod [Arguments] ${chart_repo_name} ${chart_repo_fqdn} ${chart_repo_username} ${chart_repo_password} diff --git a/robot/resources/dcae/inventory.robot b/robot/resources/dcae/inventory.robot deleted file mode 100644 index 44f8202d..00000000 --- a/robot/resources/dcae/inventory.robot +++ /dev/null @@ -1,46 +0,0 @@ -*** Settings *** -Documentation The main interface for interacting with 5G Bulkpm. -Library RequestsLibrary -Library OperatingSystem -Library String -Library ONAPLibrary.Templating WITH NAME Templating -Resource ../global_properties.robot - - -*** Variables *** -${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT} -${INVENTORY_ENDPOINT} /dcae-service-types -${BLUEPRINT_TEMPLATE} ${EXECDIR}/robot/assets/cmpv2/blueprintTemplate.json -*** Keywords *** - -Load Blueprint To Inventory - [Arguments] ${blueprint_path} ${typeName} - Disable Warnings - ${blueprint}= OperatingSystem.Get File ${blueprint_path} - ${templatejson}= Load JSON From File ${BLUEPRINT_TEMPLATE} - ${templatejson}= Update Value To Json ${templatejson} blueprintTemplate ${blueprint} - ${templatejson}= Update Value To Json ${templatejson} typeName ${typeName} - ${data} Convert JSON To String ${templatejson} - ${headers}= Create Dictionary content-type=application/json - ${session}= Create Session inventory_session ${INVENTORY_SERVER} - ${resp}= Post Request inventory_session ${INVENTORY_ENDPOINT} data=${data} headers=${headers} - ${serviceTypeId}= Set Variable ${resp.json().get('typeId')} - [Return] ${serviceTypeId} - -Delete Blueprint From Inventory - [Arguments] ${serviceTypeId} - Disable Warnings - ${session}= Create Session inventory_session ${INVENTORY_SERVER} - ${resp}= Delete Request inventory_session ${INVENTORY_ENDPOINT}/${serviceTypeId} - [Return] ${resp} - -Get Blueprint From Inventory - [Arguments] ${typeName} - Disable Warnings - ${headers}= Create Dictionary content-type=application/json - ${session}= Create Session inventory_session ${INVENTORY_SERVER} - ${resp}= Get Request inventory_session ${INVENTORY_ENDPOINT}?typeName=${typeName} headers=${headers} - Should Not Be Equal As Integers ${resp.json().get('totalCount')} 0 msg=Blueprint ${typeName} does not exist in inventory! - [Return] ${resp} - - diff --git a/robot/resources/dcaemod_interface.robot b/robot/resources/dcaemod_interface.robot deleted file mode 100644 index 19720e80..00000000 --- a/robot/resources/dcaemod_interface.robot +++ /dev/null @@ -1,310 +0,0 @@ -*** Settings *** -Library ONAPLibrary.Templating WITH NAME Templating -Library ONAPLibrary.Utilities -Library RequestsLibrary -Library Collections -Library String -Library OperatingSystem -Resource ../resources/global_properties.robot -Resource chart_museum.robot - - -*** Variables *** - -${CLIENT_ID} robot123 -${SESSION_NAME} nifi-api -${DCAEMOD_SERVER} http://dcaemod.simpledemo.onap.org -${IS_PROCESS_GROUP_SET} False -${IS_FLOW_DISTRIBUTED} False -${IS_SERVICE_DEPLOYED} False -${PROCESS_GROUP_ID} ${EMPTY} -${TYPE_ID} ${EMPTY} -${BLUEPRINT_NAME} ${EMPTY} -${DISTRIBUTION_TARGET_ID} ${EMPTY} -${REGISTRY_CLIENT_ID} ${EMPTY} -${DCAEMOD_ONBOARDING_API_SERVER} ${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_NAME}:${GLOBAL_DCAEMOD_ONBOARDING_API_SERVER_PORT} -${DCAEMOD_DESIGNTOOL_SERVER} ${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_NAME}:${GLOBAL_DCAEMOD_DESIGNTOOL_SERVER_PORT} -${DCAEMOD_DISTRIBUTOR_API_SERVER} ${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_PROTOCOL}://${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_NAME}:${GLOBAL_DCAEMOD_DISTRIBUTOR_API_SERVER_PORT} -${HELM_RELEASE} kubectl --namespace onap get pods | sed 's/ .*//' | grep robot | sed 's/-.*//' - - -*** Keywords *** - -Deploy DCAE Application - [Arguments] ${componentSpec} ${dict_values} ${compSpecName} ${processGroupName} - - Onboard Component Spec ${componentSpec} ${dict_values} ${compSpecName} - ${processGroupId} = Create Process Group ${processGroupName} - Set Test Variable ${IS_PROCESS_GROUP_SET} True - Set Test Variable ${PROCESS_GROUP_ID} ${processGroupId} - - Create Processor ${PROCESS_GROUP_ID} ${compSpecName} - Save Flow By Version Controlling ${processGroupName} ${PROCESS_GROUP_ID} - Distribute The Flow ${PROCESS_GROUP_ID} - Set Test Variable ${IS_FLOW_DISTRIBUTED} True - - Deploy Applictaion ${processGroupName} ${compSpecName} - Set Test Variable ${CHART_NAME} ${compSpecName} - - - -Delete Config Map With Mounted Config File - ${configMapStatus} = Run Keyword And Return Status Config Map Exists ${CONFIG_MAP_NAME} - Run Keyword If ${configMapStatus} Delete Config Map ${CONFIG_MAP_NAME} - Remove File ${CONFIG_MAP_FILE} - -Delete Config Map - [Arguments] ${configMapName} - ${configMapDelete} = Run And Return Rc kubectl -n onap delete configmap ${configMapName} - Should Be Equal As Integers ${configMapDelete} 0 - -Create Config Map From File - [Arguments] ${configMapName} ${configMapFilePath} - - ${createConfigMapRC} = Run And Return Rc kubectl -n onap create configmap ${configMapName} --from-file=${configMapFilePath} - Should Be Equal As Integers ${createConfigMapRC} 0 - Wait Until Keyword Succeeds 1 min 5s Config Map Exists ${configMapName} - -Config Map Exists - [Arguments] ${configMapName} - ${configMapExists} = Run And Return Rc kubectl -n onap get configmap | grep ${configMapName} - Should Be Equal As Integers ${configMapExists} 0 - -Get Pod Yaml - [Arguments] ${compSpecName} - ${podYaml} = Run And Return Rc And Output kubectl -n onap get pod $(kubectl get pod -n onap | grep ${compSpecName} | awk '{print $1}') -o yaml - Should Be Equal As Integers ${podYaml[0]} 0 - ${podYaml} = Set Variable ${podYaml[1]} - - [Return] ${podYaml} - -Get Content Of Mounted Folder Inside Container - [Arguments] ${compSpecName} ${volumeMountPath} - ${mountedFolderContent} = Run And Return Rc And Output kubectl -n onap exec $(kubectl get pod -n onap | grep ${compSpecName} | awk '{print $1}') -c ${compSpecName} -- ls ${volumeMountPath} - Should Be Equal As Integers ${mountedFolderContent[0]} 0 - ${mountedFolderContent} = Set Variable ${mountedFolderContent[1]} - - [Return] ${mountedFolderContent} - -Verify If Volume Is Mounted - [Arguments] ${podYaml} ${volumeMountPath} - Should Contain ${podYaml} ${volumeMountPath} - -Verify If Config Map Is Mounted As Volume - [Arguments] ${podYaml} ${configMapName} - Should Contain ${podYaml} ${configMapName} - -Verify If Mounted Folder Is Empty - [Arguments] ${mountedFolderContent} - Should Be Empty ${mountedFolderContent} - -Verify If Mounted Folder Contains File - [Arguments] ${compSpecName} ${fileName} ${configMapDir} - - ${dirContent} = Run And Return Rc And Output kubectl -n onap exec $(kubectl get pod -n onap | grep ${compSpecName} | awk '{print $1}') -c ${compSpecName} -- ls ${configMapDir} - Should Be Equal As Integers ${dirContent[0]} 0 - Should Contain ${dirContent[1]} ${fileName} - -Verify File Content - [Arguments] ${compSpecName} ${configMapFilePath} ${content} - - ${fileContent} = Run And Return Rc And Output kubectl -n onap exec $(kubectl get pod -n onap | grep ${compSpecName} | awk '{print $1}') -c ${compSpecName} -- cat ${configMapFilePath} - Should Be Equal As Integers ${fileContent[0]} 0 - Should Contain ${fileContent[1]} ${content} - -Verify If Component Is Onboarded - [Arguments] ${compSpecName} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_ONBOARDING_API_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${resp} = Get Request ${SESSION_NAME} /onboarding/components?name=${compSpecName} headers=${headers} - Log ${resp.json()} - Should Not Be Empty ${resp.json().get('components')} - - -Onboard Component Spec - [Arguments] ${componentSpec} ${dict_values} ${compSpecName} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_ONBOARDING_API_SERVER} - ${headers}= Create Dictionary content-type=application/json - Templating.Create Environment dcaemod ${GLOBAL_TEMPLATE_FOLDER} - ${componentSpec}= Templating.Apply Template dcaemod ${componentSpec} ${dict_values} - ${resp} = Post Request ${SESSION_NAME} /onboarding/components data=${componentSpec} headers=${headers} - Should Be True ${resp.status_code} < 300 - - Wait Until Keyword Succeeds 2 min 5s Verify If Component Is Onboarded ${compSpecName} - - Log ${resp.json()} - -Add Registry Client - - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${data} = Set Variable {"revision": {"version": 0}, "component": {"name": "registry_test", "uri": "http://dcaemod-nifi-registry:18080"}} - ${resp} = Post Request ${SESSION_NAME} /nifi-api/controller/registry-clients data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - - Set Global Variable ${REGISTRY_CLIENT_ID} ${resp.json().get('id')} - Set Global Variable ${REGISTRY_CLIENT_VERSION} ${resp.json().get('revision').get('version')} - -Add Distribution Target - - ${session}= Create Session distributor ${DCAEMOD_DISTRIBUTOR_API_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${data} = Set Variable {"name": "runtime_test", "runtimeApiUrl": "http://dcaemod-runtime-api:9090"} - ${resp} = Post Request distributor /distributor/distribution-targets data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - Set Global Variable ${DISTRIBUTION_TARGET_ID} ${resp.json().get('id')} - -Create Process Group - [Arguments] ${name} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${resp} = Get Request ${SESSION_NAME} /nifi-api/flow/process-groups/root/ headers=${headers} - Should Be True ${resp.status_code} < 300 - Log ${resp.json()} - ${parentGroupId} = Set Variable ${resp.json().get('processGroupFlow').get('id')} - - ${data} = Set Variable {"revision": {"clientId": "${CLIENT_ID}", "version": 0}, "component" : {"parentGroupId" : "${parentGroupId}", "name" : "${name}"}} - ${resp} = Post Request ${SESSION_NAME} /nifi-api/process-groups/${parentGroupId}/process-groups data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - Log ${resp.json()} - - ${processGroupId} = Set Variable ${resp.json().get('id')} - - [Return] ${processGroupId} - - -Verify If NIFI Processor Is Created - [Arguments] ${typeName} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${resp} = Get Request ${SESSION_NAME} /nifi-api/flow/processor-types?type=org.onap.dcae.${typeName} headers=${headers} - Log ${resp.json()} - Should Not Be Empty ${resp.json().get('processorTypes')} - -Create Processor - [Arguments] ${processGroupId} ${compSpecName} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${typeName} = Evaluate $compSpecName.title() - ${typeName} = Remove String ${typeName} - - ${data} = Set Variable {"revision": {"clientId": "${CLIENT_ID}", "version": 0},"component": {"parentGroupId": "${processGroupId}", "name": "${compSpecName}", "type": "org.onap.dcae.${typeName}"}} - Wait Until Keyword Succeeds 60s 5s Verify If NIFI Processor Is Created ${typeName} - ${resp} = Post Request ${SESSION_NAME} /nifi-api/process-groups/${processGroupId}/processors data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - - -Save Flow By Version Controlling - [Arguments] ${flowName} ${processGroupId} - - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - - ${resp} = Get Request ${SESSION_NAME} /nifi-api/flow/registries/${REGISTRY_CLIENT_ID}/buckets headers=${headers} - Should Be True ${resp.status_code} < 300 - Log ${resp.json()} - ${bucketId} = Set Variable ${resp.json().get('buckets')[0].get('id')} - - ${processGrVersion} ${_}= Get Process Group Revision ${processGroupId} - - ${data} = Set Variable {"versionedFlow": {"flowName": "${flowName}", "bucketId": "${bucketId}", "registryId": "${REGISTRY_CLIENT_ID}"}, "processGroupRevision": {"clientId": "${CLIENT_ID}", "version": ${processGrVersion}}} - ${resp} = Post Request ${SESSION_NAME} /nifi-api/versions/process-groups/${processGroupId} data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - -Distribute The Flow - [Arguments] ${processGroupId} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${session}= Create Session distributor ${DCAEMOD_DISTRIBUTOR_API_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${resp} = Get Request ${SESSION_NAME} /nifi-api/process-groups/${processGroupId} headers=${headers} - Should Be True ${resp.status_code} < 300 - Log ${resp.json()} - ${flowId} = Set Variable ${resp.json().get('component').get('versionControlInformation').get('flowId')} - ${data} = Set Variable {"processGroupId": "${flowId}"} - ${resp} = Post Request distributor /distributor/distribution-targets/${DISTRIBUTION_TARGET_ID}/process-groups data=${data} headers=${headers} - Should Be True ${resp.status_code} < 300 - -Deploy Applictaion - [Arguments] ${processGroupName} ${compSpecName} - ${command_output} = Run And Return Rc And Output helm repo update - Should Be Equal As Integers ${command_output[0]} 0 - ${helm_install}= Set Variable helm -n onap install ${ONAP_HELM_RELEASE}-${compSpecName} chart-museum/${compSpecName} --set global.repository=${registry_ovveride} - ${helm_install_command_output} = Run And Return Rc And Output ${helm_install} - Log ${helm_install_command_output[1]} - Should Be Equal As Integers ${helm_install_command_output[0]} 0 - Set Test Variable ${IS_SERVICE_DEPLOYED} True - ${kubectl_patch}= Set Variable kubectl -n onap patch deployment ${ONAP_HELM_RELEASE}-${compSpecName} -p '{"spec":{"template":{"spec":{"containers":[{"name": "${compSpecName}","image":"docker.io/nginx:latest"}]}}}}' - ${kubectl_patch_command_output}= Run And Return Rc And Output ${kubectl_patch} - Log ${kubectl_patch_command_output[1]} - Should Be Equal As Integers ${kubectl_patch_command_output[0]} 0 - Wait Until Keyword Succeeds 4 min 15s Check NGINX Applictaion ${compSpecName} - -Check NGINX Applictaion - [Arguments] ${compSpecName} - ${check_command}= Set Variable kubectl get deployment -n onap | grep ${compSpecName} | grep 1/1 - ${check_command_command_output}= Run And Return Rc And Output ${check_command} - Log ${check_command_command_output[1]} - Should Be Equal As Integers ${check_command_command_output[0]} 0 - -Undeploy Application - [Arguments] ${CHART_NAME} - Uninstall helm charts ${ONAP_HELM_RELEASE}-${CHART_NAME} - -Get Process Group Revision - [Arguments] ${processGroupId} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${headers}= Create Dictionary content-type=application/json - ${resp} = Get Request ${SESSION_NAME} /nifi-api/versions/process-groups/${processGroupId} headers=${headers} - Should Be True ${resp.status_code} < 300 - ${currentProcessGrVersion} = Set Variable ${resp.json().get('processGroupRevision').get('version')} - ${clientId} = Set Variable ${resp.json().get('processGroupRevision').get('clientId')} - - [Return] ${currentProcessGrVersion} ${clientId} - -Delete Distribution Target - ${session}= Create Session distributor ${DCAEMOD_DISTRIBUTOR_API_SERVER} - ${resp} = Delete Request distributor /distributor/distribution-targets/${DISTRIBUTION_TARGET_ID} - Should Be True ${resp.status_code} < 300 - -Delete Process Group - [Arguments] ${processGroupId} - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${processGrVersion} ${clientId}= Get Process Group Revision ${processGroupId} - ${resp} = Delete Request ${SESSION_NAME} /nifi-api/process-groups/${processGroupId}?version=${processGrVersion}&clientId=${clientId} - Should Be True ${resp.status_code} < 300 - -Delete Registry Client - ${session}= Create Session ${SESSION_NAME} ${DCAEMOD_DESIGNTOOL_SERVER} - ${resp} = Delete Request ${SESSION_NAME} /nifi-api/controller/registry-clients/${REGISTRY_CLIENT_ID}?version=${REGISTRY_CLIENT_VERSION} - Should Be True ${resp.status_code} < 300 - -Configure Nifi Registry And Distribution Target - Restart Runtime API - Add Registry Client - Add Distribution Target - Add chart repository chart-museum http://chart-museum:80 onapinitializer demo123456! - ${command_output} = Run And Return Rc And Output ${HELM_RELEASE} - Should Be Equal As Integers ${command_output[0]} 0 - Set Global Variable ${ONAP_HELM_RELEASE} ${command_output[1]} - -Restart Runtime API - ${restart_command}= Set Variable kubectl delete pod $(kubectl get pods -n onap | grep dcaemod-runtime-api | awk '{print $1}') -n onap - ${restart_command_command_output}= Run And Return Rc And Output ${restart_command} - Log ${restart_command_command_output[1]} - Should Be Equal As Integers ${restart_command_command_output[0]} 0 - Wait Until Keyword Succeeds 2 min 5s Check Runtime API - -Check Runtime API - ${check_command}= Set Variable kubectl get deployment -n onap | grep dcaemod-runtime-api | grep 1/1 - ${check_command_command_output}= Run And Return Rc And Output ${check_command} - Log ${check_command_command_output[1]} - Should Be Equal As Integers ${check_command_command_output[0]} 0 - -Delete Nifi Registry And Distribution Target - Run Keyword If '${DISTRIBUTION_TARGET_ID}' != '${EMPTY}' Wait Until Keyword Succeeds 2 min 5s Delete Distribution Target - Run Keyword If '${REGISTRY_CLIENT_ID}' != '${EMPTY}' Wait Until Keyword Succeeds 2 min 5s Delete Registry Client - -Delete Process Group And Deployment - Run Keyword If ${IS_PROCESS_GROUP_SET} Run Keywords Delete Process Group ${PROCESS_GROUP_ID} - ... AND Set Suite Variable ${IS_PROCESS_GROUP_SET} False - Run Keyword If ${IS_SERVICE_DEPLOYED} Run Keywords Undeploy Application ${CHART_NAME} - ... AND Set Suite Variable ${IS_SERVICE_DEPLOYED} False diff --git a/robot/resources/strimzi_kafka.robot b/robot/resources/strimzi_kafka.robot new file mode 100644 index 00000000..262d28e6 --- /dev/null +++ b/robot/resources/strimzi_kafka.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Template for interfacing with strimzi kafka. +Library OperatingSystem +Library RequestsLibrary +Library BuiltIn +Library Collections +Library ONAPLibrary.Utilities +Library String +Library ONAPLibrary.Kafka + +*** Variables *** +${KAFKA_GET_PASSWORD} kubectl -n onap get secret strimzi-kafka-admin -o jsonpath="{.data.password}" | base64 -d + +*** Keywords *** +Get Last Message From Topic + [Documentation] Decode last message from Kafka topic. + [Arguments] ${kafka_server} ${kafka_topic} ${username} + ${command_output} = Run And Return Rc And Output ${KAFKA_GET_PASSWORD} + Should Be Equal As Integers ${command_output[0]} 0 + ${password} Set Variable ${command_output[1]} + Connect kafka ${kafka_server} ${username} ${password} SCRAM-SHA-512 + ${msg}= Consume kafka ${kafka_topic} + [Return] ${msg} diff --git a/robot/resources/usecases/5gbulkpm_helm_interface.robot b/robot/resources/usecases/5gbulkpm_helm_interface.robot index 0419ef43..17a5cff0 100644 --- a/robot/resources/usecases/5gbulkpm_helm_interface.robot +++ b/robot/resources/usecases/5gbulkpm_helm_interface.robot @@ -4,106 +4,62 @@ Library RequestsLibrary Library OperatingSystem Library String Library JSONLibrary -Resource ../dmaap/mr_interface.robot Resource ../dmaap/dr_interface.robot -Resource ../dmaap/bc_interface.robot Resource ../consul_interface.robot Resource ../chart_museum.robot +Resource ../strimzi_kafka.robot *** Variables *** -${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT} -${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT} ${DR_ENDPOINT} ${GLOBAL_DMAAP_DR_PROV_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DMAAP_DR_PROV_IP_ADDR}:${GLOBAL_DMAAP_DR_PROV_SERVER_PORT} -${DMAAP_BC_SERVER} ${GLOBAL_BC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT} ${VES_HEALTH_CHECK_PATH} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT} -${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja -${INVENTORY_ENDPOINT} /dcae-service-types -${XNF_SFTP_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-sftp.yaml -${XNF_HTTPS_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/k8s-https.yaml -${BLUEPRINT_TEMPLATE_PATH} ${EXECDIR}/robot/assets/usecases/5gbulkpm/blueprintTemplate.json -${DEPLOYMENT_ENDPOINT} dcae-deployments -${MR_TOPIC_CHECK_PATH} /topics ${DR_SUB_CHECK_PATH} /internal/prov -${MR_TOPIC_URL_PATH} /events/unauthenticated.PERFORMANCE_MEASUREMENTS/CG1/C1 -${MR_TOPIC_URL_PATH_FOR_POST} /events/unauthenticated.PERFORMANCE_MEASUREMENTS -${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients -${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters -${PMMAPPER_HEALTH_CHECK_PATH} /healthcheck ${JSON_DATA_FILE} ${EXECDIR}/robot/assets/usecases/5gbulkpm/Notification.json ${VES_LISTENER_PATH} /eventListener/v7 -${PMMAPPER_SUB_ROLE_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/sub.json -${PMMAPPER_MR_CLUSTER_DATA} ${EXECDIR}/robot/assets/usecases/5gbulkpm/mr_clusters.json -${NEXUS3} ${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} ${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 +${DR_NODE_FECTH_PROV} kubectl exec $(kubectl get pods -n onap | grep dmaap-dr-node | awk '{print $1}' | grep -v NAME) -n onap -- curl http://localhost:8080/internal/fetchProv ${CHECK_ENV_SET} kubectl set env pod/$(kubectl get pod -n onap | grep datafile | awk '{print $1}') -c dcae-datafile-collector --list -n onap ${COPY_RSA_KEY} kubectl cp /tmp/known_hosts $(kubectl get pod -n onap | grep datafile | awk '{print $1}'):/home/datafile/.ssh/known_hosts -c dcae-datafile-collector -n onap ${CHECK_DFC_LOGS} kubectl logs $(kubectl get pod -n onap | grep datafile | awk '{print $1}') -c dcae-datafile-collector -n onap --tail=10 ${CHECK_ALL_DFC_LOGS} kubectl logs $(kubectl get pod -n onap | grep datafile | awk '{print $1}') -n onap --all-containers ${CHECK_ALL_PMMAPPER_LOGS} kubectl logs $(kubectl get pod -n onap | grep pm-mapper | awk '{print $1}') -n onap --all-containers ${EXPECTED_PRINT} StrictHostKeyChecking is enabled but environment variable KNOWN_HOSTS_FILE_PATH is not set or points to not existing file -${MONGO_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-mongo.yaml -${PNF_SIMULATOR_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-pnf-simulator.yaml -${MONGO_VES_CLIENT_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-mongo-ves-client.yaml -${VES_CLIENT_BLUEPRINT_PATH} ${EXECDIR}/robot/assets/cmpv2/k8s-ves-client.yaml -${VES_INPUTS} deployment/VesTlsCmpv2Inputs.jinja ${pm_notification_event} dfc/notification.jinja ${consul_change_event} dfc/consul.jinja -${ves_client_single_event}= ves/pnf_simulator_single_event.jinja ${SFTP_HELM_CHARTS} ${EXECDIR}/robot/assets/helm/sftp ${HTTPS_SERVER_HELM_CHARTS} ${EXECDIR}/robot/assets/helm/pm-https-server ${HELM_RELEASE} kubectl --namespace onap get pods | sed 's/ .*//' | grep robot | sed 's/-.*//' *** Keywords *** - xNF PM File Validate [Documentation] - ... This keyword gathers all events from message router topic and validates if in recived data is present an expected string: "${expected_pm_str}" . + ... This keyword gets the last event from the PM topic and validates if the expected string is present: "${expected_pm_str}" . [Arguments] ${expected_pm_str} - ${timestamp}= Get Time epoch - #${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} - ${resp}= Run MR Get Request ${MR_TOPIC_URL_PATH} - Should Contain ${resp.text} ${expected_pm_str} - -Topic Validate - [Arguments] ${value} - ${timestamp}= Get Current Date - ${dict}= Create Dictionary timestamp=${timestamp} - Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} - ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict} - ${resp}= Run MR Auth Post Request (User And Pass) ${MR_TOPIC_URL_PATH_FOR_POST} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} ${data} - Should Be Equal As Strings ${resp.status_code} 200 - #${resp}= Run MR Auth Get Request ${MR_TOPIC_URL_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} - ${resp}= Run MR Get Request ${MR_TOPIC_URL_PATH} - Should Contain ${resp.text} ${value} + ${bytes} = Encode String To Bytes ${expected_pm_str} UTF-8 + ${msg}= Run Keyword Get Last Message From Topic ${GLOBAL_KAFKA_BOOTSTRAP_SERVICE} unauthenticated.PERFORMANCE_MEASUREMENTS ${GLOBAL_KAFKA_USER} + Should Contain ${msg} ${bytes} + Send File Ready Event to VES Collector and Deploy all DCAE Applications [Arguments] ${pm_file} ${file_format_type} ${file_format_version} Disable Warnings Setting Global Variables + DR Node Fetch Prov + Sleep 10s Send File Ready Event to VES Collector ${pm_file} ${file_format_type} ${file_format_version} + Add OOM test chart repository onap-testing https://nexus3.onap.org/repository/onap-helm-testing/ Add chart repository chart-museum http://chart-museum:80 onapinitializer demo123456! -# Log To Console Deploying Data File Collector -# Deploying Data File Collector -# Log To Console Deploying 3GPP PM Mapper -# Deploying 3GPP PM Mapper Log To Console Deploying SFTP Server As xNF Deploying SFTP Server As xNF # Log To Console Deploying HTTPS Server with correct CMPv2 certificates as xNF # Deploying HTTPS server with correct certificates -# Log To Console Deploying HTTPS Server with wrong subject alternatives in CMPv2 certificates as xNF -# Deploying HTTPS server with wrong certificates - wrong SAN-s - DR Bulk PM Feed Check DR PM Mapper Subscriber Check Usecase Teardown Disable Warnings Get all logs from PM Mapper Get all logs from Data File Collector -# Uninstall helm charts ${ONAP_HELM_RELEASE}-dcae-datafile-collector -# Uninstall helm charts ${ONAP_HELM_RELEASE}-dcae-pm-mapper Uninstall helm charts ${ONAP_HELM_RELEASE}-sftp # Uninstall helm charts ${ONAP_HELM_RELEASE}-pm-https-server-correct-sans -# Uninstall helm charts ${ONAP_HELM_RELEASE}-pm-https-server-wrong-sans Setting Global Variables ${test_variables} = Create Dictionary @@ -193,9 +149,10 @@ Deploying HTTPS server with wrong certificates - wrong SAN-s ${override} = Set Variable --set fullnameOverride=${name} --set nameOverride=${name} --set certificates.name=${name} --set certificates.commonName=wrong-sans-1 --set certificates.dnsNames={wrong-sans-2} --debug Install helm charts from folder ${HTTPS_SERVER_HELM_CHARTS} ${name} set_values_override=${override} -DR Bulk PM Feed Check - ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} - Should Contain ${resp.text} bulk_pm_feed +DR Node Fetch Prov + ${rc}= Run and Return RC ${DR_NODE_FECTH_PROV} + Should Be Equal As Integers ${rc} 0 + DR PM Mapper Subscriber Check ${resp}= Run DR Get Request ${DR_SUB_CHECK_PATH} @@ -263,39 +220,39 @@ Change DFC httpsHostnameVerify configuration in Consul Should Be Equal As Integers ${rc} 0 Wait Until Keyword Succeeds 360 sec 15 sec Check logs kubectl logs -n onap $(kubectl get pods -n onap | grep datafile-collector | awk '{print $1}' | grep -v NAME) ${container_name}-datafile-collector -#Sending File Ready Event to VES Collector for HTTPS Server -# [Arguments] ${https-server_host} -# Send File Ready Event to VES Collector for HTTPS Server ${PM_FILE} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_TYPE"]} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_VERSION"]} ${https-server_host} - -#Send File Ready Event to VES Collector for HTTPS Server -# [Arguments] ${pm_file} ${file_format_type} ${file_format_version} ${https_server_host} -# Disable Warnings -# ${pm_event} Create Dictionary https_server_host=${https_server_host} pm_file=${pm_file} fileFormatType=${file_format_type} fileFormatVersion=${file_format_version} -# Templating.Create Environment pm ${GLOBAL_TEMPLATE_FOLDER} -# ${VES_FILE_READY_NOTIFICATION}= Templating.Apply Template pm ${pm_notification_event} ${pm_event} -# ${headers}= Create Dictionary content-type=application/json -# ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} -# ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} -# ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers} -# Should Be Equal As Strings ${resp.status_code} 202 - - -#Uploading PM Files to xNF HTTPS Server -# [Arguments] ${https-server_host} -# ${pm_file}= Upload PM Files to xNF HTTPS Server ${GLOBAL_TEST_VARIABLES["PM_FILE_PATH"]} ${https-server_host} -# Set Global Variable ${PM_FILE} ${pm_file} - -#Upload PM Files to xNF HTTPS Server -# [Arguments] ${pm_file_path} ${https_server} -# ${epoch}= Get Current Date result_format=epoch -# ${pm_file} = Set Variable A${epoch}.xml.gz -# Copy File ${pm_file_path} tmp/${pm_file} -# ${fileData}= Get Binary File tmp/${pm_file} -# ${file_part}= Create List ${pm_file} ${fileData} application/octet-stream -# ${fileParts}= Create Dictionary -# Set to Dictionary ${fileParts} uploaded_file=${file_part} -# ${auth}= Create List demo demo123456! -# ${session}= Create Session https http://${https_server}:80 auth=${auth} -# ${resp}= Post Request https /upload.php files=${fileParts} -# Should Be Equal As Strings ${resp.status_code} 200 -# [Return] ${pm_file} +Sending File Ready Event to VES Collector for HTTPS Server + [Arguments] ${https-server_host} + Send File Ready Event to VES Collector for HTTPS Server ${PM_FILE} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_TYPE"]} ${GLOBAL_TEST_VARIABLES["FILE_FORMAT_VERSION"]} ${https-server_host} + +Send File Ready Event to VES Collector for HTTPS Server + [Arguments] ${pm_file} ${file_format_type} ${file_format_version} ${https_server_host} + Disable Warnings + ${pm_event} Create Dictionary https_server_host=${https_server_host} pm_file=${pm_file} fileFormatType=${file_format_type} fileFormatVersion=${file_format_version} + Templating.Create Environment pm ${GLOBAL_TEMPLATE_FOLDER} + ${VES_FILE_READY_NOTIFICATION}= Templating.Apply Template pm ${pm_notification_event} ${pm_event} + ${headers}= Create Dictionary content-type=application/json + ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} + ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} + ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${VES_FILE_READY_NOTIFICATION} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 202 + + +Uploading PM Files to xNF HTTPS Server + [Arguments] ${https-server_host} + ${pm_file}= Upload PM Files to xNF HTTPS Server ${GLOBAL_TEST_VARIABLES["PM_FILE_PATH"]} ${https-server_host} + Set Global Variable ${PM_FILE} ${pm_file} + +Upload PM Files to xNF HTTPS Server + [Arguments] ${pm_file_path} ${https_server} + ${epoch}= Get Current Date result_format=epoch + ${pm_file} = Set Variable A${epoch}.xml.gz + Copy File ${pm_file_path} tmp/${pm_file} + ${fileData}= Get Binary File tmp/${pm_file} + ${file_part}= Create List ${pm_file} ${fileData} application/octet-stream + ${fileParts}= Create Dictionary + Set to Dictionary ${fileParts} uploaded_file=${file_part} + ${auth}= Create List demo demo123456! + ${session}= Create Session https http://${https_server}:80 auth=${auth} + ${resp}= Post Request https /upload.php files=${fileParts} + Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${pm_file} diff --git a/robot/testsuites/dcaemod.robot b/robot/testsuites/dcaemod.robot deleted file mode 100644 index 818ca8b6..00000000 --- a/robot/testsuites/dcaemod.robot +++ /dev/null @@ -1,97 +0,0 @@ -*** Settings *** - -Library RequestsLibrary -Library Collections -Library OperatingSystem -Resource ../resources/dcaemod_interface.robot -Suite Setup Configure Nifi Registry And Distribution Target -Suite Teardown Delete Nifi Registry And Distribution Target -Test Teardown Delete Process Group And Deployment - - -*** Variables *** - -${CONFIG_MAP_FILE} /tmp/sample-config -${COMPSPEC_WITH_CONFIG_VOLUME} dcaemod/compspec_with_config_volume.jinja -${COMPSPEC_WITHOUT_CONFIG_VOLUME} dcaemod/compspec_without_config_volume.jinja - -*** Test Cases *** - -Deploy DCAE Simple Application Without Config Map In Config Spec Json - [tags] dcaemod - [Documentation] - ... Test case checks if operator is able to deploy DCAE application using DCAE MOD without config map definition. - ... This test case: - ... - Configures DCAE MOD by adding a registry client and a distribution target in the controller settings via NIFI API. - ... - Onboards component spec via onboarding API. - ... - Creates Process Group, Processor and saves created flows (by version controlling) via NIFI API. - ... - Distributes the flow for helm charts generation via distributor API and pushes it to the Chart Museum. - ... - Deploys such a helm charts. - - ${timestamp}= Get Time epoch - Set Test Variable ${processGroupName} nginx-${timestamp} - ${dict_values} = Create Dictionary comp_spec_name=${processGroupName} - ${compSpecName} = Set Variable ${dict_values['comp_spec_name']} - - Deploy DCAE Application ${COMPSPEC_WITHOUT_CONFIG_VOLUME} ${dict_values} ${compSpecName} ${processGroupName} - -Deploy DCAE Simple Application With Config Map In Config Spec Json But Not Present In K8s - [tags] dcaemod - [Documentation] - ... Test case checks if operator is able to deploy DCAE application using DCAE MOD with config map definition in config spec json file but not present in k8s. - ... This test case: - ... Configures DCAE MOD by adding a registry client and a distribution target in the controller settings via NIFI API. - ... - Onboards component spec with config map via onboarding API. - ... - Creates Process Group, Processor and saves created flows (by version controlling) via NIFI API. - ... - Distributes the flow for helm charts generation via distributor API and pushes it to the Chart Museum. - ... - Deploys such a helm charts. - ... - Verifies if config map is mounted as a volume and if mounted folder is empty - - ${timestamp}= Get Time epoch - Set Test Variable ${processGroupName} nginx-${timestamp} - ${dict_values} = Create Dictionary comp_spec_name=${processGroupName} - ... volume_mount_path=/opt/app/etc/config - ... config_map_name=test-config-volume - ${compSpecName} = Set Variable ${dict_values['comp_spec_name']} - ${volumeMountPath} = Set Variable ${dict_values['volume_mount_path']} - ${configMapName} = Set Variable ${dict_values['config_map_name']} - - Deploy DCAE Application ${COMPSPEC_WITH_CONFIG_VOLUME} ${dict_values} ${compSpecName} ${processGroupName} - ${podYaml} = Get Pod Yaml ${compSpecName} - Verify If Volume Is Mounted ${podYaml} ${volumeMountPath} - Verify If Config Map Is Mounted As Volume ${podYaml} ${configMapName} - ${mountedFolderContent}= Wait Until Keyword Succeeds 1 min 10s Get Content Of Mounted Folder Inside Container ${compSpecName} ${volumeMountPath} - Verify If Mounted Folder Is Empty ${mountedFolderContent} - -Deploy DCAE Simple Application With Config Map In Config Spec Json AND Present In K8s - [tags] dcaemod - [Documentation] - ... Test case checks if operator is able to deploy DCAE application using DCAE MOD with config map definition and config map present in k8s. - ... This test case: - ... - Configures DCAE MOD by adding a registry client and a distribution target in the controller settings via NIFI API. - ... - Onboards component spec with config map via onboarding API. - ... - Creates Process Group, Processor and saves created flows (by version controlling) via NIFI API. - ... - Creates config map from file - ... - Distributes the flow for helm charts generation via distributor API and pushes it to the Chart Museum. - ... - Deploys such a helm charts. - ... - Verifies if mounted folder contains created file and this file contains user content - - ${timestamp}= Get Time epoch - Set Test Variable ${processGroupName} nginx-${timestamp} - ${dict_values} = Create Dictionary comp_spec_name=${processGroupName} - ... volume_mount_path=/opt/app/etc/config - ... config_map_name=test-config-volume - ${compSpecName} = Set Variable ${dict_values['comp_spec_name']} - ${volumeMountPath} = Set Variable ${dict_values['volume_mount_path']} - ${configMapName} = Set Variable ${dict_values['config_map_name']} - Set Test Variable ${CONFIG_MAP_NAME} ${configMapName} - ${content} = Set Variable Hello, world! - ${configMapDir} ${configMapFile} = Split Path ${CONFIG_MAP_FILE} - - Create File ${CONFIG_MAP_FILE} ${content} - Create Config Map From File ${configMapName} ${CONFIG_MAP_FILE} - Deploy DCAE Application ${COMPSPEC_WITH_CONFIG_VOLUME} ${dict_values} ${compSpecName} ${processGroupName} - Wait Until Keyword Succeeds 1 min 10s Verify If Mounted Folder Contains File ${compSpecName} ${configMapFile} ${volumeMountPath} - Verify File Content ${compSpecName} ${volumeMountPath}/${CONFIG_MAP_FILE} ${content} - - [Teardown] Run Keywords Delete Process Group And Deployment AND Delete Config Map With Mounted Config File |