summaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
diff options
context:
space:
mode:
Diffstat (limited to 'test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot')
-rw-r--r--test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot48
1 files changed, 10 insertions, 38 deletions
diff --git a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
index a30a1ba01..59d44e158 100644
--- a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
+++ b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
@@ -1,16 +1,13 @@
*** Settings ***
Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields
Library RequestsLibrary
-Library DcaeLibrary.py
+Library DcaeLibrary
Library OperatingSystem
Library Collections
Variables ../resources/DcaeVariables.py
Resource ../resources/dcae_properties.robot
-
-
*** Variables ***
${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/test/csit/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json
-
*** Keywords ***
Get DCAE Nodes
[Documentation] Get DCAE Nodes from Consul Catalog
@@ -26,8 +23,6 @@ Get DCAE Nodes
${len}= Get Length ${NodeList}
Should Not Be Equal As Integers ${len} 0
[return] ${NodeList}
-
-
DCAE Node Health Check
[Documentation] Perform DCAE Node Health Check
[Arguments] ${NodeName}
@@ -43,76 +38,58 @@ DCAE Node Health Check
Should Not Be Equal As Integers ${len} 0
DCAE Check Health Status ${NodeName} ${StatusList[0]} Serf Health Status
#Run Keyword if ${len} > 1 DCAE Check Health Status ${NodeName} ${StatusList[1]} Serf Health Status
-
-
DCAE Check Health Status
[Arguments] ${NodeName} ${ItemStatus} ${CheckType}
Should Be Equal As Strings ${ItemStatus} passing
Log Node: ${NodeName} ${CheckType} check pass ok
-
VES Collector Suite Setup DMaaP
[Documentation] Start DMaaP Mockup Server
${ret}= Setup DMaaP Server
Should Be Equal As Strings ${ret} true
-
VES Collector Suite Shutdown DMaaP
[Documentation] Shutdown DMaaP Mockup Server
${ret}= Shutdown DMaap
Should Be Equal As Strings ${ret} true
-
-
-
-
Check DCAE Results
[Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN
[Arguments] ${json}
@{rows}= Get From Dictionary ${json['returns']} rows
@{headers}= Get From Dictionary ${json['returns']} columns
-
# Retrieve column names from headers
${columns}= Create List
:for ${header} in @{headers}
- \ ${colName}= Get From Dictionary ${header} colName
+ \ ${colName}= Get From Dictionary ${header} colName
\ Append To List ${columns} ${colName}
-
- # Process each row making sure status=GREEN
+ # Process each row making sure status=GREEN
:for ${row} in @{rows}
\ ${cells}= Get From Dictionary ${row} cells
- \ ${dict}= Make A Dictionary ${cells} ${columns}
+ \ ${dict}= Make A Dictionary ${cells} ${columns}
\ Dictionary Should Contain Item ${dict} healthTestStatus GREEN
-
-
Make A Dictionary
[Documentation] Given a list of column names and a list of dictionaries, map columname=value
[Arguments] ${columns} ${names} ${valuename}=value
${dict}= Create Dictionary
- ${collength}= Get Length ${columns}
- ${namelength}= Get Length ${names}
+ ${collength}= Get Length ${columns}
+ ${namelength}= Get Length ${names}
:for ${index} in range 0 ${collength}
\ ${name}= Evaluate ${names}[${index}]
\ ${valued}= Evaluate ${columns}[${index}]
\ ${value}= Get From Dictionary ${valued} ${valueName}
\ Set To Dictionary ${dict} ${name} ${value}
[Return] ${dict}
-
-
Get Event Data From File
[Arguments] ${jsonfile}
${data}= OperatingSystem.Get File ${jsonfile}
#Should Not Be_Equal ${data} None
[return] ${data}
-
Json String To Dictionary
[Arguments] ${json_string}
${json_dict}= evaluate json.loads('''${json_string}''') json
[return] ${json_dict}
-
Dictionary To Json String
[Arguments] ${json_dict}
${json_string}= evaluate json.dumps(${json_dict}) json
[return] ${json_string}
-
-
Get DCAE Service Component Status
[Documentation] Get the status of a DCAE Service Component
[Arguments] ${url} ${urlpath} ${usr} ${passwd}
@@ -120,26 +97,23 @@ Get DCAE Service Component Status
${session}= Create Session dcae-service-component ${url} auth=${auth}
${resp}= Get Request dcae-service-component ${urlpath}
[return] ${resp}
-
Publish Event To VES Collector No Auth
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata}
Log Creating session ${url}
- ${session}= Create Session dcae-d1 ${url}
- ${resp}= Post Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
+ ${session}= Create Session dcaegen2-d1 ${url}
+ ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} ${user} ${pd}
${auth}= Create List ${user} ${pd}
Log Creating session ${url}
- ${session}= Create Session dcae-d1 ${url} auth=${auth}
- ${resp}= Post Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
+ ${session}= Create Session dcaegen2-d1 ${url} auth=${auth} disable_warnings=1
+ ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector With Put Method
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} ${user} ${pd}
@@ -149,7 +123,6 @@ Publish Event To VES Collector With Put Method
${resp}= Put Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
-
Publish Event To VES Collector With Put Method No Auth
[Documentation] Send an event to VES Collector
[Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata}
@@ -158,4 +131,3 @@ Publish Event To VES Collector With Put Method No Auth
${resp}= Put Request dcae-d1 ${evtpath} data=${evtdata} headers=${httpheaders}
#Log Received response from dcae ${resp.json()}
[return] ${resp}
- \ No newline at end of file