From d1bc6cbd63f9cd7126baded2a40e78ebb67f65e1 Mon Sep 17 00:00:00 2001 From: Katarzyna Wasiel Date: Wed, 10 Feb 2021 08:50:57 +0100 Subject: Add DCAE MOD smoke/verification test using simple app Issue-ID: INT-1855 Signed-off-by: Katarzyna Wasiel Change-Id: Idbd385547cd5d0ef9ce7b53060d84ea8d9031e06 --- .../dcaemod/compspec_with_config_volume.jinja | 50 ++++ .../dcaemod/compspec_without_config_volume.jinja | 42 ++++ robot/resources/dcae/inventory.robot | 5 +- robot/resources/dcaemod_interface.robot | 277 +++++++++++++++++++++ robot/testsuites/dcaemod.robot | 94 +++++++ 5 files changed, 467 insertions(+), 1 deletion(-) create mode 100644 robot/assets/templates/dcaemod/compspec_with_config_volume.jinja create mode 100644 robot/assets/templates/dcaemod/compspec_without_config_volume.jinja create mode 100644 robot/resources/dcaemod_interface.robot create mode 100644 robot/testsuites/dcaemod.robot (limited to 'robot') diff --git a/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja b/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja new file mode 100644 index 00000000..80feec55 --- /dev/null +++ b/robot/assets/templates/dcaemod/compspec_with_config_volume.jinja @@ -0,0 +1,50 @@ +{"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": { + "healthcheck": { + "type": "docker", + "interval": "45s", + "timeout": "15s", + "script": "service nginx status" + }, + "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 new file mode 100644 index 00000000..45ac97fb --- /dev/null +++ b/robot/assets/templates/dcaemod/compspec_without_config_volume.jinja @@ -0,0 +1,42 @@ +{"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": { + "healthcheck": { + "type": "docker", + "interval": "300s", + "timeout": "120s", + "script": "service nginx status" + }, + "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/resources/dcae/inventory.robot b/robot/resources/dcae/inventory.robot index 647c3780..44f8202d 100644 --- a/robot/resources/dcae/inventory.robot +++ b/robot/resources/dcae/inventory.robot @@ -40,4 +40,7 @@ Get Blueprint From Inventory ${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} - [Return] ${resp} \ No newline at end of file + 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 new file mode 100644 index 00000000..9dda0a00 --- /dev/null +++ b/robot/resources/dcaemod_interface.robot @@ -0,0 +1,277 @@ +*** Settings *** +Library ONAPLibrary.Templating WITH NAME Templating +Library ONAPLibrary.Utilities +Library RequestsLibrary +Library Collections +Library String +Library OperatingSystem +Resource ../resources/global_properties.robot +Resource ../resources/dcae/inventory.robot +Resource ../resources/dcae/deployment.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} + +*** 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 + + ${typeId} ${blueprintName} = Deploy Blueprint From Inventory ${processGroupName} ${compSpecName} + Set Test Variable ${IS_SERVICE_DEPLOYED} True + Set Test Variable ${TYPE_ID} ${typeId} + Set Test Variable ${BLUEPRINT_NAME} ${blueprintName} + + +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}') -- 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}') -- 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}') -- 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() + ${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 Blueprint From Inventory + [Arguments] ${processGroupName} ${compSpecName} + ${blueprintName} = Set Variable ${processGroupName}_${compSpecName} + ${resp} = Wait Until Keyword Succeeds 7 min 20s Get Blueprint From Inventory ${blueprintName} + ${typeId} = Set Variable ${resp.json().get('items')[0].get('typeId')} + ${data} = Set Variable {"serviceTypeId": "${typeId}"} + Deploy Service ${data} ${blueprintName} 10 minute + + [Return] ${typeId} ${blueprintName} + +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 + Add Registry Client + Add Distribution Target + +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 Blueprint 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_FLOW_DISTRIBUTED} Run Keywords Delete Blueprint From Inventory ${TYPE_ID} + ... AND Set Suite Variable ${IS_FLOW_DISTRIBUTED} False + Run Keyword If ${IS_SERVICE_DEPLOYED} Run Keywords Undeploy Service ${BLUEPRINT_NAME} + ... AND Set Suite Variable ${IS_SERVICE_DEPLOYED} False \ No newline at end of file diff --git a/robot/testsuites/dcaemod.robot b/robot/testsuites/dcaemod.robot new file mode 100644 index 00000000..ef5b0e76 --- /dev/null +++ b/robot/testsuites/dcaemod.robot @@ -0,0 +1,94 @@ +*** 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 Blueprint 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 blueprint generation via distributor API and pushes it to the DCAE Inventory and the DCAE Dashboard. + ... - Deploys such a blueprint from Inventory. + + ${dict_values} = Create Dictionary comp_spec_name=nginx1 + ${compSpecName} = Set Variable ${dict_values['comp_spec_name']} + Set Test Variable ${processGroupName} nginx1 + + 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 blueprint generation via distributor API and pushes it to the DCAE Inventory and the DCAE Dashboard. + ... - Deploys such a blueprint from Inventory. + ... - Verifies if config map is mounted as a volume and if mounted folder is empty + + ${dict_values} = Create Dictionary comp_spec_name=nginx2 + ... 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 ${processGroupName} nginx2 + + 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} = 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 blueprint generation via distributor API and pushes it to the DCAE Inventory and the DCAE Dashboard. + ... - Deploys such a blueprint from Inventory. + ... - Verifies if mounted folder contains created file and this file contains user content + + ${dict_values} = Create Dictionary comp_spec_name=nginx3 + ... 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} + Set Test Variable ${processGroupName} nginx3 + ${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} + 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 Blueprint And Deployment AND Delete Config Map With Mounted Config File -- cgit 1.2.3-korg