From 1f0120ca6d1cb3de7c09c2eceba4e079651ba9eb Mon Sep 17 00:00:00 2001 From: Jozef Behran Date: Thu, 25 Feb 2016 17:21:45 +0100 Subject: [PATCH] Tidy new and updated test suites. Change-Id: I46fd19561a150a74db3e1de413f5db71a25baf64 Signed-off-by: Jozef Behran --- csit/libraries/TsdrUtils.robot | 3 +-- csit/libraries/VtnMaKeywords.robot | 10 +++++----- .../demo-asymmetric-chain/010_set_odl.robot | 4 +--- .../iotdm/basic/050_ContainerAttributeTest.robot | 2 -- .../iotdm/basic/060_ConInAttributeTest.robot | 4 ++-- csit/suites/iotdm/basic/070_DeleteTest.robot | 1 - .../iotdm/basic/080_FilterCriteriaTest.robot | 2 -- .../iotdm/basic/090_AccessControlPolicyTest.robot | 15 ++++++++------- csit/suites/iotdm/basic/100_NodeTest.robot | 6 +++--- csit/suites/snmp/snmp-get/010__snmp_get.robot | 2 +- csit/suites/tsdr/Cassandra/050_SyslogTable.robot | 8 +++----- csit/suites/tsdr/HBase/050_SyslogTable.robot | 7 ++----- .../suites/tsdr/HSQLDB/060_syslog_Collector.robot | 7 ++----- 13 files changed, 28 insertions(+), 43 deletions(-) diff --git a/csit/libraries/TsdrUtils.robot b/csit/libraries/TsdrUtils.robot index 02acab61b2..ccf8b6e421 100644 --- a/csit/libraries/TsdrUtils.robot +++ b/csit/libraries/TsdrUtils.robot @@ -30,10 +30,9 @@ ${SNMP_COMMUNITY} mib2dev\/if-mib &{HEADERS_QUERY} Content-Type=application/json Content-Type=application/json &{OPER_STATUS} up=1 down=2 testing=3 unknown=4 dormant=5 notPresent=6 lowerLayerDown=7 &{syslog_facility} kern=0 -${MESSAGE} Oct 29 18:10:31: ODL: %STKUNIT0-M:CP %IFMGR-5-ASTATE_UP: Changed interface Admin state to up: Te 0/0 +${MESSAGE} Oct 29 18:10:31: ODL: %STKUNIT0-M:CP %IFMGR-5-ASTATE_UP: Changed interface Admin state to up: Te 0/0 ${MESSAGE_PATTERN} Changed interface - *** Keywords *** Start Tsdr Suite [Arguments] ${switch}=ovsk ${switch_count}=3 diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index cdcdc0f8d7..0cfe2cc39d 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -16,13 +16,13 @@ ${VTN_INVENTORY} restconf/operational/vtn-inventory:vtn-nodes ${DUMPFLOWS_OF10} dpctl dump-flows -O OpenFlow10 ${DUMPFLOWS_OF13} dpctl dump-flows -O OpenFlow13 ${index} 7 -@{inet_actions} nw_src=10.0.0.1 nw_dst=10.0.0.3 -@{BRIDGE1_DATAFLOW} "reason":"PORTMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge1" "interface-name":"if2" -@{BRIDGE2_DATAFLOW} "reason":"PORTMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge2" "interface-name":"if3" +@{inet_actions} nw_src=10.0.0.1 nw_dst=10.0.0.3 +@{BRIDGE1_DATAFLOW} "reason":"PORTMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge1" "interface-name":"if2" +@{BRIDGE2_DATAFLOW} "reason":"PORTMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge2" "interface-name":"if3" ${vlanmap_bridge1} 200 ${vlanmap_bridge2} 300 -@{VLANMAP_BRIDGE1_DATAFLOW} "reason":"VLANMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge1_vlan" -@{VLANMAP_BRIDGE2_DATAFLOW} "reason":"VLANMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge2_vlan" +@{VLANMAP_BRIDGE1_DATAFLOW} "reason":"VLANMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge1_vlan" +@{VLANMAP_BRIDGE2_DATAFLOW} "reason":"VLANMAPPED" "tenant-name":"Tenant1" "bridge-name":"vBridge2_vlan" ${out_before_pathpolicy} output:2 ${out_after_pathpolicy} output:3 ${pathpolicy_topo_13} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow13 diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot index cb18cb6175..568ac597fa 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot @@ -16,8 +16,6 @@ Put Service Functions ${edited_json} Replace String ${json_to_edit} _SF1 ${GBPSFC3} ${edited_json} Replace String ${edited_json} _SF2 ${GBPSFC5} Add Elements To URI And Verify ${SF_PATH} ${edited_json} ${HEADERS_YANG_JSON} - - Put Service Function Forwarders [Documentation] Register Service Function Forwarders to ODL @@ -65,4 +63,4 @@ Register Endpoints : FOR ${endpoint_file} IN @{endpoint_files} \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} ${resp} RequestsLibrary.Get Request session ${ENDPOINTS_OPER_PATH} - Log ${resp.content} \ No newline at end of file + Log ${resp.content} diff --git a/csit/suites/iotdm/basic/050_ContainerAttributeTest.robot b/csit/suites/iotdm/basic/050_ContainerAttributeTest.robot index a8aec5a3c5..16eba2eaec 100644 --- a/csit/suites/iotdm/basic/050_ContainerAttributeTest.robot +++ b/csit/suites/iotdm/basic/050_ContainerAttributeTest.robot @@ -33,8 +33,6 @@ Set Suite Variable Should Contain ${text} "lt": "pi": "st": Should Contain ${text} "ct": "ty":3 "cbs" Should Not Contain S{text} "lbl" "creator" "or" - - #================================================== # Container Optional Attribute Test (Allowed) #================================================== diff --git a/csit/suites/iotdm/basic/060_ConInAttributeTest.robot b/csit/suites/iotdm/basic/060_ConInAttributeTest.robot index a4b4180a34..4a4be3fc60 100644 --- a/csit/suites/iotdm/basic/060_ConInAttributeTest.robot +++ b/csit/suites/iotdm/basic/060_ConInAttributeTest.robot @@ -213,7 +213,7 @@ Delete the ContenInstance 2.33 ${random} = Evaluate random.randint(0,50) modules=random ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"${random}" Create Resource ${iserver} ${container} ${rt_contentInstance} ${attr} - ${latestCon} = Get Latest ${container} + ${latestCon} = Get Latest ${container} Should Be Equal As Strings ${random} ${latestCon} 4.12 GetLatest Loop 50 times Test @@ -262,5 +262,5 @@ Latest Con Test ${random} = Evaluate random.randint(0,50) modules=random ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"${random}" Create Resource ${iserver} ${resourceURI} ${rt_contentInstance} ${attr} - ${latestCon} = Get Latest ${resourceURI} + ${latestCon} = Get Latest ${resourceURI} Should Be Equal As Strings ${random} ${latestCon} diff --git a/csit/suites/iotdm/basic/070_DeleteTest.robot b/csit/suites/iotdm/basic/070_DeleteTest.robot index a8de4ffc6e..1b9be44e4d 100644 --- a/csit/suites/iotdm/basic/070_DeleteTest.robot +++ b/csit/suites/iotdm/basic/070_DeleteTest.robot @@ -409,7 +409,6 @@ Response Is Correct ${status_code} = Status Code ${r} Should Be True 199 < ${status_code} < 299 - Cannot Retrieve Error [Arguments] ${uri} ${error} = Run Keyword And Expect Error * Retrieve Resource ${iserver} ${uri} diff --git a/csit/suites/iotdm/basic/080_FilterCriteriaTest.robot b/csit/suites/iotdm/basic/080_FilterCriteriaTest.robot index 9774e6522d..9a20502698 100644 --- a/csit/suites/iotdm/basic/080_FilterCriteriaTest.robot +++ b/csit/suites/iotdm/basic/080_FilterCriteriaTest.robot @@ -114,7 +114,6 @@ Create the tree 6. stateTagBigger ${r} = Retrieve Resource With Command ${iserver} InCSE1/Container3 rcn=4&stb=1 - ${count} = Get Length ${r.json()['m2m:cnt']['ch']} Should Be Equal As Integers ${count} 2 # 7. expireBefore @@ -142,7 +141,6 @@ Create the tree Should Be Equal As Integers ${count} 1 2.1 And Test - labels - ${r} = Retrieve Resource With Command ${iserver} InCSE1 fu=1&rcn=4&sts=4&lbl=contentInstanceUnderContainerContainer&lbl=underCSE ${count} = Get Length ${r.json()} Should Be Equal As Integers ${count} 6 diff --git a/csit/suites/iotdm/basic/090_AccessControlPolicyTest.robot b/csit/suites/iotdm/basic/090_AccessControlPolicyTest.robot index 1eeac91b37..b023d00877 100644 --- a/csit/suites/iotdm/basic/090_AccessControlPolicyTest.robot +++ b/csit/suites/iotdm/basic/090_AccessControlPolicyTest.robot @@ -10,7 +10,7 @@ ${httppass} admin ${rt_ae} 2 ${rt_container} 3 ${rt_contentInstance} 4 -${rt_acp} 1 +${rt_acp} 1 *** Test Cases *** Set Suite Variable @@ -51,9 +51,10 @@ Set Suite Variable Should Contain ${text} "ri": "pi": 1.3 Create ACP with invalid acip(ipv4) - [documentation] input a invalid ipv4 address and expect error + [Documentation] input a invalid ipv4 address and expect error ${attr} = Set Variable "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv4":["127.0.01"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp3" - ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp} ${attr} + ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp} + ... ${attr} Should Start with ${error} Cannot create this resource [400] Should Contain ${error} not a valid Ipv4 address @@ -68,13 +69,13 @@ Set Suite Variable Should Contain ${text} "ri": "pi": 1.5 Create ACP with invalid acip(ipv6) - [documentation] input a invalid Ipv6 address and expect error + [Documentation] input a invalid Ipv6 address and expect error ${attr} = Set Variable "pv":{"acr":[{"acor" : ["111","222"],"acop":35,"acco":[{"acip":{"ipv6":["2001:db8:0:0:0:ff00:42"]}}]},{"acor" : ["111","222"],"acop":35}]},"pvs":{"acr":[{"acor" : ["111","222"],"acop":7},{"acor" : ["111","222"],"acop":9}]},"rn":"Acp3" - ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp} ${attr} + ${error}= Run Keyword And Expect Error * Create Resource ${iserver} InCSE1 ${rt_acp} + ... ${attr} Should Start with ${error} Cannot create this resource [400] Should Contain ${error} not a valid Ipv6 address - *** Keywords *** Connect And Create Resource [Arguments] ${targetURI} ${resoutceType} ${attr} ${resourceName}=${EMPTY} @@ -90,4 +91,4 @@ Response Is Correct ${json} = Json ${r} LOG ${json} ${status_code} = Status Code ${r} - Should Be True 199 < ${status_code} < 299 \ No newline at end of file + Should Be True 199 < ${status_code} < 299 diff --git a/csit/suites/iotdm/basic/100_NodeTest.robot b/csit/suites/iotdm/basic/100_NodeTest.robot index e578c6379a..2a64e72aca 100644 --- a/csit/suites/iotdm/basic/100_NodeTest.robot +++ b/csit/suites/iotdm/basic/100_NodeTest.robot @@ -10,8 +10,8 @@ ${httppass} admin ${rt_ae} 2 ${rt_container} 3 ${rt_contentInstance} 4 -${rt_acp} 1 -${rt_node} 14 +${rt_acp} 1 +${rt_node} 14 *** Test Cases *** Set Suite Variable @@ -34,4 +34,4 @@ Set Suite Variable Should Contain ${text} "ri": "rn": "cni" Should Contain ${text} "lt": "pi": "st": Should Contain ${text} "ct": "rty":3 "cbs" - Should Not Contain S{text} "lbl" "creator" "or" \ No newline at end of file + Should Not Contain S{text} "lbl" "creator" "or" diff --git a/csit/suites/snmp/snmp-get/010__snmp_get.robot b/csit/suites/snmp/snmp-get/010__snmp_get.robot index a9d4f5ee72..74c0c145a6 100644 --- a/csit/suites/snmp/snmp-get/010__snmp_get.robot +++ b/csit/suites/snmp/snmp-get/010__snmp_get.robot @@ -19,4 +19,4 @@ List connections [Tags] SNMP get ${resp} Post session ${REST_CONTEXT_SNMP_SET} data={"input": {"ip-address": "${DEVICE_IP}","oid" : "1.3.6.1.2.1.1.1.0","get-type" : "GET-BULK","community" : "private" } } Should Be Equal As Strings ${resp.status_code} 200 - [Teardown] Report_Failure_Due_To_Bug 5360 \ No newline at end of file + [Teardown] Report_Failure_Due_To_Bug 5360 diff --git a/csit/suites/tsdr/Cassandra/050_SyslogTable.robot b/csit/suites/tsdr/Cassandra/050_SyslogTable.robot index 6271a67060..a82b120fb6 100644 --- a/csit/suites/tsdr/Cassandra/050_SyslogTable.robot +++ b/csit/suites/tsdr/Cassandra/050_SyslogTable.robot @@ -9,7 +9,6 @@ Resource ../../../libraries/TsdrUtils.robot Variables ../../../variables/Variables.py *** Test Cases *** - Verification of TSDR Cassandra Feature Installation [Documentation] Install and Verify the TSDR Cassandra Syslog Features Initialize Cassandra Tables Metricval val_table=metriclog @@ -19,21 +18,20 @@ Verification of TSDR Cassandra Feature Installation Sending syslog to ODL Syslog collector using Logger command [Documentation] Sending Syslogs to collector. - :FOR ${key} IN ZIP &{syslog_facility} + : FOR ${key} IN ZIP &{syslog_facility} \ ${value}= Get From Dictionary ${syslog_facility} ${key} \ ${f_value}= Evaluate ${value} * 8 \ Generate Syslog ${f_value} Verifying TSDR Data Store For Syslog Entries [Documentation] Verifying if syslogs is getting stored. - Copy TSDR tables val_table=metriclog + Copy TSDR tables val_table=metriclog ${metric_log}= Verify the Metrics Syslog on Cassandra Client grep DC=SYSLOG @{Syslogs}= Split to lines ${metric_log} ${iterator}= Set Variable 0 - :FOR ${key} IN ZIP &{syslog_facility} + : FOR ${key} IN ZIP &{syslog_facility} \ ${value}= Get From Dictionary ${syslog_facility} ${key} \ ${f_value}= Evaluate ${value} * 8 \ Should Contain @{syslogs}[${iterator}] ${MESSAGE} \ Should Contain @{syslogs}[${iterator}] <${f_value}> \ ${iterator}= Evaluate ${iterator} + 1 - diff --git a/csit/suites/tsdr/HBase/050_SyslogTable.robot b/csit/suites/tsdr/HBase/050_SyslogTable.robot index dd0d8d97df..8ad0f10e9b 100644 --- a/csit/suites/tsdr/HBase/050_SyslogTable.robot +++ b/csit/suites/tsdr/HBase/050_SyslogTable.robot @@ -9,7 +9,6 @@ Resource ../../../libraries/TsdrUtils.robot Variables ../../../variables/Variables.py *** Test Cases *** - Verification of TSDR HBase Feature Installation [Documentation] Install and Verify the TSDR Cassandra Syslog Features Wait Until Keyword Succeeds 24x 10 sec Check Karaf Log Has Messages tsdr.syslog @@ -19,15 +18,13 @@ Verification of TSDR HBase Feature Installation Sending syslog to ODL Syslog collector using Logger command [Documentation] Verifying if syslogs is collected and getting stored. Query the Data from HBaseClient truncate 'SYSLOG' - :FOR ${key} IN ZIP &{syslog_facility} + : FOR ${key} IN ZIP &{syslog_facility} \ ${value}= Get From Dictionary ${syslog_facility} ${key} \ ${f_value}= Evaluate ${value} * 8 \ Generate Syslog ${f_value} - ${output}= Query the Data from HBaseClient scan 'SYSLOG' Should Contain X Times ${output} ${MESSAGE_PATTERN} 1 - :FOR ${key} IN ZIP &{syslog_facility} + : FOR ${key} IN ZIP &{syslog_facility} \ ${value}= Get From Dictionary ${syslog_facility} ${key} \ ${f_value}= Evaluate ${value} * 8 \ Should Match ${output} *${f_value}>* - diff --git a/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot b/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot index 790b8c0d58..fbd14ec6af 100644 --- a/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot +++ b/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot @@ -9,7 +9,6 @@ Resource ../../../libraries/TsdrUtils.robot Variables ../../../variables/Variables.py *** Test Cases *** - Verification of TSDR HSQLDB Feature Installation [Documentation] Install and Verify the TSDR Cassandra Syslog Features COMMENT Install a Feature odl-tsdr-hsqldb-all ${CONTROLLER} ${KARAF_SHELL_PORT} 60 @@ -18,10 +17,9 @@ Verification of TSDR HSQLDB Feature Installation Verify Feature Is Installed odl-tsdr-hsqldb Verify Feature Is Installed odl-tsdr-syslog-collector - Sending syslog to ODL Syslog collector using Logger command [Documentation] Verifying if syslogs is getting generated. - :FOR ${key} IN ZIP &{syslog_facility} + : FOR ${key} IN ZIP &{syslog_facility} \ ${value}= Get From Dictionary ${syslog_facility} ${key} \ ${f_value}= Evaluate ${value} * 8 \ Generate Syslog ${f_value} @@ -30,6 +28,5 @@ Sending syslog to ODL Syslog collector using Logger command Verifying TSDR Data Store For Syslog Entries [Documentation] Verifying if syslogs is getting stored. ${output}= Issue Command On Karaf Console tsdr:list SYSLOG - Should Contain X Times ${output} SYSLOG 1 + Should Contain X Times ${output} SYSLOG 1 Should Contain ${output} ${MESSAGE_PATTERN} - -- 2.36.6