replace protobuf cli with robot lib 88/89188/1
authorDR695H <dr695h@att.com>
Mon, 3 Jun 2019 22:44:17 +0000 (18:44 -0400)
committerDR695H <dr695h@att.com>
Mon, 3 Jun 2019 22:45:41 +0000 (18:45 -0400)
Change-Id: I230ef223b8a9264d5935d7cdbccc7db8986c2257
Issue-ID: TEST-158
Signed-off-by: DR695H <dr695h@att.com>
docker/Dockerfile
red.xml
robot/assets/dcae/hvves_msg.raw [new file with mode: 0644]
robot/resources/dcae/hvves.robot
robot/testsuites/hvves.robot

index 723158a..32eb5fc 100644 (file)
@@ -36,7 +36,7 @@ RUN apt-get update \
             vim
             
 
-RUN pip install robotframework==3.1.1 \
+RUN pip install robotframework==3.1.2 \
     && python --version
 
 # Copy the robot code
diff --git a/red.xml b/red.xml
index d254d43..56b7159 100644 (file)
--- a/red.xml
+++ b/red.xml
@@ -10,7 +10,6 @@
     <referencedLibrary type="PYTHON" name="HTTPUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="StringTemplater" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="OpenstackLibrary" path="testsuite/robot/library/eteutils"/>
-    <referencedLibrary type="PYTHON" name="TemplatingEngine" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="SoUtils" path="testsuite/robot/library/vcpeutils"/>
     <referencedLibrary type="PYTHON" name="HEATUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="OSUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="KafkaLibrary" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="DateTime" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="SocketUtils" path="testsuite/robot/library/eteutils"/>
+    <referencedLibrary type="PYTHON" name="ONAPLibrary.Templating" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="ONAPLibrary.ServiceMapping" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="ONAPLibrary.JSON" path="testsuite/robot/library"/>
+    <referencedLibrary type="PYTHON" name="ONAPLibrary.Protobuf" path="testsuite/robot/library"/>
     <pythonpath>
         <path location="robot/library"/>
     </pythonpath>
diff --git a/robot/assets/dcae/hvves_msg.raw b/robot/assets/dcae/hvves_msg.raw
new file mode 100644 (file)
index 0000000..57d7e89
Binary files /dev/null and b/robot/assets/dcae/hvves_msg.raw differ
index 6823035..123bacb 100644 (file)
@@ -41,6 +41,6 @@ Decode Last Message From Topic
     [Documentation]     Decode last message from Kafka topic.
     [Arguments]     ${kafka_server}     ${kafka_port}     ${kafka_topic}    ${sec_protocol}    ${mechanisms}    ${username}    ${password}
     #Catenate    http://message-router.onap:3904/events/${kafka_topic}/group1/C1?timeout=5000?limit=1
-    ${msg}=     Run     kafkacat -C -b ${kafka_server}:${kafka_port} -t ${kafka_topic} -X security.protocol=${sec_protocol} -X sasl.mechanisms=${mechanisms} -X sasl.username=${username} -X sasl.password=${password} -D "" -o -1 -c 1 | protoc --decode_raw
+    ${msg}=     Run     kafkacat -C -b ${kafka_server}:${kafka_port} -t ${kafka_topic} -X security.protocol=${sec_protocol} -X sasl.mechanisms=${mechanisms} -X sasl.username=${username} -X sasl.password=${password} -D "" -o -1 -c 1
     [Return]    ${msg}
 
index ea9d678..733719d 100644 (file)
@@ -5,6 +5,7 @@ Test Timeout    3m
 Resource    ../resources/global_properties.robot
 Resource    ../resources/dcae/hvves.robot
 Library    OperatingSystem
+Library    ONAPLibrary.Protobuf    
 
 *** Test Cases ***
 HV-VES test case
@@ -12,6 +13,6 @@ HV-VES test case
     Start HV-VES TCP Client And Send Message     ${GLOBAL_DCAE_HVVES_SERVER_NAME}   ${GLOBAL_DCAE_HVVES_SERVER_PORT}
     Wait Until Keyword Succeeds      30s      5s      Check If Topic Exists     ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME}      ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT}      ${hvves_kafka_topic}
     Check Message Router Api    ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_NAME}    ${GLOBAL_DMAAP_MESSAGE_ROUTER_SERVER_PORT}    ${hvves_kafka_topic}
-    ${msg_decoded}=    Decode Last Message From Topic    ${GLOBAL_DMAAP_KAFKA_SERVER_NAME}    ${GLOBAL_DMAAP_KAFKA_SERVER_PORT}    ${hvves_kafka_topic}    ${security_protocol}    ${sasl_mechanisms}    ${GLOBAL_DMAAP_KAFKA_JAAS_USERNAME}    ${GLOBAL_DMAAP_KAFKA_JAAS_PASSWORD}
-    ${msg_decoded_template}=    Get File    ${EXECDIR}/robot/assets/templates/hvves/hvves_decoded_msg.template
-    Should Be Equal As Strings  ${msg_decoded}  ${msg_decoded_template}
\ No newline at end of file
+    ${msg}=    Decode Last Message From Topic    ${GLOBAL_DMAAP_KAFKA_SERVER_NAME}    ${GLOBAL_DMAAP_KAFKA_SERVER_PORT}    ${hvves_kafka_topic}    ${security_protocol}    ${sasl_mechanisms}    ${GLOBAL_DMAAP_KAFKA_JAAS_USERNAME}    ${GLOBAL_DMAAP_KAFKA_JAAS_PASSWORD}
+    ${results}=     Compare File To Message    ${EXECDIR}/robot/assets/dcae/hvves_msg.raw    ${msg}
+    Should Be True    ${results}
\ No newline at end of file