Change comparestream usage 27/71427/3
authorTomas Markovic <tomas.markovic@pantheon.tech>
Thu, 26 Apr 2018 14:32:54 +0000 (16:32 +0200)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 27 Apr 2018 19:15:49 +0000 (19:15 +0000)
This patch makes lines in code shorter and cleaner.
Also robot logs are less pain to examine.

Change-Id: I5be5187c17cd82776c2c1962f145338540c1b2df
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpuser/basic.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot

index b8542a89ee594fc1b4fa2668de8a328bd7e3e5df..7d81884ca992d1739347120d5eafa575e51102ad 100644 (file)
@@ -105,53 +105,61 @@ Check_Talking_Topology_Is_Filled
 TC_R_Reset_Bgp_Peer_Session
     [Documentation]    Reset Peer Session
     [Tags]    Critical
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Test case valid only for versions oxygen and above.
     &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    TemplatedRequests.Post_As_Xml_Templated    folder=${BGP_VARIABLES_FOLDER}${/}peer_session/restart    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Post_As_Xml_Templated    folder=${BGP_VARIABLES_FOLDER}${/}peer_session/restart    mapping=${mapping}    session=${CONFIG_SESSION}
 
 TC_R_Check_For_Empty_Topology_After_Resetting
     [Documentation]    See example-ipv4-topology empty after resetting session
     [Tags]    critical
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    Wait_For_Topology_To_Change_To    ${empty_json}    030_Empty.json
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Test case valid only for versions oxygen and above.
+    Wait_For_Topology_To_Change_To    ${empty_json}    030_Empty.json
 
 TC_PG_Reconfigure_ODL_With_Peer_Group_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
     &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Configure_Peer_Group
+    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    Configure_Peer_Group
     &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
     ...    PEER_GROUP_NAME=${PEER_GROUP}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 TC_PG_Restart_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Restart_Talking_BGP_Speaker
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    Restart_Talking_BGP_Speaker
     [Teardown]    FailFast.Do_Not_Start_Failing_If_This_Failed
 
 TC_PG_Check_Talking_Topology_Is_Filled
     [Documentation]    See new routes in example-ipv4-topology as a proof that synchronization was correct.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Wait_For_Topology_To_Change_To    ${filled_json}    021_Filled.json
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    Wait_For_Topology_To_Change_To    ${filled_json}    021_Filled.json
 
 TC_PG_Reconfigure_ODL_With_Peer_Group_Without_Ipv4_Unicast
     [Documentation]    Configure BGP peer module with initiate-connection set to false. (Fluorine only)
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Configure_Peer_Group    peer_group_folder=peer_group_without_ipv4
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    Configure_Peer_Group    peer_group_folder=peer_group_without_ipv4
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 TC_PG_Check_For_Empty_Topology_After_Deconfiguration
     [Documentation]    See example-ipv4-topology empty after resetting session (Fluorine only)
     [Tags]    critical
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Wait_For_Topology_To_Change_To    ${empty_json}    031_Empty.json
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    Wait_For_Topology_To_Change_To    ${empty_json}    031_Empty.json
 
 TC_PG_Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false. (Fluorine only)
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
     &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
     ...    PEER_GROUP_NAME=${PEER_GROUP}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    Deconfigure_Peer_Group
+    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    Deconfigure_Peer_Group
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Kill_Talking_BGP_Speaker
index d6c28e4f2d59f5c8c6686c0a7cb32e8be97f1f1c..b7733a8205635b71e4097ffa83222c962460fd05 100644 (file)
@@ -43,8 +43,9 @@ Start_Pcc_Mock
 Configure_Speaker_Entity_Identifier
     [Documentation]    Additional PCEP Speaker configuration for at least oxygen streams.
     ...    Allows PCEP speaker to determine if state synchronization can be skipped when a PCEP session is restarted.
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Test case valid only for versions oxygen and above.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    TemplatedRequests.Put_As_Xml_Templated    ${PCEP_VARIABLES_FOLDER}${/}node_speaker_entity_identifier    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated    ${PCEP_VARIABLES_FOLDER}${/}node_speaker_entity_identifier    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Topology_Default
     [Documentation]    Compare pcep-topology to default_json, which includes a tunnel from pcc-mock.
index 691aa605cb48ad3622306262154b4ff501a90466..e720c2654fef37704f2ffc02c7bf72ac5b4516dc 100644 (file)
@@ -82,8 +82,9 @@ Topology_Intercondition
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}
     BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on    ${mapping}    ${CONFIG_SESSION}
     ...    verify=True
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}
-    ...    ${CONFIG_SESSION}    verify=True
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Rest of the test case valid only for versions oxygen and above.
+    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}    ${CONFIG_SESSION}
+    ...    verify=True
 
 Stop_Pcc_Mock_1
     [Documentation]    Stops First instance of pcc-mock.
@@ -119,8 +120,9 @@ Topology_Intercondition_2
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}
     BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on    ${mapping}    ${CONFIG_SESSION}
     ...    verify=True
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}
-    ...    ${CONFIG_SESSION}    verify=True
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Rest of the test case valid only for versions oxygen and above.
+    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}    ${CONFIG_SESSION}
+    ...    verify=True
 
 Update_Delegated
     [Documentation]    Perform update-lsp on the mocked tunnel, check response is success.
@@ -135,8 +137,9 @@ Topology_Updated
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}
     BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_updated    ${mapping}    ${CONFIG_SESSION}
     ...    verify=True
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_updated_state    ${mapping}
-    ...    ${CONFIG_SESSION}    verify=True
+    CompareStream.Run_Keyword_If_Less_Than_Oxygen    BuiltIn.Pass_Execution    Rest of the test case valid only for versions oxygen and above.
+    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_updated_state    ${mapping}    ${CONFIG_SESSION}
+    ...    verify=True
 
 Unset_Password
     [Documentation]    De-configure password for pcep dispatcher for client with Mininet IP address.