summaryrefslogtreecommitdiffstats
path: root/robot/resources/test_templates
diff options
context:
space:
mode:
Diffstat (limited to 'robot/resources/test_templates')
-rw-r--r--robot/resources/test_templates/closedloop_test_template.robot8
-rw-r--r--robot/resources/test_templates/hvves_template.robot19
2 files changed, 10 insertions, 17 deletions
diff --git a/robot/resources/test_templates/closedloop_test_template.robot b/robot/resources/test_templates/closedloop_test_template.robot
index 5853abf5..dcbb7e65 100644
--- a/robot/resources/test_templates/closedloop_test_template.robot
+++ b/robot/resources/test_templates/closedloop_test_template.robot
@@ -7,7 +7,6 @@ Resource ../stack_validation/packet_generator_interface.robot
Resource vnf_orchestration_test_template.robot
Library String
-Library HttpLibrary.HTTP
LIbrary Process
*** Variables ***
@@ -82,9 +81,7 @@ Get Configs VFW Policy
${output} = Fill JSON Template File ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name}
${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output}
Should Be Equal As Strings ${get_resp.status_code} 200
-
- ${json}= Parse Json ${get_resp.content}
- ${config}= Parse Json ${json[0]["config"]}
+ ${config}= Catenate ${get_resp.json()[0]["config"]}
${thresholds}= Get Variable Value ${config["content"]["tca_policy"]["metricsPerEventName"][0]["thresholds"]}
# Extract object1 from Array
@@ -104,8 +101,7 @@ Get Configs VDNS Policy
${output} = Fill JSON Template File ${GECONFIG_VFW_TEMPLATE} ${configpolicy_name}
${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output}
Should Be Equal As Strings ${get_resp.status_code} 200
- ${json}= Parse Json ${get_resp.content}
- ${config}= Parse Json ${json[0]["config"]}
+ ${config}= Catenate ${get_resp.json()[0]["config"]}
${thresholds}= Get Variable Value ${config["content"]["tca_policy"]["metricsPerEventName"][0]["thresholds"]}
# Extract object1 from Array
diff --git a/robot/resources/test_templates/hvves_template.robot b/robot/resources/test_templates/hvves_template.robot
index 622cacb0..74f04dc0 100644
--- a/robot/resources/test_templates/hvves_template.robot
+++ b/robot/resources/test_templates/hvves_template.robot
@@ -1,10 +1,10 @@
*** Settings ***
Documentation Template contains stuff for HV-VES use case.
Library OperatingSystem
+Library RequestsLibrary
Library Rammbock
Library BuiltIn
Library Collections
-Library HttpLibrary.HTTP
*** Variables ***
${hvves_message} 0x0a94020a0e73616d706c652d76657273696f6e12087065726633677070180120012a0a70657266334750503232321173616d706c652d6576656e742d6e616d653a1173616d706c652d6576656e742d7479706540f19afddd0548f19afddd05521573616d706c652d6e662d6e616d696e672d636f64655a1673616d706c652d6e66632d6e616d696e672d636f6465621573616d706c652d6e662d76656e646f722d6e616d656a1a73616d706c652d7265706f7274696e672d656e746974792d6964721c73616d706c652d7265706f7274696e672d656e746974792d6e616d657a1073616d706c652d736f757263652d696482010f73616d706c652d786e662d6e616d658a01095554432b30323a3030920105372e302e32120e7465737420746573742074657374
@@ -16,20 +16,17 @@ ${sasl_mechanisms} PLAIN
Check Message Router Api
[Documentation] Checks message via message router API.
[Arguments] ${message_router} ${message_router_port} ${topic}
- ${status} ${response}= Run Keyword And Ignore Error GET http://${message_router}:${message_router_port}/events/${topic}/1/1
- ${response_code}= Get Response Status
- ${response_body}= Get Response Body
- Run Keyword If '${status}'=='FAIL' Should Start With ${response_code} 404
- Run Keyword If '${status}'=='FAIL' Log Topic ${topic} does not exist.
- Run Keyword If '${status}'=='PASS' Should Start With ${response_code} 200
- Run Keyword If '${status}'=='PASS' Log Topic ${topic} exists.
+ ${session}= Create Session session http://${message_router}:${message_router_port}/events
+ ${resp}= Get Request session /${topic}/1/1
+ Run Keyword If 400 <= ${resp.status_code} < 500 Log Topic ${topic} does not exist.
+ Run Keyword If 200 <= ${resp.status_code} < 300 Log Topic ${topic} exists.
Check If Topic Exists
[Documentation] Checks if specific topic exists on kafka.
[Arguments] ${message_router} ${message_router_port} ${topic}
- ${response}= GET http://${message_router}:${message_router_port}/topics
- ${body}= Get Response Body
- ${value}= Get Json Value ${body} /topics
+ ${session}= Create Session session http://${message_router}:${message_router_port}/topics
+ ${resp}= Get Request session /
+ ${value}= Catenate ${resp.json()['topics']}
Should Contain ${value} ${topic}
Define WTP Protocol