From 3d12502f70afb8b06fb44065e85630abfdfa7a3e Mon Sep 17 00:00:00 2001 From: DR695H Date: Wed, 19 Jun 2019 20:45:38 -0400 Subject: migrate mr_Interface to jinja Issue-ID: TEST-158 Change-Id: I2b9e462f7739283b7f74403a7ff4da0b9934c246 Signed-off-by: DR695H --- robot/assets/templates/mr/mr_publish.jinja | 5 +++++ robot/assets/templates/mr/mr_put_acl.jinja | 7 +++++++ robot/assets/templates/mr_publish.template | 5 ----- robot/assets/templates/mr_put_acl.template | 7 ------- robot/resources/global_properties.robot | 3 +-- robot/resources/mr_interface.robot | 13 +++++++------ .../pnf_registration_without_SO_template.robot | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 robot/assets/templates/mr/mr_publish.jinja create mode 100644 robot/assets/templates/mr/mr_put_acl.jinja delete mode 100644 robot/assets/templates/mr_publish.template delete mode 100644 robot/assets/templates/mr_put_acl.template (limited to 'robot') diff --git a/robot/assets/templates/mr/mr_publish.jinja b/robot/assets/templates/mr/mr_publish.jinja new file mode 100644 index 00000000..acb10328 --- /dev/null +++ b/robot/assets/templates/mr/mr_publish.jinja @@ -0,0 +1,5 @@ +{ + "test": "success", + "timestamp": "${timestamp}" +} + diff --git a/robot/assets/templates/mr/mr_put_acl.jinja b/robot/assets/templates/mr/mr_put_acl.jinja new file mode 100644 index 00000000..b337fc3e --- /dev/null +++ b/robot/assets/templates/mr/mr_put_acl.jinja @@ -0,0 +1,7 @@ +{ + "topicName":"{{TOPIC_NAME}}", + "topicDescription":"This is a TestTopic", + "partitionCount":"1", + "replicationCount":"3", + "transactionEnabled":"true" +} diff --git a/robot/assets/templates/mr_publish.template b/robot/assets/templates/mr_publish.template deleted file mode 100644 index acb10328..00000000 --- a/robot/assets/templates/mr_publish.template +++ /dev/null @@ -1,5 +0,0 @@ -{ - "test": "success", - "timestamp": "${timestamp}" -} - diff --git a/robot/assets/templates/mr_put_acl.template b/robot/assets/templates/mr_put_acl.template deleted file mode 100644 index 62c96e8c..00000000 --- a/robot/assets/templates/mr_put_acl.template +++ /dev/null @@ -1,7 +0,0 @@ -{ - "topicName":"${TOPIC_NAME}", - "topicDescription":"This is a TestTopic", - "partitionCount":"1", - "replicationCount":"3", - "transactionEnabled":"true" -} diff --git a/robot/resources/global_properties.robot b/robot/resources/global_properties.robot index d1232b5a..fa07cd25 100644 --- a/robot/resources/global_properties.robot +++ b/robot/resources/global_properties.robot @@ -35,5 +35,4 @@ ${GLOBAL_AAI_ZONE_ID} nova1 ${GLOBAL_AAI_ZONE_NAME} nova ${GLOBAL_AAI_DESIGN_TYPE} integration ${GLOBAL_AAI_ZONE_CONTEXT} labs -${GLOBAL_DNS_VES_NAME} dcae-ves-collector -${GLOBAL_VES_SERVER_PORT} 8080 +${GLOBAL_TEMPLATE_FOLDER} robot/assets/templates diff --git a/robot/resources/mr_interface.robot b/robot/resources/mr_interface.robot index 85c5a614..f8ea9c3c 100644 --- a/robot/resources/mr_interface.robot +++ b/robot/resources/mr_interface.robot @@ -5,9 +5,9 @@ Library DateTime Library Process Library ONAPLibrary.JSON Library ONAPLibrary.Utilities +Library ONAPLibrary.Templating Resource global_properties.robot -Resource ../resources/json_templater.robot *** Variables *** ${MR_HEALTH_CHECK_PATH} /topics @@ -16,8 +16,8 @@ ${MR_SUB_HEALTH_CHECK_PATH} /events/TEST_TOPIC/g1/c4?timeout=5000 ${MR_CREATE_TOPIC_PATH} /topics/create ${MR_UPDATE_ACL_TOPIC_PATH} /topics/TEST_TOPIC_ACL/producers ${MR_ENDPOINT} ${GLOBAL_MR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_MR_IP_ADDR}:${GLOBAL_MR_SERVER_PORT} -${MR_PUBLISH_TEMPLATE} robot/assets/templates/mr_publish.template -${MR_PUT_ACL_TEMPLATE} robot/assets/templates/mr_put_acl.template +${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja +${MR_PUT_ACL_TEMPLATE} mr/mr_put_acl.jinja *** Keywords *** @@ -54,8 +54,8 @@ Run MR Update Topic Acl # Appears to not care if topic already exists with the POST / PUT method # ${dict}= Create Dictionary TOPIC_NAME=TEST_TOPIC_ACL - ${data}= Fill JSON Template File ${MR_PUT_ACL_TEMPLATE} ${dict} - #Log To Console ${\n}Create TEST_TOPIC_ACL + Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Apply Template mr ${MR_PUT_ACL_TEMPLATE} ${dict} ${resp}= Run MR Auth Post Request ${MR_CREATE_TOPIC_PATH} iPIxkpAMI8qTcQj8 Ehq3WyT4bkif4zwgEbvshGal ${data} #Log To Console Update Owner for TEST_TOPIC_ACL ${resp}= Run MR Auth Put Request ${MR_UPDATE_ACL_TOPIC_PATH}/iPIxkpAMI8qTcQj8 iPIxkpAMI8qTcQj8 Ehq3WyT4bkif4zwgEbvshGal ${data} @@ -111,7 +111,8 @@ Run MR Post Request ${session}= Create Session mr ${MR_ENDPOINT} ${timestamp}= Get Current Date ${dict}= Create Dictionary timestamp=${timestamp} - ${data}= Fill JSON Template File ${MR_PUBLISH_TEMPLATE} ${dict} + Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict} ${uuid}= Generate UUID4 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Post Request mr ${data_path} data=${data} headers=${headers} diff --git a/robot/resources/test_templates/pnf_registration_without_SO_template.robot b/robot/resources/test_templates/pnf_registration_without_SO_template.robot index 3f8d5bec..ae8ab2b9 100644 --- a/robot/resources/test_templates/pnf_registration_without_SO_template.robot +++ b/robot/resources/test_templates/pnf_registration_without_SO_template.robot @@ -15,7 +15,7 @@ Library ONAPLibrary.Utilities ${aai_so_registration_entry_template}= robot/assets/templates/aai/add_pnf_registration_info.template ${pnf_ves_integration_request}= robot/assets/templates/ves/pnf_registration_request.template ${DMAAP_MESSAGE_ROUTER_UNAUTHENTICATED_PNF_PATH} /events/unauthenticated.PNF_READY/2/1 -${VES_ENDPOINT} http://${GLOBAL_DNS_VES_NAME}:${GLOBAL_VES_SERVER_PORT} +${VES_ENDPOINT} ${GLOBAL_DCAE_VES_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_SERVER_PORT} ${VES_data_path} /eventListener/v7 -- cgit 1.2.3-korg