Update Robot Framework format - step 3 33/102333/8
authorSangwook Ha <sangwook.ha@verizon.com>
Fri, 9 Sep 2022 23:53:47 +0000 (16:53 -0700)
committerSangwook Ha <sangwook.ha@verizon.com>
Fri, 7 Oct 2022 02:12:05 +0000 (19:12 -0700)
Robotidy has stricter formatting rules for line width, alignment,
section ordering & spacing, etc.

Update the format of Robot Framework files in the following directory
with Robotidy:

- csit/suites/bgpcep

JIRA: INTTEST-132
Change-Id: I0f93c6efab9f10a433285fd3562e9fef29993cf2
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
51 files changed:
csit/suites/bgpcep/bgpclustering/005_Cluster_Reset_And_Set_Nonreplicated_Bgp_Rib.robot
csit/suites/bgpcep/bgpclustering/010_singlepeer_prefixcount_1route.robot
csit/suites/bgpcep/bgpclustering/010_singlepeer_prefixcount_1route_nonreplicated_rib.robot
csit/suites/bgpcep/bgpclustering/020_singlepeer_prefixcount_100kroutes.robot
csit/suites/bgpcep/bgpclustering/020_singlepeer_prefixcount_100kroutes_nonreplicated_rib.robot
csit/suites/bgpcep/bgpclustering/030_singlepeer_prefixcount_1Mroutes.robot
csit/suites/bgpcep/bgpclustering/030_singlepeer_prefixcount_1Mroutes_nonreplicated_rib.robot
csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_isolation.robot
csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_restart.robot
csit/suites/bgpcep/bgpclustering/040_bgp_ha_karaf_stop.robot
csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_restart.robot
csit/suites/bgpcep/bgpclustering/050_bmp_ha_karaf_stop.robot
csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_restart.robot
csit/suites/bgpcep/bgpclustering/060_pcep_ha_karaf_stop.robot
csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_1Mroutes.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_1route.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes_longevity.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes_shards_local.robot
csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes_shards_remote.robot
csit/suites/bgpcep/bgpclustering/singlepeer_prefixcount_300kroutes.robot
csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot
csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot
csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot
csit/suites/bgpcep/bgpfunct/030_bgp_functional_evpn.robot
csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot
csit/suites/bgpcep/bgpfunct/050_bmp_basic.robot
csit/suites/bgpcep/bgpfunct/060_bgp_functional_mvpn.robot
csit/suites/bgpcep/bgpfunct/070_bgp_functional_l3vpn_mcast.robot
csit/suites/bgpcep/bgpfunct/080_bgp_functional_rt_constrain.robot
csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot
csit/suites/bgpcep/bgpfunct/100_bgp_functional_graceful_restart.robot
csit/suites/bgpcep/bgpfunct/bgp_functional_md5.robot
csit/suites/bgpcep/bgpfunct/bgp_ipv6_basic.robot
csit/suites/bgpcep/bgpfunct/bgp_llgr_basic.robot
csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot
csit/suites/bgpcep/bgpingest/bgp_app_peer_prefixcount.robot
csit/suites/bgpcep/bgpingest/manypeers_changecount.robot
csit/suites/bgpcep/bgpingest/manypeers_peercount.robot
csit/suites/bgpcep/bgpingest/manypeers_prefixcount.robot
csit/suites/bgpcep/bgpingest/singlepeer_changecount.robot
csit/suites/bgpcep/bgpingest/singlepeer_prefixcount.robot
csit/suites/bgpcep/bgpuser/basic.robot
csit/suites/bgpcep/bgpuser/bgp_app_peer_basic.robot
csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot
csit/suites/bgpcep/bgpuser/ibgp_peer_lsp.robot
csit/suites/bgpcep/bgpuser/ibgp_peers_basic.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot
csit/suites/bgpcep/throughpcep/cases.robot

index 793849f6539dfd3396defef275e0eb1148767ec8..89a8645d0ff1739c9b78ad2de64ec1d5685c0320 100644 (file)
@@ -1,26 +1,31 @@
 *** Settings ***
-Documentation     Kill nodes, delete all data created since boot, change cluster configs,
-...               start nodes, wait for sync.
+Documentation       Kill nodes, delete all data created since boot, change cluster configs,
+...                 start nodes, wait for sync.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
-Suite Setup       ClusterManagement.ClusterManagement_Setup
-Default Tags      clustering    critical
-Library           DateTime
-Library           OperatingSystem
-Library           SSHLibrary
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Library           ${CURDIR}/../../../libraries/ConfGen.py
-Library           Collections
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Library             DateTime
+Library             OperatingSystem
+Library             SSHLibrary
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Library             ${CURDIR}/../../../libraries/ConfGen.py
+Library             Collections
+
+Suite Setup         ClusterManagement.ClusterManagement_Setup
+
+Default Tags        clustering    critical
+
 
 *** Variables ***
-${MODULES_FILE}    modules.conf
-${MODULE_SHARDS_FILE}    module-shards.conf
-${RIB_SHARD_NAME}    bgp_rib
-${RIB_SHARD_NAMESPACE}    urn:opendaylight:params:xml:ns:yang:bgp-rib
+${MODULES_FILE}             modules.conf
+${MODULE_SHARDS_FILE}       module-shards.conf
+${RIB_SHARD_NAME}           bgp_rib
+${RIB_SHARD_NAMESPACE}      urn:opendaylight:params:xml:ns:yang:bgp-rib
+
 
 *** Test Cases ***
 Kill_All_Members
@@ -39,7 +44,10 @@ Upload_Initial_Config_Files
     [Documentation]    Upload config files for non-replicated bgp_rib
     FOR    ${idx}    IN    @{ClusterManagement__member_index_list}
         ${idxl}=    BuiltIn.Create_List    ${idx}
-        ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword    member_index_list=${idxl}    keyword_name=Set_Config_Files_With_Nonreplicated_Rib    index_list=${idxl}
+        ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword
+        ...    member_index_list=${idxl}
+        ...    keyword_name=Set_Config_Files_With_Nonreplicated_Rib
+        ...    index_list=${idxl}
     END
 
 Start_All_And_Sync
@@ -49,30 +57,50 @@ Start_All_And_Sync
     BuiltIn.Wait_Until_Keyword_Succeeds    2m    5s    Topology_Available
     ClusterManagement.Run_Bash_Command_On_List_Or_All    ps -ef | grep java
 
+
 *** Keywords ***
 Download_Karaf_Log
-    ${timestamp} =    DateTime.Get_Current_Date    time_zone=UTC    result_format=%Y%m%d%H%M%S%f
+    ${timestamp}=    DateTime.Get_Current_Date    time_zone=UTC    result_format=%Y%m%d%H%M%S%f
     SSHLibrary.Get_File    ${WORKSPACE}${/}${BUNDLEFOLDER}${/}data${/}log${/}karaf.log    karaf_${timestamp}.log
 
 Topology_Available
     ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    1
-    TemplatedRequests.Get_As_Json_From_Uri    /restconf/operational/network-topology:network-topology/topology/example-ipv4-topology    session=${session}
+    TemplatedRequests.Get_As_Json_From_Uri
+    ...    /restconf/operational/network-topology:network-topology/topology/example-ipv4-topology
+    ...    session=${session}
 
 Set_Config_Files_With_Nonreplicated_Rib
     [Arguments]    ${index_list}
-    ${modules_file}=    SSHLibrary.Execute_Command    ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleconf.xml
-    ${module_shards_file}=    SSHLibrary.Execute_Command    ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleshardconf.xml
+    ${modules_file}=    SSHLibrary.Execute_Command
+    ...    ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleconf.xml
+    ${module_shards_file}=    SSHLibrary.Execute_Command
+    ...    ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleshardconf.xml
     SSHLibrary.Get File    ${modules_file}    ${CURDIR}${/}${MODULES_FILE}.tmpl
     SSHLibrary.Get File    ${module_shards_file}    ${CURDIR}${/}${MODULE_SHARDS_FILE}.tmpl
-    ${modules_content}=    ConfGen.Generate_Modules    ${CURDIR}${/}${MODULES_FILE}.tmpl    name=${RIB_SHARD_NAME}    namespace=${RIB_SHARD_NAMESPACE}
-    ${ms_content}=    ConfGen.Generate_Module_Shards    ${CURDIR}${/}${MODULE_SHARDS_FILE}.tmpl    nodes=${NUM_ODL_SYSTEM}    shard_name=${RIB_SHARD_NAME}    replicas=${index_list}
+    ${modules_content}=    ConfGen.Generate_Modules
+    ...    ${CURDIR}${/}${MODULES_FILE}.tmpl
+    ...    name=${RIB_SHARD_NAME}
+    ...    namespace=${RIB_SHARD_NAMESPACE}
+    ${ms_content}=    ConfGen.Generate_Module_Shards
+    ...    ${CURDIR}${/}${MODULE_SHARDS_FILE}.tmpl
+    ...    nodes=${NUM_ODL_SYSTEM}
+    ...    shard_name=${RIB_SHARD_NAME}
+    ...    replicas=${index_list}
     OperatingSystem.Create File    ${CURDIR}${/}${MODULES_FILE}    ${modules_content}
     OperatingSystem.Create File    ${CURDIR}${/}${MODULE_SHARDS_FILE}    ${ms_content}
-    SSHLibrary.Put File    ${CURDIR}${/}${MODULES_FILE}    ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE}
-    SSHLibrary.Put File    ${CURDIR}${/}${MODULE_SHARDS_FILE}    ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE}
-    ${stdout}    ${stderr}=    SSHLibrary.Execute_Command    cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE}    return_stderr=True
+    SSHLibrary.Put File
+    ...    ${CURDIR}${/}${MODULES_FILE}
+    ...    ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE}
+    SSHLibrary.Put File
+    ...    ${CURDIR}${/}${MODULE_SHARDS_FILE}
+    ...    ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE}
+    ${stdout}    ${stderr}=    SSHLibrary.Execute_Command
+    ...    cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE}
+    ...    return_stderr=True
     BuiltIn.Log    ${stdout}
     BuiltIn.Should_Be_Empty    ${stderr}
-    ${stdout}    ${stderr}=    SSHLibrary.Execute_Command    cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE}    return_stderr=True
+    ${stdout}    ${stderr}=    SSHLibrary.Execute_Command
+    ...    cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE}
+    ...    return_stderr=True
     BuiltIn.Log    ${stdout}
     BuiltIn.Should_Be_Empty    ${stderr}
index 28917f43767ba6b148abe8022aa0cb1073b28354..94a4c0987b249969e3e775114cc0614be31f25b4 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
-...               RIB is not examined.
-...               <dst-id> is recognized during the suite run, should be the Leader of default
-...               operational Shard, otherwise the scenario would fail due to
-...               https://bugs.opendaylight.org/show_bug.cgi?id=5536
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
+...                 RIB is not examined.
+...                 <dst-id> is recognized during the suite run, should be the Leader of default
+...                 operational Shard, otherwise the scenario would fail due to
+...                 https://bugs.opendaylight.org/show_bug.cgi?id=5536
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1
+${COUNT}    1
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -76,33 +109,60 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -114,17 +174,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -147,6 +225,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index 70f72a67ccaf22328302f1bda398281adab6d49d..7b940bdaf967d2ab72d9c30246bc955538a3c1fa 100644 (file)
@@ -1,63 +1,82 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology default operational
-...               shard leader only. Less stress for cluster is expected as if followers were
-...               triggered for that.
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology default operational
+...                 shard leader only. Less stress for cluster is expected as if followers were
+...                 triggered for that.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1
+${COUNT}    1
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Get Topology Operational Leader
     [Documentation]    Gets the operational topology shard leader
-    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology    shard_type=operational
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
+    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=topology
+    ...    shard_type=operational
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
     BuiltIn.Set_Suite_Variable    ${topo_lead_ses}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module in passive mode (not initiating connection)
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true
+    &{mapping}=    Create Dictionary
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
@@ -67,13 +86,22 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -85,7 +113,13 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -95,5 +129,5 @@ Check_For_Empty_Ipv4_Topology_After_Listening
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
index db45641a9f488d38ab3f1380a3df5b15be7e4331..5173e99537256c1f1634b7ec593ece723beb30c6 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
-...               RIB is not examined.
-...               <dst-id> is recognized during the suite run, should be the Leader of default
-...               operational Shard, otherwise the scenario would fail due to
-...               https://bugs.opendaylight.org/show_bug.cgi?id=5536
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
+...                 RIB is not examined.
+...                 <dst-id> is recognized during the suite run, should be the Leader of default
+...                 operational Shard, otherwise the scenario would fail due to
+...                 https://bugs.opendaylight.org/show_bug.cgi?id=5536
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          100000
+${COUNT}    100000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -76,33 +109,60 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -114,17 +174,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -147,6 +225,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index 2df55008bc04558925e4811aba2b237776fccbf3..d7dc76b4b4e43606ce9d9715f846a8138f0f39ba 100644 (file)
@@ -1,63 +1,82 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology default operational
-...               shard leader only. Less stress for cluster is expected as if followers were
-...               triggered for that.
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology default operational
+...                 shard leader only. Less stress for cluster is expected as if followers were
+...                 triggered for that.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          100000
+${COUNT}    100000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Get Topology Operational Leader
     [Documentation]    Gets the operational topology shard leader
-    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology    shard_type=operational
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
+    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=topology
+    ...    shard_type=operational
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
     BuiltIn.Set_Suite_Variable    ${topo_lead_ses}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module in passive mode (not initiating connection)
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true
+    &{mapping}=    Create Dictionary
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
@@ -67,13 +86,22 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -85,7 +113,13 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -95,5 +129,5 @@ Check_For_Empty_Ipv4_Topology_After_Listening
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
index 19a3d8a01a8b5234312fd84701f728f57aec2cee..6f1302b565bf955d3db2f6a5cc0dd65f2c7cf2b9 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
-...               RIB is not examined.
-...               <dst-id> is recognized during the suite run, should be the Leader of default
-...               operational Shard, otherwise the scenario would fail due to
-...               https://bugs.opendaylight.org/show_bug.cgi?id=5536
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
+...                 RIB is not examined.
+...                 <dst-id> is recognized during the suite run, should be the Leader of default
+...                 operational Shard, otherwise the scenario would fail due to
+...                 https://bugs.opendaylight.org/show_bug.cgi?id=5536
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1000000
+${COUNT}    1000000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -76,33 +109,60 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -114,17 +174,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -147,6 +225,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index 1ef719ded74aeafaaeeb7ca9ceef7ab6a2dc6da3..c62965d9a503e4eae301bfede27e541f74266140 100644 (file)
@@ -1,63 +1,82 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology default operational
-...               shard leader only. Less stress for cluster is expected as if followers were
-...               triggered for that.
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          PrefixcountKeywords.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology default operational
+...                 shard leader only. Less stress for cluster is expected as if followers were
+...                 triggered for that.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1000000
+${COUNT}    1000000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Get Topology Operational Leader
     [Documentation]    Gets the operational topology shard leader
-    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=topology    shard_type=operational
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
+    ${leader}    ${followers}=    ClusterManagement.Get_Leader_And_Followers_For_Shard
+    ...    shard_name=topology
+    ...    shard_type=operational
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    ${leader}
     BuiltIn.Set_Suite_Variable    ${topo_lead_ses}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module in passive mode (not initiating connection)
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true
+    &{mapping}=    Create Dictionary
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
@@ -67,13 +86,22 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -85,7 +113,13 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${topo_lead_ses}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${topo_lead_ses}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -95,5 +129,5 @@ Check_For_Empty_Ipv4_Topology_After_Listening
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${config_session}
index 3420a49f753371f5f137c8363616487603029b7d..63cb0c93322b07760a2fc7da55ec19b39b61e290 100644 (file)
@@ -1,45 +1,54 @@
 *** Settings ***
-Documentation     BGP functional HA testing with one exabgp peer.
+Documentation       BGP functional HA testing with one exabgp peer.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
-...               Bgp implemented with singleton accepts only one incomming conection. Exabgp
-...               logs will show that one peer will be connected and two will fail.
-...               After isolating karaf which owned connection, new owner should be elected and
-...               this new owner should accept incomming bgp connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
+...                 Bgp implemented with singleton accepts only one incomming conection. Exabgp
+...                 logs will show that one peer will be connected and two will fail.
+...                 After isolating karaf which owned connection, new owner should be elected and
+...                 this new owner should accept incomming bgp connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpclustering
-${BGP_PEER_FOLDER}    ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAULT_EXA_CFG}    exa.cfg
-${EXA_CMD}        env exabgp.tcp.port=1790 exabgp
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
+${BGP_VAR_FOLDER}       ${CURDIR}/../../../variables/bgpclustering
+${BGP_PEER_FOLDER}      ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
+${DEFAULT_EXA_CFG}      exa.cfg
+${EXA_CMD}              env exabgp.tcp.port=1790 exabgp
+${HOLDTIME}             180
+${RIB_INSTANCE}         example-bgp-rib
+
 
 *** Test Cases ***
 Get_Example_Bgp_Rib_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    ClusterManagement.Get_Owner_And_Successors_For_Device    example-bgp-rib
-    ...    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_Device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${rib_owner}
     BuiltIn.Log    ${ODL_SYSTEM_${rib_owner}_IP}
     BuiltIn.Set Suite variable    ${rib_candidates}
@@ -50,8 +59,17 @@ Get_Example_Bgp_Rib_Owner
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_ExaBgp_Peer
@@ -75,7 +93,12 @@ Isolate_Current_Owner_Member
 
 Verify_New_Rib_Owner
     [Documentation]    Verifies if new owner of example-bgp-rib is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    Verify_New_Rib_Owner_Elected    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    Verify_New_Rib_Owner_Elected
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Reconnected
     [Documentation]    Verifies exabgp's presence in operational ds.
@@ -87,7 +110,12 @@ Rejoin_Isolated_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for example-bgp-rib
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Rib_Candidate_Present    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Rib_Candidate_Present
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Still_Connected
     [Documentation]    Verifies exabgp's presence in operational ds
@@ -101,15 +129,23 @@ Stop_ExaBgp_Peer
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
-    TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
+
 
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     ClusterManagement.ClusterManagement_Setup
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}=    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -123,13 +159,19 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Verify_New_Rib_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
 
 Verify_New_Rib_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
index 42a408fbd02b99c7434b63e571d7af7d1bd15f90..fbc713a53df6d47b7d4895540e9451d1d25f9c68 100644 (file)
@@ -1,45 +1,54 @@
 *** Settings ***
-Documentation     BGP functional HA testing with one exabgp peer.
+Documentation       BGP functional HA testing with one exabgp peer.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
-...               Bgp implemented with singleton accepts only one incomming conection. Exabgp
-...               logs will show that one peer will be connected and two will fail.
-...               After killing karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming bgp connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
+...                 Bgp implemented with singleton accepts only one incomming conection. Exabgp
+...                 logs will show that one peer will be connected and two will fail.
+...                 After killing karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming bgp connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpclustering
-${BGP_PEER_FOLDER}    ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAULT_EXA_CFG}    exa.cfg
-${EXA_CMD}        env exabgp.tcp.port=1790 exabgp
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
+${BGP_VAR_FOLDER}       ${CURDIR}/../../../variables/bgpclustering
+${BGP_PEER_FOLDER}      ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
+${DEFAULT_EXA_CFG}      exa.cfg
+${EXA_CMD}              env exabgp.tcp.port=1790 exabgp
+${HOLDTIME}             180
+${RIB_INSTANCE}         example-bgp-rib
+
 
 *** Test Cases ***
 Get_Example_Bgp_Rib_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    ClusterManagement.Get_Owner_And_Successors_For_Device    example-bgp-rib
-    ...    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_Device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${rib_owner}
     BuiltIn.Log    ${ODL_SYSTEM_${rib_owner}_IP}
     BuiltIn.Set Suite variable    ${rib_candidates}
@@ -50,8 +59,17 @@ Get_Example_Bgp_Rib_Owner
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_ExaBgp_Peer
@@ -75,7 +93,12 @@ Kill_Current_Owner_Member
 
 Verify_New_Rib_Owner
     [Documentation]    Verifies if new owner of example-bgp-rib is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    Verify_New_Rib_Owner_Elected    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    Verify_New_Rib_Owner_Elected
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Reconnected
     [Documentation]    Verifies exabgp's presence in operational ds.
@@ -87,7 +110,12 @@ Start_Stopped_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for example-bgp-rib
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Rib_Candidate_Present    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Rib_Candidate_Present
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Still_Connected
     [Documentation]    Verifies exabgp's presence in operational ds
@@ -101,15 +129,23 @@ Stop_ExaBgp_Peer
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
-    TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
+
 
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     ClusterManagement.ClusterManagement_Setup
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}=    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -124,13 +160,19 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Verify_New_Rib_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
 
 Verify_New_Rib_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
index 03dda12ba785ca532ae6048e6aaaf3106537386d..984abefb55bb88dc613be159ff63646d4f098912 100644 (file)
@@ -1,45 +1,54 @@
 *** Settings ***
-Documentation     BGP functional HA testing with one exabgp peer.
+Documentation       BGP functional HA testing with one exabgp peer.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
-...               Bgp implemented with singleton accepts only one incomming conection. Exabgp
-...               logs will show that one peer will be connected and two will fail.
-...               After stopping karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming bgp connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses exabgp. It is configured to have 3 peers (all 3 nodes of odl).
+...                 Bgp implemented with singleton accepts only one incomming conection. Exabgp
+...                 logs will show that one peer will be connected and two will fail.
+...                 After stopping karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming bgp connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpclustering
-${BGP_PEER_FOLDER}    ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAULT_EXA_CFG}    exa.cfg
-${EXA_CMD}        env exabgp.tcp.port=1790 exabgp
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
+${BGP_VAR_FOLDER}       ${CURDIR}/../../../variables/bgpclustering
+${BGP_PEER_FOLDER}      ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
+${DEFAULT_EXA_CFG}      exa.cfg
+${EXA_CMD}              env exabgp.tcp.port=1790 exabgp
+${HOLDTIME}             180
+${RIB_INSTANCE}         example-bgp-rib
+
 
 *** Test Cases ***
 Get_Example_Bgp_Rib_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    ClusterManagement.Get_Owner_And_Successors_For_Device    example-bgp-rib
-    ...    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_Device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${rib_owner}
     BuiltIn.Log    ${ODL_SYSTEM_${rib_owner}_IP}
     BuiltIn.Set Suite variable    ${rib_candidates}
@@ -50,8 +59,17 @@ Get_Example_Bgp_Rib_Owner
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_ExaBgp_Peer
@@ -75,7 +93,12 @@ Stop_Current_Owner_Member
 
 Verify_New_Rib_Owner
     [Documentation]    Verifies if new owner of example-bgp-rib is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    5s    Verify_New_Rib_Owner_Elected    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    5s
+    ...    Verify_New_Rib_Owner_Elected
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Reconnected
     [Documentation]    Verifies exabgp's presence in operational ds.
@@ -87,7 +110,12 @@ Start_Stopped_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for example-bgp-rib
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Rib_Candidate_Present    ${old_rib_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Rib_Candidate_Present
+    ...    ${old_rib_owner}
+    ...    ${living_node}
 
 Verify_ExaBgp_Still_Connected
     [Documentation]    Verifies exabgp's presence in operational ds
@@ -101,15 +129,23 @@ Stop_ExaBgp_Peer
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers
-    &{mapping}    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
-    TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${living_session}    http_timeout=5
+    &{mapping}=    Create Dictionary    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${TOOLS_SYSTEM_IP}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_PEER_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${living_session}
+    ...    http_timeout=5
+
 
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     ClusterManagement.ClusterManagement_Setup
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}=    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -124,13 +160,19 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Verify_New_Rib_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
 
 Verify_New_Rib_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
index 099b0e70f7a58d1b26138a000a7fd01602c8a015..d245dea5e8eb63622e445d3b81d17d93574d6d02 100644 (file)
@@ -1,42 +1,51 @@
 *** Settings ***
-Documentation     BMP functional HA testing with BMP mock.
+Documentation       BMP functional HA testing with BMP mock.
 ...
-...               Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses BMP mock. It is configured to have 3 peers (all 3 nodes of odl).
-...               BMP implemented with singleton accepts only one incomming conection. BMP mock
-...               logs will show that one peer will be connected and two will fail.
-...               After killing karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming BMP connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           Collections
-Library           OperatingSystem
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses BMP mock. It is configured to have 3 peers (all 3 nodes of odl).
+...                 BMP implemented with singleton accepts only one incomming conection. BMP mock
+...                 logs will show that one peer will be connected and two will fail.
+...                 After killing karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming BMP connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             Collections
+Library             OperatingSystem
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${HOLDTIME}       180
-${BMP_LOG_FILE}    bmpmock.restart.log
-${CONFIG_SESSION}    session
+${HOLDTIME}             180
+${BMP_LOG_FILE}         bmpmock.restart.log
+${CONFIG_SESSION}       session
+
 
 *** Test Cases ***
 Get_Example_Bm_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${bm_owner}    ${bm_candidates}=    Wait_Until_Keyword_Succeeds    5x    2s    ClusterManagement.Get_Owner_And_Successors_For_Device    bmp-monitors
-    ...    Bgpcep    1
+    ${bm_owner}    ${bm_candidates}=    Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_Device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${bm_owner}
     BuiltIn.Log    ${bm_owner}
     BuiltIn.Log    ${ODL_SYSTEM_${bm_owner}_IP}
@@ -62,7 +71,12 @@ Kill_Current_Owner_Member
 
 Verify_New_Bm_Owner
     [Documentation]    Verifies if new owner of bmp-monitor is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Bm_Owner_Elected    ${old_bm_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Bm_Owner_Elected
+    ...    ${old_bm_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_2
     [Documentation]    Verifies if example-bmp-monitor reported expected data
@@ -74,7 +88,12 @@ Start_Old_Owner_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for bmp-monitor
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Bm_Candidate_Present    ${old_bm_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Bm_Candidate_Present
+    ...    ${old_bm_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_3
     [Documentation]    Verifies if example-bmp-monitor reported expected data
@@ -84,6 +103,7 @@ Stop_Bmp_Mock
     [Documentation]    Send ctrl+c to bmp-mock to stop it
     BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
@@ -104,19 +124,26 @@ Teardown_Everything
 
 Start_Bmp_Mock
     [Documentation]    Starts bmp mock
-    ${command}=    BuiltIn.Set_Variable    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
+    ${command}=    BuiltIn.Set_Variable
+    ...    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
     BGPcliKeywords.Start_Java_Tool_And_Verify_Connection    ${command}    successfully established.
 
 Verify_New_Bm_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    bmp-monitors    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Log    ${owner}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
 
 Verify_New_Bm_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    bmp-monitors    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Log    ${owner}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
index 157959281da36e80ec50664943e43928314ab8b3..94f134f3c4f8b357f7b97643dfe5168be5ac10b8 100644 (file)
@@ -1,42 +1,51 @@
 *** Settings ***
-Documentation     BMP functional HA testing with one BMP mock.
+Documentation       BMP functional HA testing with one BMP mock.
 ...
-...               Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses BMP mock. It is configured to have 3 peers (all 3 nodes of odl).
-...               BMP implemented with singleton accepts only one incomming conection. BMP mock
-...               logs will show that one peer will be connected and two will fail.
-...               After stopping karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming BMP connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           Collections
-Library           OperatingSystem
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses BMP mock. It is configured to have 3 peers (all 3 nodes of odl).
+...                 BMP implemented with singleton accepts only one incomming conection. BMP mock
+...                 logs will show that one peer will be connected and two will fail.
+...                 After stopping karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming BMP connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             Collections
+Library             OperatingSystem
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${HOLDTIME}       180
-${BMP_LOG_FILE}    bmpmock.stop.log
-${CONFIG_SESSION}    session
+${HOLDTIME}             180
+${BMP_LOG_FILE}         bmpmock.stop.log
+${CONFIG_SESSION}       session
+
 
 *** Test Cases ***
 Get_Example_Bm_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${bm_owner}    ${bm_candidates}=    Wait_Until_Keyword_Succeeds    5x    2s    ClusterManagement.Get_Owner_And_Successors_For_Device    bmp-monitors
-    ...    Bgpcep    1
+    ${bm_owner}    ${bm_candidates}=    Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_Device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${bm_owner}
     BuiltIn.Log    ${bm_owner}
     BuiltIn.Log    ${ODL_SYSTEM_${bm_owner}_IP}
@@ -62,7 +71,12 @@ Stop_Current_Owner_Member
 
 Verify_New_Bm_Owner
     [Documentation]    Verifies if new owner of bmp-monitor is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Bm_Owner_Elected    ${old_bm_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Bm_Owner_Elected
+    ...    ${old_bm_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_2
     [Documentation]    Verifies if example-bmp-monitor reported expected data
@@ -74,7 +88,12 @@ Start_Old_Owner_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for bmp-monitor
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Bm_Candidate_Present    ${old_bm_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Bm_Candidate_Present
+    ...    ${old_bm_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_3
     [Documentation]    Verifies if example-bmp-monitor reported expected data
@@ -84,6 +103,7 @@ Stop_Bmp_Mock
     [Documentation]    Send ctrl+c to bmp-mock to stop it
     BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
@@ -104,19 +124,26 @@ Teardown_Everything
 
 Start_Bmp_Mock
     [Documentation]    Starts bmp mock
-    ${command}=    BuiltIn.Set_Variable    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
+    ${command}=    BuiltIn.Set_Variable
+    ...    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
     BGPcliKeywords.Start_Java_Tool_And_Verify_Connection    ${command}    successfully established.
 
 Verify_New_Bm_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    bmp-monitors    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Log    ${owner}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
 
 Verify_New_Bm_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    bmp-monitors    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    bmp-monitors
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Log    ${owner}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
index a0b46546dc9e10168f525354ba985ed9e7c9c18e..cf8e9d99344af0190450aa56fcb2fb503ee67e31 100644 (file)
@@ -1,46 +1,55 @@
 *** Settings ***
-Documentation     PCEP functional HA testing with one pcep peer.
+Documentation       PCEP functional HA testing with one pcep peer.
 ...
-...               Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses PCC mock. It is configured to have 3 peers (all 3 nodes of odl).
-...               PCEP implemented with singleton accepts only one incomming conection. PCC mock
-...               logs will show that one peer will be connected and two will fail.
-...               After killing karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming PCC connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           Collections
-Library           OperatingSystem
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/PcepOperations.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses PCC mock. It is configured to have 3 peers (all 3 nodes of odl).
+...                 PCEP implemented with singleton accepts only one incomming conection. PCC mock
+...                 logs will show that one peer will be connected and two will fail.
+...                 After killing karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming PCC connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             Collections
+Library             OperatingSystem
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/PcepOperations.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${HOLDTIME}       180
-${DIR_WITH_TEMPLATES}    ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}
-${PCC_LOG_FILE}    pccmock.restart.log
-${CONFIG_SESSION}    session
-${OLD_ERROR_ARGS}    \n"last-received-error": {},\n"last-sent-error": {},
-${NEW_ERROR_ARGS}    ${EMPTY}
+${HOLDTIME}                 180
+${DIR_WITH_TEMPLATES}       ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}
+${PCC_LOG_FILE}             pccmock.restart.log
+${CONFIG_SESSION}           session
+${OLD_ERROR_ARGS}           \n"last-received-error": {},\n"last-sent-error": {},
+${NEW_ERROR_ARGS}           ${EMPTY}
+
 
 *** Test Cases ***
 Get_Example_Pcep_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${pcep_owner}    ${pcep_candidates}=    Wait_Until_Keyword_Succeeds    5x    2s    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology
-    ...    Bgpcep    1
+    ${pcep_owner}    ${pcep_candidates}=    Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${pcep_owner}
     BuiltIn.Log    ${pcep_owner}
     BuiltIn.Set Suite variable    ${pcep_candidates}
@@ -66,7 +75,12 @@ Kill_Current_Owner_Member
 
 Verify_New_Pcep_Owner
     [Documentation]    Verifies if new owner of pcep-topology is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Pcep_Owner_Elected    ${old_pcep_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Pcep_Owner_Elected
+    ...    ${old_pcep_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_2
     [Documentation]    Verifies if pcep-topology reports expected data
@@ -79,7 +93,12 @@ Start_Stopped_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for pcep_topology
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Pcep_Candidate_Present    ${old_pcep_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Pcep_Candidate_Present
+    ...    ${old_pcep_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_3
     [Documentation]    Verifies if pcep-topology reported expected data
@@ -90,6 +109,7 @@ Stop_Pcc_Mock
     [Documentation]    Send ctrl+c to pcc-mock to stop it.
     BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
@@ -105,7 +125,7 @@ Setup_Everything
     ${code}=    Evaluate    binascii.b2a_base64('${pcc_name}')[:-1]    modules=binascii
     BuiltIn.Set_Suite_Variable    ${pcc_name_code}    ${code}
     PcepOperations.Pcep_Topology_Precondition    ${CONFIG_SESSION}
-    ${ERROR_ARGS} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
+    ${ERROR_ARGS}=    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
     BuiltIn.Set_Suite_Variable    ${ERROR_ARGS}
     Start_Pcc_Mock
 
@@ -117,26 +137,44 @@ Teardown_Everything
 
 Start_Pcc_Mock
     [Documentation]    Starts pcc mock
-    ${command}=    BuiltIn.Set_Variable    -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
+    ${command}=    BuiltIn.Set_Variable
+    ...    -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
     BGPcliKeywords.Start_Java_Tool_And_Verify_Connection    ${command}    started
 
 Pcep_Topology_Postcondition
     [Documentation]    Verifies if the tool reported expected data
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}    ERRORS=${ERROR_ARGS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}pcep_on_state    ${mapping}    ${living_session}
+    &{mapping}=    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    CODE=${pcc_name_code}
+    ...    NAME=${pcc_name}
+    ...    IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}
+    ...    ERRORS=${ERROR_ARGS}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${DIR_WITH_TEMPLATES}${/}pcep_on_state
+    ...    ${mapping}
+    ...    ${living_session}
     ...    verify=True
 
 Verify_New_Pcep_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
     BuiltIn.Set_Suite_Variable    ${pcep_owner}    ${owner}
 
 Verify_New_Pcep_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    ${node_to_ask}
     Collections.Append_To_List    ${candidates}    ${owner}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
     BuiltIn.Set_Suite_Variable    ${pcep_owner}    ${owner}
index a00344ef9dc61e7851a4beb200a867b53655747e..6f7bb7cfa78492aa40f944e2a2e8bc14e65d96e5 100644 (file)
@@ -1,46 +1,55 @@
 *** Settings ***
-Documentation     PCEP functional HA testing with one pcep peer.
+Documentation       PCEP functional HA testing with one pcep peer.
 ...
-...               Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses PCC mock. It is configured to have 3 peers (all 3 nodes of odl).
-...               PCEP implemented with singleton accepts only one incomming conection. PCC mock
-...               logs will show that one peer will be connected and two will fail.
-...               After stopping karaf which owned connection new owner should be elected and
-...               this new owner should accept incomming PCC connection.
-...               TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           Collections
-Library           OperatingSystem
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/PcepOperations.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses PCC mock. It is configured to have 3 peers (all 3 nodes of odl).
+...                 PCEP implemented with singleton accepts only one incomming conection. PCC mock
+...                 logs will show that one peer will be connected and two will fail.
+...                 After stopping karaf which owned connection new owner should be elected and
+...                 this new owner should accept incomming PCC connection.
+...                 TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
+
+Library             SSHLibrary    timeout=10s
+Library             Collections
+Library             OperatingSystem
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/PcepOperations.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${HOLDTIME}       180
-${DIR_WITH_TEMPLATES}    ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}
-${PCC_LOG_FILE}    pccmock.stop.log
-${CONFIG_SESSION}    session
-${OLD_ERROR_ARGS}    \n"last-received-error": {},\n"last-sent-error": {},
-${NEW_ERROR_ARGS}    ${EMPTY}
+${HOLDTIME}                 180
+${DIR_WITH_TEMPLATES}       ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}
+${PCC_LOG_FILE}             pccmock.stop.log
+${CONFIG_SESSION}           session
+${OLD_ERROR_ARGS}           \n"last-received-error": {},\n"last-sent-error": {},
+${NEW_ERROR_ARGS}           ${EMPTY}
+
 
 *** Test Cases ***
 Get_Example_Pcep_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${pcep_owner}    ${pcep_candidates}=    Wait_Until_Keyword_Succeeds    5x    2s    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology
-    ...    Bgpcep    1
+    ${pcep_owner}    ${pcep_candidates}=    Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set Suite variable    ${pcep_owner}
     BuiltIn.Log    ${pcep_owner}
     BuiltIn.Set Suite variable    ${pcep_candidates}
@@ -66,7 +75,12 @@ Stop_Current_Owner_Member
 
 Verify_New_Pcep_Owner
     [Documentation]    Verifies if new owner of pcep-topology is elected.
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Pcep_Owner_Elected    ${old_pcep_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Pcep_Owner_Elected
+    ...    ${old_pcep_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_2
     [Documentation]    Verifies if pcep-topology reports expected data
@@ -79,7 +93,12 @@ Start_Stopped_Member
 
 Verify_New_Candidate
     [Documentation]    Verifies started node become candidate for pcep_topology
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    Verify_New_Pcep_Candidate_Present    ${old_pcep_owner}    ${living_node}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    Verify_New_Pcep_Candidate_Present
+    ...    ${old_pcep_owner}
+    ...    ${living_node}
 
 Verify_Data_Reported_3
     [Documentation]    Verifies if pcep-topology reported expected data
@@ -90,6 +109,7 @@ Stop_Pcc_Mock
     [Documentation]    Send ctrl+c to pcc-mock to stop it.
     BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initial setup
@@ -104,7 +124,7 @@ Setup_Everything
     ${code}=    Evaluate    binascii.b2a_base64('${pcc_name}')[:-1]    modules=binascii
     BuiltIn.Set_Suite_Variable    ${pcc_name_code}    ${code}
     PcepOperations.Pcep_Topology_Precondition    ${CONFIG_SESSION}
-    ${ERROR_ARGS} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
+    ${ERROR_ARGS}=    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
     BuiltIn.Set_Suite_Variable    ${ERROR_ARGS}
     Start_Pcc_Mock
 
@@ -116,26 +136,44 @@ Teardown_Everything
 
 Start_Pcc_Mock
     [Documentation]    Starts pcc mock
-    ${command}=    BuiltIn.Set_Variable    -jar ${filename} --reconnect 5 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
+    ${command}=    BuiltIn.Set_Variable
+    ...    -jar ${filename} --reconnect 5 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
     BGPcliKeywords.Start_Java_Tool_And_Verify_Connection    ${command}    started
 
 Pcep_Topology_Postcondition
     [Documentation]    Verifies if the tool reported expected data
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}    ERRORS=${ERROR_ARGS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    10x    5s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}pcep_on_state    ${mapping}    ${living_session}
+    &{mapping}=    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    CODE=${pcc_name_code}
+    ...    NAME=${pcc_name}
+    ...    IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}
+    ...    ERRORS=${ERROR_ARGS}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10x
+    ...    5s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${DIR_WITH_TEMPLATES}${/}pcep_on_state
+    ...    ${mapping}
+    ...    ${living_session}
     ...    verify=True
 
 Verify_New_Pcep_Owner_Elected
-    [Arguments]    ${old_owner}    ${node_to_ask}
     [Documentation]    Verifies new owner was elected
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology    Bgpcep    ${node_to_ask}
+    [Arguments]    ${old_owner}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    ${node_to_ask}
     BuiltIn.Should_Not_Be_Equal    ${old_owner}    ${owner}
     BuiltIn.Set_Suite_Variable    ${pcep_owner}    ${owner}
 
 Verify_New_Pcep_Candidate_Present
-    [Arguments]    ${candidate}    ${node_to_ask}
     [Documentation]    Verifies candidate's presence.
-    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    pcep-topology    Bgpcep    ${node_to_ask}
+    [Arguments]    ${candidate}    ${node_to_ask}
+    ${owner}    ${candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    pcep-topology
+    ...    Bgpcep
+    ...    ${node_to_ask}
     Collections.Append_To_List    ${candidates}    ${owner}
     BuiltIn.Should_Contain    ${candidates}    ${candidate}
     BuiltIn.Set_Suite_Variable    ${pcep_owner}    ${owner}
index 8fea3550ec95f880da89305ea201438ca68414d9..fdecc8dfb0dad1958fa0fb3a0d36180d6e0e801e 100644 (file)
@@ -1,57 +1,70 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               For propper usage of this resource ${config_session} varaible has to be set.
-...               It should point to http://<ip-addr>:${RESTCONFPORT}.
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterAdmin.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/ShardStability.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 For propper usage of this resource ${config_session} varaible has to be set.
+...                 It should point to http://<ip-addr>:${RESTCONFPORT}.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterAdmin.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/ShardStability.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_PEER_FOLDER}    ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf    # used for configuration of bgp peer via openconfig
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}/bgp_peer    # used for configuration of bgp peer
-${BGP_VARIABLES_FOLDER_OP}    ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}/bgp_peer_operational
-${CHECK_PERIOD}    10
-${HOLDTIME}       180
-${INSERT}         1
-${KARAF_LOG_LEVEL}    INFO
-${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
-${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
-${PREFILL}        0
-${REPETITIONS}    1
-${RESULTS_FILE_NAME}    bgp.csv
-${TEST_DURATION_MULTIPLIER}    1
-${UPDATE}         single
-${WITHDRAW}       0
-${INITIAL_RESTCONF_TIMEOUT}    30s
-${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
-${SHARD_DEFAULT_CONFIG}    shard-default-config
+${BGP_TOOL_LOG_LEVEL}           info
+# used for configuration of bgp peer via openconfig
+${BGP_PEER_FOLDER}
+...                             ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
+# used for configuration of bgp peer
+${BGP_VARIABLES_FOLDER}
+...                             ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}/bgp_peer
+${BGP_VARIABLES_FOLDER_OP}      ${CURDIR}/../../../variables/bgpclustering/${ODL_STREAM}/bgp_peer_operational
+${CHECK_PERIOD}                 10
+${HOLDTIME}                     180
+${INSERT}                       1
+${KARAF_LOG_LEVEL}              INFO
+${KARAF_BGPCEP_LOG_LEVEL}       ${KARAF_LOG_LEVEL}
+${KARAF_PROTOCOL_LOG_LEVEL}     ${KARAF_BGPCEP_LOG_LEVEL}
+${PREFILL}                      0
+${REPETITIONS}                  1
+${RESULTS_FILE_NAME}            bgp.csv
+${TEST_DURATION_MULTIPLIER}     1
+${UPDATE}                       single
+${WITHDRAW}                     0
+${INITIAL_RESTCONF_TIMEOUT}     30s
+${KARAF_HOME}                   ${WORKSPACE}/${BUNDLEFOLDER}
+${SHARD_DEFAULT_CONFIG}         shard-default-config
 ${SHARD_DEFAULT_OPERATIONAL}    shard-default-operational
-${EXAMPLE_IPV4_TOPOLOGY}    example-ipv4-topology
-${DEVICE_NAME}    peer-controller-config
-${DEVICE_CHECK_TIMEOUT}    60s
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${BGP_PEER_NAME}    example-bgp-peer
-@{SHARD_MONITOR_LIST}    default:config    default:operational    topology:config    topology:operational    inventory:config    inventory:operational
+${EXAMPLE_IPV4_TOPOLOGY}        example-ipv4-topology
+${DEVICE_NAME}                  peer-controller-config
+${DEVICE_CHECK_TIMEOUT}         60s
+${RIB_INSTANCE}                 example-bgp-rib
+${PROTOCOL_OPENCONFIG}          ${RIB_INSTANCE}
+${BGP_PEER_NAME}                example-bgp-peer
+@{SHARD_MONITOR_LIST}
+...                             default:config
+...                             default:operational
+...                             topology:config
+...                             topology:operational
+...                             inventory:config
+...                             inventory:operational
+
 
 *** Keywords ***
 Setup_Everything
@@ -92,40 +105,52 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Start_Bgp_Peer
-    [Arguments]    ${peerip}=${rib_owner_node_id}
     [Documentation]    Starts bgp peer and verifies that the peer runs.
+    [Arguments]    ${peerip}=${rib_owner_node_id}
     # TODO:    This keyword is not specific to prefix counting. Find a better place for it.
-    BGPSpeaker.Start_BGP_Speaker    --amount ${COUNT} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${peerip} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount ${COUNT} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${peerip} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
 
 Start_Bgp_Peer_And_Verify_Connected
-    [Arguments]    ${connection_retries}=${1}    ${peerip}=${rib_owner_node_id}
     [Documentation]    Starts the peer and verifies its connection. The verification is done by checking the presence
     ...    of the peer in the bgp rib.
+    [Arguments]    ${connection_retries}=${1}    ${peerip}=${rib_owner_node_id}
     # TODO:    This keyword is not specific to prefix counting. Find a better place for it.
     FOR    ${idx}    IN RANGE    ${connection_retries}
         Start_Bgp_Peer    peerip=${peerip}
-        ${status}    ${value}=    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    3x    3s
-        ...    Verify_Bgp_Peer_Connection    ${config_session}    ${TOOLS_SYSTEM_IP}    connected=${True}
-        BuiltIn.Run_Keyword_If    "${status}" != "PASS"    BGPSpeaker.Kill_BGP_Speaker
-        BuiltIn.Return_From_Keyword_If    "${status}" == "PASS"
+        ${status}    ${value} =    BuiltIn.Run_Keyword_And_Ignore_Error
+        ...    BuiltIn.Wait_Until_Keyword_Succeeds
+        ...    3x
+        ...    3s
+        ...    Verify_Bgp_Peer_Connection
+        ...    ${config_session}
+        ...    ${TOOLS_SYSTEM_IP}
+        ...    connected=${True}
+        IF    "${status}" != "PASS"    BGPSpeaker.Kill_BGP_Speaker
+        IF    "${status}" == "PASS"    RETURN
     END
     BuiltIn.Fail    Unable to connect bgp peer to ODL
 
 Verify_Bgp_Peer_Connection
-    [Arguments]    ${session}    ${peer_ip}    ${connected}=${True}
     [Documentation]    Checks peer presence in operational datastore
+    [Arguments]    ${session}    ${peer_ip}    ${connected}=${True}
     # TODO:    This keyword is not specific to prefix counting. Find a better place for it.
-    ${peer_check_url}=    BuiltIn.Set_Variable    ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
-    ${exp_status_code}=    BuiltIn.Set_Variable_If    ${connected}    ${200}    ${404}
-    ${rsp}=    RequestsLibrary.Get Request    ${session}    ${peer_check_url}${peer_ip}?content=nonconfig
+    ${peer_check_url} =    BuiltIn.Set_Variable    ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
+    ${exp_status_code} =    BuiltIn.Set_Variable_If    ${connected}    ${200}    ${404}
+    ${rsp} =    RequestsLibrary.Get Request    ${session}    ${peer_check_url}${peer_ip}?content=nonconfig
     BuiltIn.Log    ${rsp.content}
     BuiltIn.Should_Be_Equal_As_Numbers    ${exp_status_code}    ${rsp.status_code}
 
 Set_Shard_Leaders_Location_And_Verify
-    [Arguments]    ${requested_shard_localtion_idx}
     [Documentation]    Move default/topology config/operational shard location to local or remote node as requested
     ...    towards the given rib singleton instance location.
+    [Arguments]    ${requested_shard_localtion_idx}
     ShardStability.Set_Shard_Location    ${requested_shard_localtion_idx}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    5s    ShardStability.Verify_Shard_Leader_Located_As_Expected    ${requested_shard_localtion_idx}    http_timeout=125
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    30s
+    ...    5s
+    ...    ShardStability.Verify_Shard_Leader_Located_As_Expected
+    ...    ${requested_shard_localtion_idx}
+    ...    http_timeout=125
     ${init_shard_details} =    ShardStability.Shards_Stability_Get_Details    ${SHARD_MONITOR_LIST}
     BuiltIn.Set_Suite_Variable    ${init_shard_details}
index 9632284f1630217ebeb706d33a2f8511a05eddec..ed3cc6f83044c790ac6a728806c2c1fad0783786 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_1Mroutes:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_1Mroutes:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1000000
+${COUNT}    1000000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
     ...    This node should be used for bgp peer to connect to.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -78,34 +111,62 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -117,17 +178,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -150,6 +229,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index a2670f50e926b1098b7a8fa7752be9dd89a9fed0..f4c21d53d7b5939bad3dd240f8a22c48acc0504f 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_1route:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_1route:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          1
+${COUNT}    1
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
     ...    This node should be used for bgp peer to connect to.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -78,34 +111,62 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -117,17 +178,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -150,6 +229,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index c378e89229f9555e615e27ce5338cd66d7c20d0d..b00784dde8d3b851a9e03a21ff8e47b72e985ef9 100644 (file)
@@ -1,49 +1,56 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_300kroutes:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_300kroutes:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          300000
+${COUNT}    300000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
     ...    This node should be used for bgp peer to connect to.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking
@@ -51,15 +58,31 @@ Check_For_Empty_Ipv4_Topology_Before_Talking
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     FOR    ${member_index}    IN    @{pc_all_indices}
-        BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_${member_index}}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+        BuiltIn.Wait_Until_Keyword_Succeeds
+        ...    ${INITIAL_RESTCONF_TIMEOUT}
+        ...    1s
+        ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+        ...    session=${operational_${member_index}}
+        ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
     END
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -69,8 +92,15 @@ Start_Talking_BGP_Speaker
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from all nodes.
     FOR    ${member_index}    IN    @{pc_all_indices}
-        PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_${member_index}}
-        ...    topology=${EXAMPLE_IPV4_TOPOLOGY}    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+        PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+        ...    timeout=${bgp_filling_timeout}
+        ...    period=${CHECK_PERIOD}
+        ...    repetitions=${REPETITIONS}
+        ...    excluded_count=0
+        ...    session=${operational_${member_index}}
+        ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+        ...    shards_list=${SHARD_MONITOR_LIST}
+        ...    shards_details=${init_shard_details}
     END
 
 Check_Talking_Ipv4_Topology_Count
@@ -78,7 +108,10 @@ Check_Talking_Ipv4_Topology_Count
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     FOR    ${member_index}    IN    @{pc_all_indices}
-        PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_${member_index}}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+        PrefixCounting.Check_Ipv4_Topology_Count
+        ...    ${COUNT}
+        ...    session=${operational_${member_index}}
+        ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
     END
 
 Kill_Talking_BGP_Speaker
@@ -92,7 +125,12 @@ Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
     FOR    ${member_index}    IN    @{pc_all_indices}
-        PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_${member_index}}
+        PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+        ...    timeout=${bgp_filling_timeout}
+        ...    period=${CHECK_PERIOD}
+        ...    repetitions=${REPETITIONS}
+        ...    excluded_count=${COUNT}
+        ...    session=${operational_${member_index}}
         ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
     END
 
@@ -101,12 +139,21 @@ Check_For_Empty_Ipv4_Topology_After_Listening
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     FOR    ${member_index}    IN    @{pc_all_indices}
-        PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_${member_index}}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+        PrefixCounting.Check_Ipv4_Topology_Is_Empty
+        ...    session=${operational_${member_index}}
+        ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
     END
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index 5cfeb2a0544dea9f5c336764ff938f95a715be71..3a358fed58af1a021a43ae57e96b2e0cf4fd6b90 100644 (file)
@@ -1,64 +1,90 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_300kroutes_longevity.robot:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Default Tags      critical
-Library           SSHLibrary    timeout=10s
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_300kroutes_longevity.robot:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+
+Library             SSHLibrary    timeout=10s
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/WaitForFailure.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
+Default Tags        critical
+
 
 *** Variables ***
-${COUNT}          300000
+${COUNT}                                300000
 # TODO: change back to 24h when releng has more granular steps to kill VMs than days; now 23h=82800s
-${LONGEVITY_TEST_DURATION_IN_SECS}    82800
+${LONGEVITY_TEST_DURATION_IN_SECS}      82800
+
 
 *** Test Cases ***
 Configure_Prefixes_Longevity
     [Documentation]    Configure bgp peer, repeat the test scenario for 24h and deconfigure it.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     PrefixcountKeywords.Set_Shard_Leaders_Location_And_Verify    ${rib_owner}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    Check_For_Empty_Ipv4_Topology_On_All_Nodes
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    Check_For_Empty_Ipv4_Topology_On_All_Nodes
+    &{mapping}=    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     Check_For_Empty_Ipv4_Topology_On_All_Nodes
-    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${rib_owner}
+    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
     # TODO: Either define BGP_VARIABLES_FOLDER in this file, or create a Resource with the definition and wrapping keywords
     TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
-    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${LONGEVITY_TEST_DURATION_IN_SECS}    1s    Test_Scenario    ${rib_owner}
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
+    ...    ${LONGEVITY_TEST_DURATION_IN_SECS}
+    ...    1s
+    ...    Test_Scenario
+    ...    ${rib_owner}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${session}
 
+
 *** Keywords ***
 Test_Scenario
-    [Arguments]    ${rib_owner_id}
     [Documentation]    Connect bgp peer, advertize prefixes and disconnect. Check correct count of prefixes on odl.
-    PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected    connection_retries=${3}    peerip=${ODL_SYSTEM_${rib_owner_id}_IP}
+    [Arguments]    ${rib_owner_id}
+    PrefixcountKeywords.Start_Bgp_Peer_And_Verify_Connected
+    ...    connection_retries=${3}
+    ...    peerip=${ODL_SYSTEM_${rib_owner_id}_IP}
     Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes    excluded_count=0
     Check_Talking_Ipv4_Topology_Count_On_All_Nodes
     BGPSpeaker.Kill_BGP_Speaker
@@ -72,18 +98,48 @@ Check_For_Empty_Ipv4_Topology_On_All_Nodes
     PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_On_All_Nodes
-    [Arguments]    ${excluded_count}
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count.
+    [Arguments]    ${excluded_count}
     # TODO: Make the keyword accept member_index_list (or at least session_list) to monitor at once, so that robot can fail faster.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${excluded_count}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${excluded_count}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${excluded_count}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${excluded_count}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Check_Talking_Ipv4_Topology_Count_On_All_Nodes
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} on all nodes and fail if the count is not correct.
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
index ee01d71336c726987e16e7a67d3d364e4e65a288..aafad25980f0a4c10d17f309961b2fa55fe8b416 100644 (file)
@@ -1,52 +1,59 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_300kroutes_shards_local:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-...               shards_local - default and topology shards are on the same node as rib owner
-...               singleton instance
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_300kroutes_shards_local:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+...                 shards_local - default and topology shards are on the same node as rib owner
+...                 singleton instance
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          300000
+${COUNT}    300000
+
 
 *** Test Cases ***
 Get_Example_Bgp_Rib_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
     ...    This node should be used for bgp peer to connect to.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_candidates}    ${rib_candidates}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Move_Shard_Leaders_If_Needed
@@ -57,26 +64,52 @@ Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -85,36 +118,66 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -126,20 +189,41 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -162,6 +246,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index d960314f6eaebf07825e93849510f9df0981a75c..292620d8da1da28bc0fd206bd55c7f926d4b519d 100644 (file)
@@ -1,52 +1,59 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology on all nodes.
-...               RIB is not examined.
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology on all nodes.
+...                 RIB is not examined.
 ...
-...               singlepeer_pc_shm_300kroutes_shards_remote:
-...               pc - prefix counting
-...               shm - shard monitoring (during the process of prefix advertizing)
-...               shards_remote - default and topology shards are on a different node as rib owner
-...               singleton instance
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource          ${CURDIR}/../../../libraries/PrefixCounting.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/PrefixcountKeywords.robot
+...                 singlepeer_pc_shm_300kroutes_shards_remote:
+...                 pc - prefix counting
+...                 shm - shard monitoring (during the process of prefix advertizing)
+...                 shards_remote - default and topology shards are on a different node as rib owner
+...                 singleton instance
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPSpeaker.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/KillPythonTool.robot
+Resource            ${CURDIR}/../../../libraries/PrefixCounting.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/PrefixcountKeywords.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          300000
+${COUNT}    300000
+
 
 *** Test Cases ***
 Get_Example_Bgp_Rib_Owner
     [Documentation]    Find an odl node which is able to accept incomming connection. It is a node, which is the owner of bgp rib, as it is a singleton service.
     ...    This node should be used for bgp peer to connect to.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_candidates}    ${rib_candidates}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Move_Shard_Leaders_If_Needed
@@ -57,26 +64,52 @@ Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -85,36 +118,66 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -126,20 +189,41 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
-    ...    shards_list=${SHARD_MONITOR_LIST}    shards_details=${init_shard_details}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    ...    shards_list=${SHARD_MONITOR_LIST}
+    ...    shards_details=${init_shard_details}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -162,6 +246,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index f8c29637d7a4551428f57b73d9bbe0c6e2751f64..50fc036e4bbe2c170bc2974cbc3204763c0b5b2b 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py as single iBGP peer which talks to
-...               single controller in three node cluster configuration.
-...               Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
-...               RIB is not examined.
-...               <dst-id> is recognized during the suite run, should be the Leader of default
-...               operational Shard, otherwise the scenario would fail due to
-...               https://bugs.opendaylight.org/show_bug.cgi?id=5536
-Suite Setup       PrefixcountKeywords.Setup_Everything
-Suite Teardown    PrefixcountKeywords.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          PrefixcountKeywords.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite uses play.py as single iBGP peer which talks to
+...                 single controller in three node cluster configuration.
+...                 Test suite checks changes of the the example-ipv4-topology-<dst_id> on all nodes.
+...                 RIB is not examined.
+...                 <dst-id> is recognized during the suite run, should be the Leader of default
+...                 operational Shard, otherwise the scenario would fail due to
+...                 https://bugs.opendaylight.org/show_bug.cgi?id=5536
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            PrefixcountKeywords.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         PrefixcountKeywords.Setup_Everything
+Suite Teardown      PrefixcountKeywords.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${COUNT}          300000
+${COUNT}    300000
+
 
 *** Test Cases ***
 Get Example Bgp Rib Owner
     [Documentation]    Find an odl node which is able to accept incomming connection.
-    ${rib_owner}    ${rib_candidates}=    ClusterManagement.Get_Owner_And_Successors_For_device    example-bgp-rib    Bgpcep    1
+    ${rib_owner}    ${rib_candidates}    ClusterManagement.Get_Owner_And_Successors_For_device
+    ...    example-bgp-rib
+    ...    Bgpcep
+    ...    1
     BuiltIn.Set_Suite_Variable    ${rib_owner}    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${rib_owner_node_id}    ${ODL_SYSTEM_${rib_owner}_IP}
-    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
+    ${session}    ClusterManagement.Resolve_Http_Session_For_Member    ${rib_owner}
     BuiltIn.Set_Suite_Variable    ${config_session}    ${session}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_1
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_2
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_Before_Talking_3
     [Documentation]    Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${INITIAL_RESTCONF_TIMEOUT}    1s    PrefixCounting.Check_Ipv4_Topology_Is_Empty    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${INITIAL_RESTCONF_TIMEOUT}
+    ...    1s
+    ...    PrefixCounting.Check_Ipv4_Topology_Is_Empty
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Json_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}
+    ...    mapping=${mapping}
+    ...    session=${config_session}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_Speaker
@@ -76,33 +109,60 @@ Start_Talking_BGP_Speaker
 
 Wait_For_Stable_Talking_Ipv4_Topology_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 1.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 2.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Talking_Ipv4_Topology_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from node 3.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=0    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=0
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_1
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_2
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 2.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_Talking_Ipv4_Topology_Count_3
     [Documentation]    Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 3.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast.
@@ -114,17 +174,35 @@ Kill_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Listening_1
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_1}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_1}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_2
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 2.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_2}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_2}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening_3
     [Documentation]    Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 3.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD}    repetitions=${REPETITIONS}    excluded_count=${COUNT}    session=${operational_3}    topology=${EXAMPLE_IPV4_TOPOLOGY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD}
+    ...    repetitions=${REPETITIONS}
+    ...    excluded_count=${COUNT}
+    ...    session=${operational_3}
+    ...    topology=${EXAMPLE_IPV4_TOPOLOGY}
 
 Check_For_Empty_Ipv4_Topology_After_Listening_1
     [Documentation]    Example-ipv4-topology should be empty now as seen from node 1.
@@ -147,6 +225,13 @@ Check_For_Empty_Ipv4_Topology_After_Listening_3
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}    mapping=${mapping}    session=${config_session}
index 1dac0f52cc70f9a0690932d91bca5cdf1fac7b3d..7da6c6f68bec326af1a62bda155e4312a5e48e3b 100644 (file)
@@ -1,39 +1,44 @@
 *** Settings ***
-Documentation     Functional test for bgp flowspec.
+Documentation       Functional test for bgp flowspec.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpflowspec/
-${CMD}            env exabgp.tcp.port=1790 exabgp --debug
-${HOLDTIME}       180
-${OLD_AS_PATH}    \n"as-path": {},
-${NEW_AS_PATH}    ${EMPTY}
-${EXP0}           {"bgp-flowspec:flowspec-routes": {}}
-${CFG1}           bgp-flowspec.cfg
-${EXP1}           bgp_flowspec
-${CFG2}           bgp-flowspec-redirect.cfg
-${EXP2}           bgp_flowspec_redirect
-${FLOWSPEC_URL}    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes
-${CONFIG_SESSION}    session
-${DEVICE_NAME}    controller-config
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
+${BGP_VARIABLES_FOLDER}     ${CURDIR}/../../../variables/bgpflowspec/
+${CMD}                      env exabgp.tcp.port=1790 exabgp --debug
+${HOLDTIME}                 180
+${OLD_AS_PATH}              \n"as-path": {},
+${NEW_AS_PATH}              ${EMPTY}
+${EXP0}                     {"bgp-flowspec:flowspec-routes": {}}
+${CFG1}                     bgp-flowspec.cfg
+${EXP1}                     bgp_flowspec
+${CFG2}                     bgp-flowspec-redirect.cfg
+${EXP2}                     bgp_flowspec_redirect
+${FLOWSPEC_URL}
+...                         /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes
+${CONFIG_SESSION}           session
+${DEVICE_NAME}              controller-config
+${RIB_INSTANCE}             example-bgp-rib
+${PROTOCOL_OPENCONFIG}      ${RIB_INSTANCE}
 @{EMPTY_LIST}
 
+
 *** Test Cases ***
 Check_For_Empty_Topology_Before_Talking
     [Documentation]    Sanity check bgp-flowspec:flowspec-routes is up but empty.
@@ -42,9 +47,17 @@ Check_For_Empty_Topology_Before_Talking
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     ...    PASSIVE_MODE=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 FlowSpec_Test_1
     [Documentation]    Testing flowspec values for ${CFG1}
@@ -61,7 +74,11 @@ FlowSpec_Test_2
 Deconfigure_ODL_To_Accept_Connection
     [Documentation]    Deconfigure BGP peer.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Start_Suite
@@ -73,7 +90,7 @@ Start_Suite
     SSHKeywords.Virtual_Env_Install_Package    exabgp==3.4.16
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     Upload_Config_Files    ${BGP_VARIABLES_FOLDER}
-    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
+    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
     BuiltIn.Set_Suite_Variable    ${AS_PATH}
 
 Stop_Suite
@@ -82,21 +99,25 @@ Stop_Suite
     RequestsLibrary.Delete_All_Sessions
 
 Upload_Config_Files
-    [Arguments]    ${dir_name}
     [Documentation]    Uploads exabgp config files
+    [Arguments]    ${dir_name}
     SSHLibrary.Put_Directory    ${BGP_VARIABLES_FOLDER}    .
-    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Setup_Testcase
     [Arguments]    ${cfg_file}
     Verify_Empty_Flowspec_Data
-    ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${cfg_file}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}    connection_retries=${3}
+    ExaBgpLib.Start_ExaBgp_And_Verify_Connected
+    ...    ${cfg_file}
+    ...    ${CONFIG_SESSION}
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    connection_retries=${3}
 
 Verify_Empty_Flowspec_Data
     [Documentation]    Verify expected response.
@@ -104,16 +125,26 @@ Verify_Empty_Flowspec_Data
     CompareStream.Run_Keyword_If_At_Least_Neon    Verify_Empty_Flowspec_Data_Neon
 
 Verify_Flowspec_Data
-    [Arguments]    ${exprspdir}
     [Documentation]    Verify expected response
+    [Arguments]    ${exprspdir}
     &{mapping}    BuiltIn.Create_Dictionary    AS_PATH=${AS_PATH}
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}${exprspdir}    session=${CONFIG_SESSION}    mapping=${mapping}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${exprspdir}
+    ...    session=${CONFIG_SESSION}
+    ...    mapping=${mapping}
+    ...    verify=True
 
 Normalize_And_Compare
     [Documentation]    Verify empty flowspec data
-    ${rsp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${FLOWSPEC_URL}
-    TemplatedRequests.Normalize_Jsons_With_Bits_And_Compare    ${EXP0}    ${rsp.content}    keys_with_bits=${EMPTY_LIST}
+    ${rsp}    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${FLOWSPEC_URL}
+    TemplatedRequests.Normalize_Jsons_With_Bits_And_Compare
+    ...    ${EXP0}
+    ...    ${rsp.content}
+    ...    keys_with_bits=${EMPTY_LIST}
 
 Verify_Empty_Flowspec_Data_Neon
     [Documentation]    Verify empty flowspec data on neon
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}empty_route    session=${CONFIG_SESSION}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}empty_route
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
index 9cb33084daa5af1d628093fdb99d6328b39145b6..5bf32b09c46bd3c72eb6c1efba4d704d4d753b62 100644 (file)
@@ -1,69 +1,90 @@
 *** Settings ***
-Documentation     Functional test suite for bgp - l3vpn-ipv4
+Documentation       Functional test suite for bgp - l3vpn-ipv4
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising and receiveing routes with l3vpn content.
-...               It uses odl and exabgp as bgp peers. Routes advertized from odl
-...               are configured via application peer. Routes advertised from exabgp is
-...               statically configured in exabgp config file.
+...                 This suite tests advertising and receiveing routes with l3vpn content.
+...                 It uses odl and exabgp as bgp peers. Routes advertized from odl
+...                 are configured via application peer. Routes advertised from exabgp is
+...                 statically configured in exabgp config file.
 ...
-...               For fluorine and further, instead of exabgp, play.py is used. When sending
-...               routes from odl to peer, first route containg route-target argument have to
-...               be send from peer to odl, so odl can identify this peer. Than it sends l3vpn
-...               route containg this argument to odl app peer, and we check that app peer
-...               advertizes this route back to the peer.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 For fluorine and further, instead of exabgp, play.py is used. When sending
+...                 routes from odl to peer, first route containg route-target argument have to
+...                 be send from peer to odl, so odl can identify this peer. Than it sends l3vpn
+...                 route containg this argument to odl app peer, and we check that app peer
+...                 advertizes this route back to the peer.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${BGP_L3VPN_DIR}    ${BGP_VAR_FOLDER}/l3vpn_ipv4
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional
-${CONFIG_SESSION}    config-session
-${DEFAULT_BGPCEP_LOG_LEVEL}    INFO
-${DEFAULT_EXA_CFG}    exa.cfg
-${EXARPCSCRIPT}    ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
-${HOLDTIME}       180
-${L3VPN_EXA_CFG}    bgp-l3vpn-ipv4.cfg
-${L3VPN_EXP}      exa_expected
-${L3VPN_RSP}      bgp_l3vpn_ipv4
-${L3VPN_RSPEMPTY}    bgp_l3vpn_ipv4_empty
-${L3VPN_RSP_PATH}    bgp_l3vpn_ipv4_path
-${OLD_AS_PATH}    \n"as-path": {},
-${NEW_AS_PATH}    ${EMPTY}
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${RIB_INSTANCE}    example-bgp-rib
-${RT_CONSTRAIN_DIR}    ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
+${BGP_L3VPN_DIR}                ${BGP_VAR_FOLDER}/l3vpn_ipv4
+${BGP_VAR_FOLDER}               ${CURDIR}/../../../variables/bgpfunctional
+${CONFIG_SESSION}               config-session
+${DEFAULT_BGPCEP_LOG_LEVEL}     INFO
+${DEFAULT_EXA_CFG}              exa.cfg
+${EXARPCSCRIPT}                 ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
+${HOLDTIME}                     180
+${L3VPN_EXA_CFG}                bgp-l3vpn-ipv4.cfg
+${L3VPN_EXP}                    exa_expected
+${L3VPN_RSP}                    bgp_l3vpn_ipv4
+${L3VPN_RSPEMPTY}               bgp_l3vpn_ipv4_empty
+${L3VPN_RSP_PATH}               bgp_l3vpn_ipv4_path
+${OLD_AS_PATH}                  \n"as-path": {},
+${NEW_AS_PATH}                  ${EMPTY}
+${PLAY_SCRIPT}                  ${CURDIR}/../../../../tools/fastbgp/play.py
+${RIB_INSTANCE}                 example-bgp-rib
+${RT_CONSTRAIN_DIR}             ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer. Openconfig is used for carbon and above.
     &{mapping}    BuiltIn.Create_Dictionary    BGP_RIB=${RIB_INSTANCE}    IP=${ODL_SYSTEM_IP}
-    TemplatedRequests.Put_As_Xml_Templated    ${RT_CONSTRAIN_DIR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${RT_CONSTRAIN_DIR}/app_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB=${RIB_INSTANCE}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false
-    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    PASSIVE_MODE=true
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${RT_CONSTRAIN_DIR}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    CompareStream.Run_Keyword_If_At_Least_Fluorine
+    ...    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${RT_CONSTRAIN_DIR}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 L3vpn_Ipv4_To_Odl
     [Documentation]    Testing mpls vpn ipv4 routes reported to odl from exabgp
@@ -109,18 +130,28 @@ Kill_Talking_BGP_Speaker
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${RT_CONSTRAIN_DIR}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${RT_CONSTRAIN_DIR}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${RT_CONSTRAIN_DIR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${RT_CONSTRAIN_DIR}/app_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${tools_system_conn_id} =    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -128,7 +159,7 @@ Start_Suite
     SSHKeywords.Virtual_Env_Install_Package    exabgp==3.4.16
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     Upload_Config_Files
-    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
+    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
     BuiltIn.Set_Suite_Variable    ${AS_PATH}
 
 Stop_Suite
@@ -142,22 +173,26 @@ Upload_Config_Files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${DEFAULT_EXA_CFG}    .
     SSHLibrary.Put_File    ${BGP_L3VPN_DIR}/${L3VPN_EXA_CFG}    .
     SSHLibrary.Put_File    ${EXARPCSCRIPT}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Setup_Testcase
-    [Arguments]    ${cfg_file}
     [Documentation]    Verifies initial test condition and starts the exabgp
+    [Arguments]    ${cfg_file}
     SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Empty_Reported_Data
-    ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${cfg_file}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}    connection_retries=${3}
+    ExaBgpLib.Start_ExaBgp_And_Verify_Connected
+    ...    ${cfg_file}
+    ...    ${CONFIG_SESSION}
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    connection_retries=${3}
 
 Teardowm_With_Remove_Route
     [Documentation]    Removes configured route from application peer and stops the exabgp
@@ -171,36 +206,53 @@ Teardown_Simple
     BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Empty_Reported_Data
 
 Verify_ExaBgp_Received_Update
-    [Arguments]    ${exp_update_fn}
     [Documentation]    Verification of receiving particular update message
-    ${exp_update} =    TemplatedRequests.Resolve_Text_From_Template_File    ${BGP_L3VPN_DIR}${/}${exp_update_fn}    data.json
-    ${rcv_update_dict} =    BgpRpcClient.exa_get_update_message    msg_only=${True}
-    ${rcv_update} =    BuiltIn.Evaluate    json.dumps(${rcv_update_dict})    modules=json
+    [Arguments]    ${exp_update_fn}
+    ${exp_update}    TemplatedRequests.Resolve_Text_From_Template_File
+    ...    ${BGP_L3VPN_DIR}${/}${exp_update_fn}
+    ...    data.json
+    ${rcv_update_dict}    BgpRpcClient.exa_get_update_message    msg_only=${True}
+    ${rcv_update}    BuiltIn.Evaluate    json.dumps(${rcv_update_dict})    modules=json
     TemplatedRequests.Normalize_Jsons_And_Compare    ${exp_update}    ${rcv_update}
 
 Verify_Empty_Reported_Data
     [Documentation]    Verfiy empty data response
-    CompareStream.Run_Keyword_If_At_Most_Fluorine    TemplatedRequests.Get_As_Json_Templated    ${BGP_L3VPN_DIR}${/}${L3VPN_RSPEMPTY}    session=${CONFIG_SESSION}    verify=True
+    CompareStream.Run_Keyword_If_At_Most_Fluorine
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_L3VPN_DIR}${/}${L3VPN_RSPEMPTY}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
     CompareStream.Run_Keyword_If_At_Least_Neon    Verify_Empty_Data_Neon
 
 Verify_Reported_Data
-    [Arguments]    ${exprspdir}
     [Documentation]    Verifies expected response
+    [Arguments]    ${exprspdir}
     &{mapping}    BuiltIn.Create_Dictionary    AS_PATH=${AS_PATH}
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_L3VPN_DIR}${/}${exprspdir}    mapping=${mapping}    session=${CONFIG_SESSION}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_L3VPN_DIR}${/}${exprspdir}
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Start_Bgp_Peer
     [Documentation]    Starts bgp peer and verifies that the peer runs.
-    BGPSpeaker.Start_BGP_Speaker    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --allf --wfr 1
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --allf --wfr 1
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
 
 L3vpn_Ipv4_To_App
     [Documentation]    Testing mpls vpn ipv4 routes reported to odl from exabgp
     BgpRpcClient.exa_clean_update_message
     &{mapping}    BuiltIn.Create_Dictionary    BGP_PEER_IP=${TOOLS_SYSTEM_IP}    APP_PEER_IP=${ODL_SYSTEM_IP}
-    TemplatedRequests.Post_As_Xml_Templated    ${BGP_L3VPN_DIR}/route    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${BGP_L3VPN_DIR}/route
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Update    ${L3VPN_EXP}
 
 Verify_Empty_Data_Neon
     [Documentation]    Verify empty data on neon
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_L3VPN_DIR}${/}empty_route    session=${CONFIG_SESSION}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_L3VPN_DIR}${/}empty_route
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
index 2012d4ed072cdf233bf3ffcdd01820c68a921c2a..70dd2958e0f1886a0c8f3d743f0279abb278247d 100644 (file)
@@ -1,59 +1,72 @@
 *** Settings ***
-Documentation     Functional test suite for bgp - n-path and all-path selection
+Documentation       Functional test suite for bgp - n-path and all-path selection
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests n-path and all-path selection policy.
-...               It uses odl and exabgp as bgp peers. Routes advertized from odl
-...               are configured via application peer.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/ExaBgpLib.robot
-Resource          ${CURDIR}/../../../libraries/Utils.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Library           ${CURDIR}/../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
+...                 This suite tests n-path and all-path selection policy.
+...                 It uses odl and exabgp as bgp peers. Routes advertized from odl
+...                 are configured via application peer.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/ExaBgpLib.robot
+Resource            ${CURDIR}/../../../libraries/Utils.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Library             ${CURDIR}/../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${DEVICE_NAME}    controller-config
-${BGP_PEER_NAME}    example-bgp-peer
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${APP_PEER_NAME}    example-bgp-peer-app
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional
-${MULT_VAR_FOLDER}    ${BGP_VAR_FOLDER}/multipaths
-${DEFAUTL_RPC_CFG}    exa.cfg
-${CONFIG_SESSION}    config-session
-${EXARPCSCRIPT}    ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
-${N_PATHS_VALUE}    2
-&{DEFAULT_MAPPING}    ODLIP=${ODL_SYSTEM_IP}    EXAIP=${TOOLS_SYSTEM_IP}    NPATHS=${N_PATHS_VALUE}
-@{PATH_ID_LIST}    1    2    3
-${NEXT_HOP_PREF}    100.100.100.
-${OPENCONFIG_RIB_URI}    /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types%3ABGP,example-bgp-rib
-${NPATHS_SELM}    n-paths
-${ALLPATHS_SELM}    all-paths
-${ADDPATHCAP_SR}    send\\/receive
-${ADDPATHCAP_S}    send
-${ADDPATHCAP_R}    receive
-${ADDPATHCAP_D}    disable
+${HOLDTIME}                 180
+${DEVICE_NAME}              controller-config
+${BGP_PEER_NAME}            example-bgp-peer
+${RIB_INSTANCE}             example-bgp-rib
+${PROTOCOL_OPENCONFIG}      ${RIB_INSTANCE}
+${APP_PEER_NAME}            example-bgp-peer-app
+${BGP_VAR_FOLDER}           ${CURDIR}/../../../variables/bgpfunctional
+${MULT_VAR_FOLDER}          ${BGP_VAR_FOLDER}/multipaths
+${DEFAUTL_RPC_CFG}          exa.cfg
+${CONFIG_SESSION}           config-session
+${EXARPCSCRIPT}             ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
+${N_PATHS_VALUE}            2
+&{DEFAULT_MAPPING}          ODLIP=${ODL_SYSTEM_IP}    EXAIP=${TOOLS_SYSTEM_IP}    NPATHS=${N_PATHS_VALUE}
+@{PATH_ID_LIST}             1    2    3
+${NEXT_HOP_PREF}            100.100.100.
+${OPENCONFIG_RIB_URI}
+...                         /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types%3ABGP,example-bgp-rib
+${NPATHS_SELM}              n-paths
+${ALLPATHS_SELM}            all-paths
+${ADDPATHCAP_SR}            send\\/receive
+${ADDPATHCAP_S}             send
+${ADDPATHCAP_R}             receive
+${ADDPATHCAP_D}             disable
+
 
 *** Test Cases ***
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    RIB_INSTANCE_NAME=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    PASSIVE_MODE=true
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    PASSIVE_MODE=true
 
 Odl Allpaths Exa SendReceived
     [Documentation]    all-paths selected policy selected
@@ -77,13 +90,21 @@ Odl Npaths Exa SendReceived
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+
 
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -101,78 +122,128 @@ Stop_Suite
     RequestsLibrary.Delete_All_Sessions
 
 Upload_Config_Files
-    [Arguments]    ${addpath}=disable
     [Documentation]    Uploads exabgp config files
+    [Arguments]    ${addpath}=disable
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${DEFAUTL_RPC_CFG}    .
     SSHLibrary.Put_File    ${EXARPCSCRIPT}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/${addpath}/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Configure_Path_Selection_And_App_Peer_And_Connect_Peer
-    [Arguments]    ${odl_path_sel_mode}    ${exa_add_path_value}
     [Documentation]    Setup test case keyword. Early after the path selection config the incomming connection
     ...    from exabgp towards odl may be rejected by odl due to config process not finished yet. Because of that
     ...    we try to start the tool 3 times in case early attempts fail.
+    [Arguments]    ${odl_path_sel_mode}    ${exa_add_path_value}
     SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     Configure_Odl_Peer_With_Path_Selection_Mode    ${odl_path_sel_mode}
     Configure_App_Peer_With_Routes
     Upload_Config_Files    addpath=${exa_add_path_value}
-    ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${DEFAUTL_RPC_CFG}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}    connection_retries=${3}
+    ExaBgpLib.Start_ExaBgp_And_Verify_Connected
+    ...    ${DEFAUTL_RPC_CFG}
+    ...    ${CONFIG_SESSION}
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    connection_retries=${3}
 
 Remove_Odl_And_App_Peer_Configuration_And_Stop_ExaBgp
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${MULT_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${MULT_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     Deconfigure_App_Peer
     ExaBgpLib.Stop_ExaBgp
     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Verify_Expected_Update_Count
-    [Arguments]    ${exp_count}
     [Documentation]    Verify number of received update messages
-    ${tool_count}=    BgpRpcClient.exa_get_received_update_count
+    [Arguments]    ${exp_count}
+    ${tool_count}    BgpRpcClient.exa_get_received_update_count
     BuiltIn.Should_Be_Equal_As_Numbers    ${exp_count}    ${tool_count}
 
 Configure_Odl_Peer_With_Path_Selection_Mode
-    [Arguments]    ${psm}
     [Documentation]    Configures odl peer with path selection mode
-    ${npaths}=    BuiltIn.Set_Variable_If    "${psm}"=="${ALLPATHS_SELM}"    0    ${N_PATHS_VALUE}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    MULTIPATH=${npaths}
+    [Arguments]    ${psm}
+    ${npaths}    BuiltIn.Set_Variable_If    "${psm}"=="${ALLPATHS_SELM}"    0    ${N_PATHS_VALUE}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    MULTIPATH=${npaths}
     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib    mapping=${mapping}    session=${CONFIG_SESSION}
-    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib_policies    mapping=${mapping}    session=${CONFIG_SESSION}
-    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${MULT_VAR_FOLDER}/rib
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_At_Least_Fluorine
+    ...    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${MULT_VAR_FOLDER}/rib_policies
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${MULT_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Store_Rib_Configuration
     [Documentation]    Stores rib configuration
-    ${rib_old}=    TemplatedRequests.Get_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib_config    mapping=${DEFAULT_MAPPING}    session=${CONFIG_SESSION}
+    ${rib_old}    TemplatedRequests.Get_As_Xml_Templated
+    ...    ${MULT_VAR_FOLDER}/rib_config
+    ...    mapping=${DEFAULT_MAPPING}
+    ...    session=${CONFIG_SESSION}
     BuiltIn.Set_Suite_Variable    ${rib_old}
 
 Log_Loc_Rib_Operational
-    ${rsp}=    RequestsLibrary.Get Request    ${CONFIG_SESSION}    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/
+    ${rsp}    RequestsLibrary.Get Request
+    ...    ${CONFIG_SESSION}
+    ...    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/
     BuiltIn.Log    ${rsp.content}
 
 Configure_App_Peer_With_Routes
     [Documentation]    Configure bgp application peer and fill it immediately with routes.
     ${app_rib}    Set Variable    ${ODL_SYSTEM_IP}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    APP_PEER_NAME=${APP_PEER_NAME}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    APP_PEER_ID=${ODL_SYSTEM_IP}    IP=${ODL_SYSTEM_IP}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    APP_PEER_NAME=${APP_PEER_NAME}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    APP_PEER_ID=${ODL_SYSTEM_IP}
+    ...    IP=${ODL_SYSTEM_IP}
     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/app_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     FOR    ${pathid}    IN    @{PATH_ID_LIST}
-        &{route_mapping}    BuiltIn.Create_Dictionary    NEXTHOP=${NEXT_HOP_PREF}${pathid}    LOCALPREF=${pathid}00    PATHID=${pathid}    APP_RIB=${app_rib}
-        TemplatedRequests.Post_As_Xml_Templated    ${MULT_VAR_FOLDER}/route    mapping=${route_mapping}    session=${CONFIG_SESSION}
+        &{route_mapping}    BuiltIn.Create_Dictionary
+        ...    NEXTHOP=${NEXT_HOP_PREF}${pathid}
+        ...    LOCALPREF=${pathid}00
+        ...    PATHID=${pathid}
+        ...    APP_RIB=${app_rib}
+        TemplatedRequests.Post_As_Xml_Templated
+        ...    ${MULT_VAR_FOLDER}/route
+        ...    mapping=${route_mapping}
+        ...    session=${CONFIG_SESSION}
     END
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     ${app_rib}    Set Variable    ${ODL_SYSTEM_IP}
     &{route_mapping}    BuiltIn.Create_Dictionary    APP_RIB=${app_rib}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${MULT_VAR_FOLDER}/route    mapping=${route_mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    APP_PEER_NAME=${APP_PEER_NAME}    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${MULT_VAR_FOLDER}/route
+    ...    mapping=${route_mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    APP_PEER_NAME=${APP_PEER_NAME}
+    ...    IP=${ODL_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
index 58d316ecbb80281f69d3f3393ac1eb3f3f49870c..934007d5aec725ae861a2271ff44135324a7adcf 100644 (file)
 *** Settings ***
-Documentation     Functional test for bgp - evpn
+Documentation       Functional test for bgp - evpn
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising and receiveing routes with evpn content.
-...               It uses play.py and odl as bgp peers. Routes advertized from odl
-...               are configured via application peer. Routes advertised from play.py are
-...               stored in *.hex files. These files are used also as expected data which
-...               is recevied from odl.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        Run Keywords    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-...               AND    Verify_Test_Preconditions
-Test Template     Odl_To_Play_Template
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests advertising and receiveing routes with evpn content.
+...                 It uses play.py and odl as bgp peers. Routes advertized from odl
+...                 are configured via application peer. Routes advertised from play.py are
+...                 stored in *.hex files. These files are used also as expected data which
+...                 is recevied from odl.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          Run Keywords    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+...                     AND    Verify_Test_Preconditions
+Test Template       Odl_To_Play_Template
+
 
 *** Variables ***
-${HOLDTIME}       180
-${RIB_NAME}       example-bgp-rib
-${BGP_DIR}        ${CURDIR}/../../../variables/bgpfunctional
-${DEFAUTL_RPC_CFG}    exa.cfg
-${CONFIG_SESSION}    config-session
-${EVPN_DIR}       ${CURDIR}/../../../variables/bgpfunctional/l2vpn_evpn
-${BGP_TOOL_LOG_LEVEL}    debug
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${SS}             ${SPACE}${SPACE}${SPACE}${SPACE}
-${PATH_ID_JSON}    ${SS}${SS}"path-id": 0,${\n}
-${PATH_ID_XML}    ${SS}<path-id>0</path-id>${\n}
-${OLD_EVPN_ROUTES_LINE}    \n"odl-bgp-evpn:evpn-routes": {},
-${NEW_EVPN_ROUTES_LINE}    ${EMPTY}
-${OLD_AS_PATH}    ,\n"as-path": {}
-${NEW_AS_PATH}    ${EMPTY}
+${HOLDTIME}                 180
+${RIB_NAME}                 example-bgp-rib
+${BGP_DIR}                  ${CURDIR}/../../../variables/bgpfunctional
+${DEFAUTL_RPC_CFG}          exa.cfg
+${CONFIG_SESSION}           config-session
+${EVPN_DIR}                 ${CURDIR}/../../../variables/bgpfunctional/l2vpn_evpn
+${BGP_TOOL_LOG_LEVEL}       debug
+${PLAY_SCRIPT}              ${CURDIR}/../../../../tools/fastbgp/play.py
+${SS}                       ${SPACE}${SPACE}${SPACE}${SPACE}
+${PATH_ID_JSON}             ${SS}${SS}"path-id": 0,${\n}
+${PATH_ID_XML}              ${SS}<path-id>0</path-id>${\n}
+${OLD_EVPN_ROUTES_LINE}     \n"odl-bgp-evpn:evpn-routes": {},
+${NEW_EVPN_ROUTES_LINE}     ${EMPTY}
+${OLD_AS_PATH}              ,\n"as-path": {}
+${NEW_AS_PATH}              ${EMPTY}
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer. Openconfig is used for carbon and above.
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
-    &{mapping}    BuiltIn.Create_Dictionary    BGP_RIB_OPENCONFIG=${RIB_NAME}    IP=${ODL_SYSTEM_IP}
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    &{mapping} =    BuiltIn.Create_Dictionary    BGP_RIB_OPENCONFIG=${RIB_NAME}    IP=${ODL_SYSTEM_IP}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_DIR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    &{mapping} =    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
     ...    PASSIVE_MODE=true
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_DIR}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-
 Start_Bgp_Peer
     [Documentation]    Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     BuiltIn.Wait_Until_Keyword_Succeeds    3x    1s    Start Bgp Peer
-
 Odl_To_Play_route_es_arb
     route_es_arb
-
 Play_To_Odl_route_es_arb
     [Template]    Play_To_Odl_Template
     route_es_arb
-
 Odl_To_Play_route_es_as
     route_es_as
-
 Play_To_Odl_route_es_as
     [Template]    Play_To_Odl_Template
     route_es_as
-
 Odl_To_Play_route_es_lacp
     route_es_lacp
-
 Play_To_Odl_route_es_lacp
     [Template]    Play_To_Odl_Template
     route_es_lacp
-
 Odl_To_Play_route_es_lan
     route_es_lan
-
 Play_To_Odl_route_es_lan
     [Template]    Play_To_Odl_Template
     route_es_lan
-
 Odl_To_Play_route_es_mac
     route_es_mac
-
 Play_To_Odl_route_es_mac
     [Template]    Play_To_Odl_Template
     route_es_mac
-
 Odl_To_Play_route_es_rou
     route_es_rou
-
 Play_To_Odl_route_es_rou
     [Template]    Play_To_Odl_Template
     route_es_rou
-
 Odl_To_Play_route_eth_arb
     route_eth_arb
-
 Play_To_Odl_route_eth_arb
     [Template]    Play_To_Odl_Template
     route_eth_arb
-
 Odl_To_Play_route_eth_as
     route_eth_as
-
 Play_To_Odl_route_eth_as
     [Template]    Play_To_Odl_Template
     route_eth_as
-
 Odl_To_Play_route_eth_lacp
     route_eth_lacp
-
 Play_To_Odl_route_eth_lacp
     [Template]    Play_To_Odl_Template
     route_eth_lacp
-
 Odl_To_Play_route_eth_lacp_extdef
     route_eth_lacp_extdef
-
 Play_To_Odl_route_eth_lacp_extdef
     [Template]    Play_To_Odl_Template
     route_eth_lacp_extdef
-
 Odl_To_Play_route_eth_lacp_extesilab
     route_eth_lacp_extesilab
-
 Play_To_Odl_route_eth_lacp_extesilab
     [Template]    Play_To_Odl_Template
     route_eth_lacp_extesilab
-
 Odl_To_Play_route_eth_lacp_extesr
     route_eth_lacp_extesr
-
 Play_To_Odl_route_eth_lacp_extesr
     [Template]    Play_To_Odl_Template
     route_eth_lacp_extesr
-
 Odl_To_Play_route_eth_lacp_extl2
     route_eth_lacp_extl2
-
 Play_To_Odl_route_eth_lacp_extl2
     [Template]    Play_To_Odl_Template
     route_eth_lacp_extl2
-
 Odl_To_Play_route_eth_lacp_extmac
     route_eth_lacp_extmac
-
 Play_To_Odl_route_eth_lacp_extmac
     [Template]    Play_To_Odl_Template
     route_eth_lacp_extmac
-
 Odl_To_Play_route_eth_lan
     route_eth_lan
-
 Play_To_Odl_route_eth_lan
     [Template]    Play_To_Odl_Template
     route_eth_lan
-
 Odl_To_Play_route_eth_mac
     route_eth_mac
-
 Play_To_Odl_route_eth_mac
     [Template]    Play_To_Odl_Template
     route_eth_mac
-
 Odl_To_Play_route_eth_rou
     route_eth_rou
-
 Play_To_Odl_route_eth_rou
     [Template]    Play_To_Odl_Template
     route_eth_rou
-
 Odl_To_Play_route_inc_arb
     route_inc_arb
-
 Play_To_Odl_route_inc_arb
     [Template]    Play_To_Odl_Template
     route_inc_arb
-
 Odl_To_Play_route_inc_as
     route_inc_as
-
 Play_To_Odl_route_inc_as
     [Template]    Play_To_Odl_Template
     route_inc_as
-
 Odl_To_Play_route_inc_lacp
     route_inc_lacp
-
 Play_To_Odl_route_inc_lacp
     [Template]    Play_To_Odl_Template
     route_inc_lacp
-
 Odl_To_Play_route_inc_lan
     route_inc_lan
-
 Play_To_Odl_route_inc_lan
     [Template]    Play_To_Odl_Template
     route_inc_lan
-
 Odl_To_Play_route_inc_mac
     route_inc_mac
-
 Play_To_Odl_route_inc_mac
     [Template]    Play_To_Odl_Template
     route_inc_mac
-
 Odl_To_Play_route_inc_rou
     route_inc_rou
-
 Play_To_Odl_route_inc_rou
     [Template]    Play_To_Odl_Template
     route_inc_rou
-
 Odl_To_Play_route_mac_arb
     route_mac_arb
-
 Play_To_Odl_route_mac_arb
     [Template]    Play_To_Odl_Template
     route_mac_arb
-
 Odl_To_Play_route_mac_as
     route_mac_as
-
 Play_To_Odl_route_mac_as
     [Template]    Play_To_Odl_Template
     route_mac_as
-
 Odl_To_Play_route_mac_lacp
     route_mac_lacp
-
 Play_To_Odl_route_mac_lacp
     [Template]    Play_To_Odl_Template
     route_mac_lacp
-
 Odl_To_Play_route_mac_lan
     route_mac_lan
-
 Play_To_Odl_route_mac_lan
     [Template]    Play_To_Odl_Template
     route_mac_lan
-
 Odl_To_Play_route_mac_mac
     route_mac_mac
-
 Play_To_Odl_route_mac_mac
     [Template]    Play_To_Odl_Template
     route_mac_mac
-
 Odl_To_Play_route_mac_rou
     route_mac_rou
-
 Play_To_Odl_route_mac_rou
     [Template]    Play_To_Odl_Template
     route_mac_rou
-
 Odl_To_Play_pmsi_rsvp_te_p2mp_lsp
     [Template]    None
     CompareStream.Run_Keyword_If_At_Least_Fluorine    Odl_To_Play_Template    pmsi_rsvp_te_p2mp_lsp
-
 Play_To_Odl_pmsi_rsvp_te_p2mp_lsp
     [Template]    None
     CompareStream.Run_Keyword_If_At_Least_Fluorine    Play_To_Odl_Template    pmsi_rsvp_te_p2mp_lsp
-
 Odl_To_Play_pmsi_mldp_p2mp_lsp
     pmsi_mldp_p2mp_lsp
-
 Play_To_Odl_pmsi_mldp_p2mp_lsp
     [Template]    Play_To_Odl_Template
     pmsi_mldp_p2mp_lsp
-
 Odl_To_Play_pmsi_pim_ssm_tree
     pmsi_pim_ssm_tree
-
 Play_To_Odl_pmsi_pim_ssm_tree
     [Template]    Play_To_Odl_Template
     pmsi_pim_ssm_tree
-
 Odl_To_Play_pmsi_pim_sm_tree
     pmsi_pim_sm_tree
-
 Play_To_Odl_pmsi_pim_sm_tree
     [Template]    Play_To_Odl_Template
     pmsi_pim_sm_tree
-
 Odl_To_Play_pmsi_bidir_pim_tree
     pmsi_bidir_pim_tree
-
 Play_To_Odl_pmsi_bidir_pim_tree
     [Template]    Play_To_Odl_Template
     pmsi_bidir_pim_tree
-
 Odl_To_Play_pmsi_ingress_replication
     pmsi_ingress_replication
-
 Play_To_Odl_pmsi_ingress_replication
     [Template]    Play_To_Odl_Template
     pmsi_ingress_replication
-
 Odl_To_Play_pmsi_mldp_mp2mp_lsp
     pmsi_mldp_mp2mp_lsp
-
 Play_To_Odl_pmsi_mldp_mp2mp_lsp
     [Template]    Play_To_Odl_Template
     pmsi_mldp_mp2mp_lsp
-
 Kill_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     BGPSpeaker.Kill_BGP_Speaker
     BGPcliKeywords.Store_File_To_Workspace    play.py.out    evpn_play.log
-
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    &{mapping} =    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
     TemplatedRequests.Delete_Templated    ${BGP_DIR}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
-    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     [Template]    NONE
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    &{mapping} =    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
     TemplatedRequests.Delete_Templated    ${BGP_DIR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${mininet_conn_id}=    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${mininet_conn_id} =    SSHLibrary.Open Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set Suite Variable    ${mininet_conn_id}
     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     SSHLibrary.Put File    ${PLAY_SCRIPT}    .
     SSHKeywords.Assure_Library_Ipaddr    target_dir=.
-    BuiltIn.Set_Suite_Variable    ${EVPN_CONF_URL}    /rests/data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes
-    BuiltIn.Set_Suite_Variable    ${EVPN_LOC_RIB}    /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes?content=nonconfig
-    BuiltIn.Set_Suite_Variable    ${EVPN_FAMILY_LOC_RIB}    /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family?content=nonconfig
-    ${evpn_routes_line} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_EVPN_ROUTES_LINE}    ${OLD_EVPN_ROUTES_LINE}
-    &{mapping}    BuiltIn.Create_Dictionary    EVPN_ROUTES=${evpn_routes_line}
-    ${EMPTY_ROUTES} =    TemplatedRequests.Resolve_Text_From_Template_File    ${EVPN_DIR}/empty_routes    empty_routes.json    ${mapping}
+    BuiltIn.Set_Suite_Variable
+    ...    ${EVPN_CONF_URL}
+    ...    /rests/data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes
+    BuiltIn.Set_Suite_Variable
+    ...    ${EVPN_LOC_RIB}
+    ...    /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes?content=nonconfig
+    BuiltIn.Set_Suite_Variable
+    ...    ${EVPN_FAMILY_LOC_RIB}
+    ...    /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family?content=nonconfig
+    ${evpn_routes_line} =    CompareStream.Set_Variable_If_At_Least_Neon
+    ...    ${NEW_EVPN_ROUTES_LINE}
+    ...    ${OLD_EVPN_ROUTES_LINE}
+    &{mapping} =    BuiltIn.Create_Dictionary    EVPN_ROUTES=${evpn_routes_line}
+    ${EMPTY_ROUTES} =    TemplatedRequests.Resolve_Text_From_Template_File
+    ...    ${EVPN_DIR}/empty_routes
+    ...    empty_routes.json
+    ...    ${mapping}
     BuiltIn.Set_Suite_Variable    ${EMPTY_ROUTES}
 
 Stop_Suite
@@ -368,7 +315,8 @@ Stop_Suite
 
 Start_Bgp_Peer
     [Documentation]    Starts bgp peer and verifies that the peer runs.
-    BGPSpeaker.Start_BGP_Speaker    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL} --evpn --wfr 1
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL} --evpn --wfr 1
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
 
 Odl_To_Play_Template
@@ -379,17 +327,28 @@ Odl_To_Play_Template
     ${announce_hex} =    String.Remove_String    ${announce_hex}    \n
     ${withdraw_hex} =    OperatingSystem.Get_File    ${EVPN_DIR}/${totest}/withdraw_${totest}.hex
     ${withdraw_hex} =    String.Remove_String    ${withdraw_hex}    \n
-    ${data_path_xml}    CompareStream.Run_Keyword_If_Less_Than_Fluorine    String.Replace_String    ${data_xml}    ${PATH_ID_XML}    ${EMPTY}
-    ${post_data_xml}    CompareStream.Set_Variable_If_At_Least_Fluorine    ${data_xml}    ${data_path_xml}
+    ${data_path_xml} =    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    String.Replace_String
+    ...    ${data_xml}
+    ...    ${PATH_ID_XML}
+    ...    ${EMPTY}
+    ${post_data_xml} =    CompareStream.Set_Variable_If_At_Least_Fluorine    ${data_xml}    ${data_path_xml}
     BuiltIn.Log    ${post_data_xml}
     BuiltIn.Log    ${data_json}
     BuiltIn.Log    ${announce_hex}
     BuiltIn.Log    ${withdraw_hex}
     BgpRpcClient.play_clean
-    ${resp} =    RequestsLibrary.Post_Request    ${CONFIG_SESSION}    ${EVPN_CONF_URL}    data=${post_data_xml}    headers=${HEADERS_XML}
+    ${resp} =    RequestsLibrary.Post_Request
+    ...    ${CONFIG_SESSION}
+    ...    ${EVPN_CONF_URL}
+    ...    data=${post_data_xml}
+    ...    headers=${HEADERS_XML}
     BuiltIn.Log    ${resp.content}
     BuiltIn.Should_Be_Equal_As_Numbers    ${resp.status_code}    201
-    ${resp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${EVPN_CONF_URL}?content=config    headers=${HEADERS_XML}
+    ${resp} =    RequestsLibrary.Get_Request
+    ...    ${CONFIG_SESSION}
+    ...    ${EVPN_CONF_URL}?content=config
+    ...    headers=${HEADERS_XML}
     BuiltIn.Log    ${resp.content}
     ${aupdate} =    BuiltIn.Wait_Until_Keyword_Succeeds    4x    2s    Get_Update_Content
     BuiltIn.Log    ${aupdate}
@@ -405,12 +364,19 @@ Play_To_Odl_Template
     [Arguments]    ${totest}
     ${data_xml} =    OperatingSystem.Get_File    ${EVPN_DIR}/${totest}/${totest}.xml
     ${AS_PATH} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
-    &{mapping}    BuiltIn.Create_Dictionary    AS_PATH=${AS_PATH}
-    ${data_json} =    TemplatedRequests.Resolve_Text_From_Template_File    ${EVPN_DIR}/${totest}    ${totest}.json    ${mapping}
+    &{mapping} =    BuiltIn.Create_Dictionary    AS_PATH=${AS_PATH}
+    ${data_json} =    TemplatedRequests.Resolve_Text_From_Template_File
+    ...    ${EVPN_DIR}/${totest}
+    ...    ${totest}.json
+    ...    ${mapping}
     ${announce_hex} =    OperatingSystem.Get_File    ${EVPN_DIR}/${totest}/announce_${totest}.hex
     ${withdraw_hex} =    OperatingSystem.Get_File    ${EVPN_DIR}/${totest}/withdraw_${totest}.hex
-    ${data_path_json}    CompareStream.Run_Keyword_If_Less_Than_Fluorine    String.Replace_String    ${data_json}    ${PATH_ID_JSON}    ${EMPTY}
-    ${data_json_exp}    CompareStream.Set_Variable_If_At_Least_Fluorine    ${data_json}    ${data_path_json}
+    ${data_path_json} =    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    String.Replace_String
+    ...    ${data_json}
+    ...    ${PATH_ID_JSON}
+    ...    ${EMPTY}
+    ${data_json_exp} =    CompareStream.Set_Variable_If_At_Least_Fluorine    ${data_json}    ${data_path_json}
     BuiltIn.Log    ${data_xml}
     BuiltIn.Log    ${data_json_exp}
     BuiltIn.Log    ${announce_hex}
@@ -432,15 +398,18 @@ Remove_Configured_Routes
     [Documentation]    Removes the route if present. First GET is for debug purposes.
     ${rsp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${EVPN_LOC_RIB}    headers=${HEADERS}
     Log    ${rsp.content}
-    ${rsp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${EVPN_CONF_URL}?content=config    headers=${HEADERS}
+    ${rsp} =    RequestsLibrary.Get_Request
+    ...    ${CONFIG_SESSION}
+    ...    ${EVPN_CONF_URL}?content=config
+    ...    headers=${HEADERS}
     Log    ${rsp.content}
-    BuiltIn.Return_From_Keyword_If    ${rsp.status_code} in ${DELETED_STATUS_CODES}
+    IF    ${rsp.status_code} in ${DELETED_STATUS_CODES}    RETURN
     ${resp} =    RequestsLibrary.Delete_Request    ${CONFIG_SESSION}    ${EVPN_CONF_URL}
     BuiltIn.Should_Be_Equal_As_Numbers    ${resp.status_code}    204
 
 Withdraw_Route_And_Verify
-    [Arguments]    ${withdraw_hex}
     [Documentation]    Sends withdraw update message from exabgp and verifies route removal from odl's rib
+    [Arguments]    ${withdraw_hex}
     BgpRpcClient.play_send    ${withdraw_hex}
     BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Test_Preconditions
 
@@ -450,11 +419,11 @@ Get_Update_Content
     BuiltIn.Log    ${resp.content}
     ${update} =    BgpRpcClient.play_get
     BuiltIn.Should_Not_Be_Equal    ${update}    ${Empty}
-    [Return]    ${update}
+    RETURN    ${update}
 
 Loc_Rib_Presence
-    [Arguments]    ${exp_content}
     [Documentation]    Verifies if loc-rib contains expected data
+    [Arguments]    ${exp_content}
     ${rsp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${EVPN_LOC_RIB}    headers=${HEADERS}
     BuiltIn.Log_Many    ${exp_content}    ${rsp.content}
     TemplatedRequests.Normalize_Jsons_And_Compare    ${exp_content}    ${rsp.content}
index 88601f032650b1e352c2cf332eac5be02b3c7566..87adc23ba67ad6cce985abdf14ed7c3fdc5653f4 100644 (file)
@@ -1,60 +1,83 @@
 *** Settings ***
-Documentation     Functional test for bgp - route refresh
+Documentation       Functional test for bgp - route refresh
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests sending and receiveing route refresh message.
-...               It uses odl and exabgp as bgp peers.
-...               Sending route refresh message from odl is initiated via restconf.
-...               If route refresh is received by odl, correct advertising of routes
-...               is verified. Receiving of route refresh by odl is verified by
-...               checking appropriate message counter via odl-bgpcep-bgp-cli and
-...               restconf using BGP neighbor operational state
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests sending and receiveing route refresh message.
+...                 It uses odl and exabgp as bgp peers.
+...                 Sending route refresh message from odl is initiated via restconf.
+...                 If route refresh is received by odl, correct advertising of routes
+...                 is verified. Receiving of route refresh by odl is verified by
+...                 checking appropriate message counter via odl-bgpcep-bgp-cli and
+...                 restconf using BGP neighbor operational state
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${APP_PEER_NAME}    example-bgp-peer-app
-${BGP_CFG_NAME}    exa.cfg
-${BGP_PEER_NAME}    example-bgp-peer
-${BGP_RR_VAR_FOLDER}    ${BGP_VAR_FOLDER}/route_refresh
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional
-${CONFIG_SESSION}    config-session
-${DEVICE_NAME}    controller-config
-${EXARPCSCRIPT}    ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
-${HOLDTIME}       180
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${RIB_INSTANCE}    example-bgp-rib
-${MSG_STATE_OFFSET}    24
+${APP_PEER_NAME}            example-bgp-peer-app
+${BGP_CFG_NAME}             exa.cfg
+${BGP_PEER_NAME}            example-bgp-peer
+${BGP_RR_VAR_FOLDER}        ${BGP_VAR_FOLDER}/route_refresh
+${BGP_VAR_FOLDER}           ${CURDIR}/../../../variables/bgpfunctional
+${CONFIG_SESSION}           config-session
+${DEVICE_NAME}              controller-config
+${EXARPCSCRIPT}             ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
+${HOLDTIME}                 180
+${PROTOCOL_OPENCONFIG}      ${RIB_INSTANCE}
+${RIB_INSTANCE}             example-bgp-rib
+${MSG_STATE_OFFSET}         24
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer. Openconfig is used for carbon and above.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    APP_PEER_NAME=${APP_PEER_NAME}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    APP_PEER_ID=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    APP_PEER_NAME=${APP_PEER_NAME}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    APP_PEER_ID=${ODL_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     ...    IP=${ODL_SYSTEM_IP}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/app_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    RIB_INSTANCE_NAME=${RIB_INSTANCE}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    PASSIVE_MODE=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    PASSIVE_MODE=true
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Exa_To_Send_Route_Refresh
     [Documentation]    Exabgp sends route refresh and count received updates
@@ -67,7 +90,13 @@ Exa_To_Send_Route_Refresh
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Updates    ${update_count}
     Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
     ${update_count}    CompareStream.Set_Variable_If_At_Most_Fluorine    4    7
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=0    update_count=${update_count}    receive_count=2
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    5s
+    ...    Verify_Odl_Operational_State_Count
+    ...    notification_count=0
+    ...    update_count=${update_count}
+    ...    receive_count=2
     [Teardown]    Deconfigure_Routes_And_Stop_ExaBgp
 
 Odl_To_Send_Route_Refresh
@@ -76,28 +105,49 @@ Odl_To_Send_Route_Refresh
     [Setup]    ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${BGP_CFG_NAME}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}
     BgpRpcClient.exa_clean_received_route_refresh_count
     &{mapping}    BuiltIn.Create_Dictionary    BGP_PEER_IP=${TOOLS_SYSTEM_IP}
-    TemplatedRequests.Post_As_Xml_Templated    ${BGP_VAR_FOLDER}/route_refresh    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/route_refresh
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Route_Refresh    1
     Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
-    ${update_count} =    CompareStream.Set_Variable_If_At_Most_Fluorine    4    9
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=1    update_count=${update_count}    receive_count=4
+    ${update_count}    CompareStream.Set_Variable_If_At_Most_Fluorine    4    9
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    5s
+    ...    Verify_Odl_Operational_State_Count
+    ...    notification_count=1
+    ...    update_count=${update_count}
+    ...    receive_count=4
     [Teardown]    ExaBgpLib.Stop_ExaBgp
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    APP_PEER_NAME=${APP_PEER_NAME}    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    APP_PEER_NAME=${APP_PEER_NAME}
+    ...    IP=${ODL_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${mininet_conn_id}=    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${mininet_conn_id}    SSHLibrary.Open Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${mininet_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -116,23 +166,26 @@ Upload_Config_Files
     [Documentation]    Uploads exabgp config files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${BGP_CFG_NAME}    .
     SSHLibrary.Put_File    ${EXARPCSCRIPT}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Configure_Routes_And_Start_ExaBgp
-    [Arguments]    ${cfg_file}
     [Documentation]    Setup keyword for exa to odl test case
+    [Arguments]    ${cfg_file}
     ${app_rib}    Set Variable    ${ODL_SYSTEM_IP}
     FOR    ${prefix}    IN    1.1.1.1/32    2.2.2.2/32
         &{mapping}    BuiltIn.Create_Dictionary    PREFIX=${prefix}    APP_RIB=${app_rib}
-        TemplatedRequests.Post_As_Xml_Templated    ${BGP_RR_VAR_FOLDER}/route    mapping=${mapping}    session=${CONFIG_SESSION}
+        TemplatedRequests.Post_As_Xml_Templated
+        ...    ${BGP_RR_VAR_FOLDER}/route
+        ...    mapping=${mapping}
+        ...    session=${CONFIG_SESSION}
     END
     ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${cfg_file}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}
     Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
@@ -147,35 +200,61 @@ Deconfigure_Routes_And_Stop_ExaBgp
     TemplatedRequests.Delete_Templated    ${BGP_RR_VAR_FOLDER}/route    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Verify_ExaBgp_Received_Updates
-    [Arguments]    ${expcount}
     [Documentation]    Gets number of received update requests and compares with given expected count
-    ${count_recv}=    BgpRpcClient.exa_get_received_update_count
+    [Arguments]    ${expcount}
+    ${count_recv}    BgpRpcClient.exa_get_received_update_count
     BuiltIn.Should Be Equal As Numbers    ${count_recv}    ${expcount}
 
 Verify_ExaBgp_Received_Route_Refresh
-    [Arguments]    ${expcount}
     [Documentation]    Compares expected count of route request messages on exabgp side
-    ${count}=    BgpRpcClient.exa_get_received_route_refresh_count
+    [Arguments]    ${expcount}
+    ${count}    BgpRpcClient.exa_get_received_route_refresh_count
     BuiltIn.Should Be Equal As Numbers    ${count}    ${expcount}
 
 Verify_Odl_Operational_State_Count
-    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
     [Documentation]    Check notification and update count gained from operatial neighbor state
     ...    On versions oxygen and above, it verifies these counts also against cli output.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    NOT_COUNT=${notification_count}    SEND_COUNT=${update_count}    RECV_COUNT=${receive_count}
-    ${ret}=    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    TemplatedRequests.Get_As_Json_Templated    folder=${BGP_RR_VAR_FOLDER}/operational_state    mapping=${mapping}
-    ...    session=${CONFIG_SESSION}    verify=True
+    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    NOT_COUNT=${notification_count}
+    ...    SEND_COUNT=${update_count}
+    ...    RECV_COUNT=${receive_count}
+    ${ret}    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    5s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    folder=${BGP_RR_VAR_FOLDER}/operational_state
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
     BuiltIn.Log    ${ret}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Cli_Output_Count    ${notification_count}    ${update_count}    ${receive_count}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    5s
+    ...    Verify_Cli_Output_Count
+    ...    ${notification_count}
+    ...    ${update_count}
+    ...    ${receive_count}
 
 Verify_Cli_Output_Count
-    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
     [Documentation]    Checks notification and update count from odl-bgpcep-bgp-cli.
     ...    odl-bgpcep-bgp-cli is only avaiable on versions oxygen and above.
-    ${output}    KarafKeywords.Safe_Issue_Command_On_Karaf_Console    bgp:operational-state -rib example-bgp-rib -neighbor ${TOOLS_SYSTEM_IP}
+    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
+    ${output}    KarafKeywords.Safe_Issue_Command_On_Karaf_Console
+    ...    bgp:operational-state -rib example-bgp-rib -neighbor ${TOOLS_SYSTEM_IP}
     BuiltIn.Log    ${output}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NOT_COUNT=${notification_count}    SEND_COUNT=${update_count}    DIVIDER=│    RECV_COUNT=${receive_count}
-    ${expstate}    TemplatedRequests.Resolve_Text_From_Template_File    folder=${BGP_RR_VAR_FOLDER}/operational_cli    file_name=update.txt    mapping=${mapping}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    NOT_COUNT=${notification_count}
+    ...    SEND_COUNT=${update_count}
+    ...    DIVIDER=│
+    ...    RECV_COUNT=${receive_count}
+    ${expstate}    TemplatedRequests.Resolve_Text_From_Template_File
+    ...    folder=${BGP_RR_VAR_FOLDER}/operational_cli
+    ...    file_name=update.txt
+    ...    mapping=${mapping}
     String.Get Line Count    ${output}
     BuiltIn.Log    ${expstate}
     ${expected_line_count}    String.Get Line Count    ${expstate}
index 000d15b6019db85d7e610179728b1dc53e086fe6..4532e5cc8302f0d59e03282f2f28d5383c30c206 100644 (file)
@@ -1,48 +1,59 @@
 *** Settings ***
-Documentation     Basic tests for odl-bgpcep-bmp feature
+Documentation       Basic tests for odl-bgpcep-bmp feature
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This is a basic suite for bgp monitoring protocol feature.
-...               After the feature odl-bgpcep-bmp installation the port 12345 should be
-...               bound for listening,
-...               To test this feature bgp-bmp-mock tool is used. It is a part of the
-...               bgpcep project. It is a java tool which simulates more peers and more
-...               routers.
-...               In this particular test suite it simulates 1 peer with 1 router, which
-...               means it advertizes one peer ipv4 address towards odl. As a result one
-...               route should appear in the restconf/operational/bmp-monitor:bmp-monitor.
-Suite Setup       Set_It_Up
-Suite Teardown    Tear_It_Down
-Library           SSHLibrary
-Library           RequestsLibrary
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
-Resource          ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
+...                 This is a basic suite for bgp monitoring protocol feature.
+...                 After the feature odl-bgpcep-bmp installation the port 12345 should be
+...                 bound for listening,
+...                 To test this feature bgp-bmp-mock tool is used. It is a part of the
+...                 bgpcep project. It is a java tool which simulates more peers and more
+...                 routers.
+...                 In this particular test suite it simulates 1 peer with 1 router, which
+...                 means it advertizes one peer ipv4 address towards odl. As a result one
+...                 route should appear in the restconf/operational/bmp-monitor:bmp-monitor.
+
+Library             SSHLibrary
+Library             RequestsLibrary
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot
+Resource            ${CURDIR}/../../../libraries/RemoteBash.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+
+Suite Setup         Set_It_Up
+Suite Teardown      Tear_It_Down
+
 
 *** Variables ***
-${CONFIG_SESSION}    config-session
-${BGP_BMP_DIR}    ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/filled_structure
-${BGP_BMP_FEAT_DIR}    ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/empty_structure
-${BMP_LOG_FILE}    bmpmock.log
-${NEW_IPV4_ROUTES_LINE}    ${EMPTY}
-${OLD_IPV4_ROUTES_LINE}    \n"bgp-inet:ipv4-routes": {},
+${CONFIG_SESSION}           config-session
+${BGP_BMP_DIR}              ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/filled_structure
+${BGP_BMP_FEAT_DIR}         ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/empty_structure
+${BMP_LOG_FILE}             bmpmock.log
+${NEW_IPV4_ROUTES_LINE}     ${EMPTY}
+${OLD_IPV4_ROUTES_LINE}     \n"bgp-inet:ipv4-routes": {},
+
 
 *** Test Cases ***
 Verify BMP Feature
     [Documentation]    Verifies if feature is up
-    &{mapping}    BuiltIn.Create_Dictionary    TOOL_IP=${TOOLS_SYSTEM_IP}
-    BuiltIn.Wait_Until_Keyword_Succeeds    180s    5s    TemplatedRequests.Get_As_Json_Templated    folder=${BGP_BMP_FEAT_DIR}    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}=    BuiltIn.Create_Dictionary    TOOL_IP=${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    180s
+    ...    5s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    folder=${BGP_BMP_FEAT_DIR}
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Start_Bmp_Mock
     [Documentation]    Starts bmp-mock on tools vm
-    ${command}=    NexusKeywords.Compose_Full_Java_Command    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_IP}:12345 --routers_count 1 --peers_count 1 --log_level DEBUG 2>&1 | tee ${BMP_LOG_FILE}
+    ${command}=    NexusKeywords.Compose_Full_Java_Command
+    ...    -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_IP}:12345 --routers_count 1 --peers_count 1 --log_level DEBUG 2>&1 | tee ${BMP_LOG_FILE}
     BuiltIn.Log    ${command}
     SSHLibrary.Set_Client_Configuration    timeout=30s
     SSHLibrary.Write    ${command}
@@ -51,9 +62,17 @@ Start_Bmp_Mock
 
 Verify Data Reported
     [Documentation]    Verifies if the tool reported expected data
-    ${IPV4_ROUTES_LINE} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_IPV4_ROUTES_LINE}    ${OLD_IPV4_ROUTES_LINE}
-    &{mapping}    BuiltIn.Create_Dictionary    TOOL_IP=${TOOLS_SYSTEM_IP}    ROUTES_LINE=${IPV4_ROUTES_LINE}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    folder=${BGP_BMP_DIR}    mapping=${mapping}    session=${CONFIG_SESSION}
+    ${IPV4_ROUTES_LINE}=    CompareStream.Set_Variable_If_At_Least_Neon
+    ...    ${NEW_IPV4_ROUTES_LINE}
+    ...    ${OLD_IPV4_ROUTES_LINE}
+    &{mapping}=    BuiltIn.Create_Dictionary    TOOL_IP=${TOOLS_SYSTEM_IP}    ROUTES_LINE=${IPV4_ROUTES_LINE}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    folder=${BGP_BMP_DIR}
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Stop_Bmp_Mock
@@ -62,13 +81,14 @@ Stop_Bmp_Mock
     ${output}=    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${output}
 
+
 *** Keywords ***
 Set_It_Up
     [Documentation]    Create SSH session to ToolsVm, prepare HTTP client session to Controller.
     ...    Figure out latest pcc-mock version and download it from Nexus to ToolsVm.
     NexusKeywords.Initialize_Artifact_Deployment_And_Usage
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
-    ${name} =    NexusKeywords.Deploy_Test_Tool    bgpcep    bgp-bmp-mock
+    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep    bgp-bmp-mock
     BuiltIn.Set_Suite_Variable    ${filename}    ${name}
 
 Tear_It_Down
@@ -76,7 +96,7 @@ Tear_It_Down
     ...    Compute and Log the diff between expected and actual normalized responses.
     ...    Close both HTTP client session and SSH connection to Mininet.
     SSHLibrary.Get_File    ${BMP_LOG_FILE}
-    ${cnt} =    OperatingSystem.Get_File    ${BMP_LOG_FILE}
+    ${cnt}=    OperatingSystem.Get_File    ${BMP_LOG_FILE}
     Log    ${cnt}
     Delete_All_Sessions
     Close_All_Connections
index 846a04a0f0bc3c8dafa503f48e366b38d96f49ce..35e5ad6179898e831b5f35f44cd8d822d1eaae39 100644 (file)
@@ -1,50 +1,66 @@
 *** Settings ***
-Documentation     Functional test for bgp - mvpn
+Documentation       Functional test for bgp - mvpn
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising mvpn routes to odl. For advertising play.py is used,
-...               and particular files are stored as *.hex files. There are 7 different
-...               types of routes used for auto-discovery of multicast network. Also 4 more routes
-...               with new attributes specific for mvpn.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests advertising mvpn routes to odl. For advertising play.py is used,
+...                 and particular files are stored as *.hex files. There are 7 different
+...                 types of routes used for auto-discovery of multicast network. Also 4 more routes
+...                 with new attributes specific for mvpn.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${CONFIG_SESSION}    config-session
-${MVPN_DIR}       ${CURDIR}/../../../variables/bgpfunctional/mvpn
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${RIB_NAME}       example-bgp-rib
-&{MVPN_APP_PEER}    IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
-&{MVPN_ODL_CONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true
+${HOLDTIME}             180
+${CONFIG_SESSION}       config-session
+${MVPN_DIR}             ${CURDIR}/../../../variables/bgpfunctional/mvpn
+${PLAY_SCRIPT}          ${CURDIR}/../../../../tools/fastbgp/play.py
+${RIB_NAME}             example-bgp-rib
+&{MVPN_APP_PEER}        IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
+&{MVPN_ODL_CONFIG}
+...                     IP=${TOOLS_SYSTEM_IP}
+...                     HOLDTIME=${HOLDTIME}
+...                     PEER_PORT=${BGP_TOOL_PORT}
+...                     INITIATE=false
+...                     BGP_RIB=${RIB_NAME}
+...                     PASSIVE_MODE=true
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${MVPN_DIR}/app_peer    mapping=${MVPN_APP_PEER}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${MVPN_DIR}/app_peer
+    ...    mapping=${MVPN_APP_PEER}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${MVPN_DIR}/bgp_peer    mapping=${MVPN_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${MVPN_DIR}/bgp_peer
+    ...    mapping=${MVPN_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Start_Bgp_Peer
     [Documentation]    Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
@@ -152,18 +168,25 @@ Kill_Talking_BGP_Speaker
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Delete_Templated    ${MVPN_DIR}/bgp_peer    mapping=${MVPN_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${MVPN_DIR}/bgp_peer
+    ...    mapping=${MVPN_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     TemplatedRequests.Delete_Templated    ${MVPN_DIR}/app_peer    mapping=${MVPN_APP_PEER}    session=${CONFIG_SESSION}
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${mininet_conn_id} =    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${mininet_conn_id} =    SSHLibrary.Open Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set Suite Variable    ${mininet_conn_id}
     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
@@ -177,5 +200,6 @@ Stop_Suite
 
 Start_Bgp_Peer
     [Documentation]    Starts bgp peer and verifies that the peer runs.
-    BGPSpeaker.Start_BGP_Speaker    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --mvpn --wfr 1
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --mvpn --wfr 1
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
index 6a878173f537eab787fd93c530929df01eecc45c..6dd5ad990ef65378a8f91f90c8ef0dd32ae1a253 100644 (file)
@@ -1,49 +1,65 @@
 *** Settings ***
-Documentation     Functional test for bgp - l3vpn-mutlicast
+Documentation       Functional test for bgp - l3vpn-mutlicast
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising l3vpn_mcast routes to odl. For advertising play.py is used,
-...               and particular files are stored as *.hex files.
-...               There are L3vpn-ipv4-multicast routes and L3vpn-ipv6-multicast routes tested.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests advertising l3vpn_mcast routes to odl. For advertising play.py is used,
+...                 and particular files are stored as *.hex files.
+...                 There are L3vpn-ipv4-multicast routes and L3vpn-ipv6-multicast routes tested.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${CONFIG_SESSION}    config-session
-${L3VPN_MCAST_DIR}    ${CURDIR}/../../../variables/bgpfunctional/l3vpn_mcast
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${RIB_NAME}       example-bgp-rib
-&{L3VPN_MCAST_APP_PEER}    IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
-&{L3VPN_MCAST_ODL_CONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true
+${HOLDTIME}                     180
+${CONFIG_SESSION}               config-session
+${L3VPN_MCAST_DIR}              ${CURDIR}/../../../variables/bgpfunctional/l3vpn_mcast
+${PLAY_SCRIPT}                  ${CURDIR}/../../../../tools/fastbgp/play.py
+${RIB_NAME}                     example-bgp-rib
+&{L3VPN_MCAST_APP_PEER}         IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
+&{L3VPN_MCAST_ODL_CONFIG}
+...                             IP=${TOOLS_SYSTEM_IP}
+...                             HOLDTIME=${HOLDTIME}
+...                             PEER_PORT=${BGP_TOOL_PORT}
+...                             INITIATE=false
+...                             BGP_RIB=${RIB_NAME}
+...                             PASSIVE_MODE=true
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${L3VPN_MCAST_DIR}/app_peer    mapping=${L3VPN_MCAST_APP_PEER}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${L3VPN_MCAST_DIR}/app_peer
+    ...    mapping=${L3VPN_MCAST_APP_PEER}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${L3VPN_MCAST_DIR}/bgp_peer    mapping=${L3VPN_MCAST_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${L3VPN_MCAST_DIR}/bgp_peer
+    ...    mapping=${L3VPN_MCAST_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Start_Bgp_Peer
     [Documentation]    Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
@@ -75,18 +91,28 @@ Kill_Talking_BGP_Speaker
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Delete_Templated    ${L3VPN_MCAST_DIR}/bgp_peer    mapping=${L3VPN_MCAST_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${L3VPN_MCAST_DIR}/bgp_peer
+    ...    mapping=${L3VPN_MCAST_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Delete_Templated    ${L3VPN_MCAST_DIR}/app_peer    mapping=${L3VPN_MCAST_APP_PEER}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${L3VPN_MCAST_DIR}/app_peer
+    ...    mapping=${L3VPN_MCAST_APP_PEER}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${mininet_conn_id} =    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${mininet_conn_id} =    SSHLibrary.Open Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set Suite Variable    ${mininet_conn_id}
     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
@@ -100,5 +126,6 @@ Stop_Suite
 
 Start_Bgp_Peer
     [Documentation]    Starts bgp peer and verifies that the peer runs.
-    BGPSpeaker.Start_BGP_Speaker    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --l3vpn_mcast --wfr 1
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --l3vpn_mcast --wfr 1
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
index e14a074319b2b0cbb8d359f6271ccc090b266296..2c2816bcdd5be34fc41f490ac6bb1318587f48c1 100644 (file)
@@ -1,49 +1,65 @@
 *** Settings ***
-Documentation     Functional test for bgp - route-target-constrain safi
+Documentation       Functional test for bgp - route-target-constrain safi
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising rt-constrain routes to odl. For advertising from peer,
-...               play.py is used, sending hex messages to odl.
-...               For advertising to app-peer, we are sending post requests with routes in xml.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests advertising rt-constrain routes to odl. For advertising from peer,
+...                 play.py is used, sending hex messages to odl.
+...                 For advertising to app-peer, we are sending post requests with routes in xml.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${CONFIG_SESSION}    config-session
-${RT_CONSTRAIN_DIR}    ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${RIB_NAME}       example-bgp-rib
-&{RT_CONSTRAIN_APP_PEER}    IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
-&{RT_CONSTRAIN_ODL_CONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true
+${HOLDTIME}                     180
+${CONFIG_SESSION}               config-session
+${RT_CONSTRAIN_DIR}             ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
+${PLAY_SCRIPT}                  ${CURDIR}/../../../../tools/fastbgp/play.py
+${RIB_NAME}                     example-bgp-rib
+&{RT_CONSTRAIN_APP_PEER}        IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
+&{RT_CONSTRAIN_ODL_CONFIG}
+...                             IP=${TOOLS_SYSTEM_IP}
+...                             HOLDTIME=${HOLDTIME}
+...                             PEER_PORT=${BGP_TOOL_PORT}
+...                             INITIATE=false
+...                             BGP_RIB=${RIB_NAME}
+...                             PASSIVE_MODE=true
+
 
 *** Test Cases ***
 Configure_App_Peer
     [Documentation]    Configures bgp application peer.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${RT_CONSTRAIN_DIR}/app_peer    mapping=${RT_CONSTRAIN_APP_PEER}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${RT_CONSTRAIN_DIR}/app_peer
+    ...    mapping=${RT_CONSTRAIN_APP_PEER}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Put_As_Xml_Templated    ${RT_CONSTRAIN_DIR}/bgp_peer    mapping=${RT_CONSTRAIN_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${RT_CONSTRAIN_DIR}/bgp_peer
+    ...    mapping=${RT_CONSTRAIN_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Start_Bgp_Peer
     [Documentation]    Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
@@ -91,18 +107,28 @@ Kill_Talking_BGP_Speaker
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Delete_Templated    ${RT_CONSTRAIN_DIR}/bgp_peer    mapping=${RT_CONSTRAIN_ODL_CONFIG}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${RT_CONSTRAIN_DIR}/bgp_peer
+    ...    mapping=${RT_CONSTRAIN_ODL_CONFIG}
+    ...    session=${CONFIG_SESSION}
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    TemplatedRequests.Delete_Templated    ${RT_CONSTRAIN_DIR}/app_peer    mapping=${RT_CONSTRAIN_APP_PEER}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${RT_CONSTRAIN_DIR}/app_peer
+    ...    mapping=${RT_CONSTRAIN_APP_PEER}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${mininet_conn_id} =    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${mininet_conn_id} =    SSHLibrary.Open Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set Suite Variable    ${mininet_conn_id}
     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
@@ -116,5 +142,6 @@ Stop_Suite
 
 Start_Bgp_Peer
     [Documentation]    Starts bgp peer and verifies that the peer runs.
-    BGPSpeaker.Start_BGP_Speaker    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --rt_constrain --wfr 1
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug --rt_constrain --wfr 1
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
index e1aa8ed29813ba1bd9dfe53483563a48b8c279b4..8c262cddf59ec21a4a9fbd7df76128f287a426fd 100644 (file)
@@ -1,63 +1,73 @@
 *** Settings ***
-Documentation     Functional test for bgp - route-target-constrain safi
+Documentation       Functional test for bgp - route-target-constrain safi
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests advertising rt-constrain routes to odl. For advertising from peer,
-...               play.py is used, sending hex messages to odl.
-...               There are 3 peers: ebgp and two ibgps. First peer sends l3vpn route with specific RT to odl, second peer
-...               sends RT route and third peer only establishes connection. Then it is checked that odl advertizes l3vpn route
-...               to second peer. Third peer sends wildcard RT route and it is checked that odl doesn't advertize l3vpn route
-...               to it. Then second peer removes RT and it is checked that second peer withdrew RT route and that odl withdrew
-...               l3vpn route from it.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Library           ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8002    WITH NAME    BgpRpcClient2
-Library           ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8003    WITH NAME    BgpRpcClient3
-Library           ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8004    WITH NAME    BgpRpcClient4
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This suite tests advertising rt-constrain routes to odl. For advertising from peer,
+...                 play.py is used, sending hex messages to odl.
+...                 There are 3 peers: ebgp and two ibgps. First peer sends l3vpn route with specific RT to odl, second peer
+...                 sends RT route and third peer only establishes connection. Then it is checked that odl advertizes l3vpn route
+...                 to second peer. Third peer sends wildcard RT route and it is checked that odl doesn't advertize l3vpn route
+...                 to it. Then second peer removes RT and it is checked that second peer withdrew RT route and that odl withdrew
+...                 l3vpn route from it.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Library             ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8002    WITH NAME    BgpRpcClient2
+Library             ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8003    WITH NAME    BgpRpcClient3
+Library             ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8004    WITH NAME    BgpRpcClient4
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${CONFIG_SESSION}    config-session
-${RT_CONSTRAIN_DIR}    ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
-${EBGP_DIR}       ${CURDIR}/../../../variables/bgpfunctional/ebgp_peer
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${RIB_NAME}       example-bgp-rib
-${ODL_2_IP}       127.0.0.2
-${ODL_3_IP}       127.0.0.3
-${ODL_4_IP}       127.0.0.4
-${OLD_AS_PATH}    \n"as-path": {},
-${NEW_AS_PATH}    ${EMPTY}
-@{BGP_PEER_TYPES}    external    internal    internal
-@{BGP_PEER_AS_NUMBERS}    65000    64496    64496
-@{ODL_IP_INDICES_ALL}    2    3    4
-@{L3VPN_RT_CHECK}    false    true    false
+${HOLDTIME}                 180
+${CONFIG_SESSION}           config-session
+${RT_CONSTRAIN_DIR}         ${CURDIR}/../../../variables/bgpfunctional/rt_constrain
+${EBGP_DIR}                 ${CURDIR}/../../../variables/bgpfunctional/ebgp_peer
+${PLAY_SCRIPT}              ${CURDIR}/../../../../tools/fastbgp/play.py
+${RIB_NAME}                 example-bgp-rib
+${ODL_2_IP}                 127.0.0.2
+${ODL_3_IP}                 127.0.0.3
+${ODL_4_IP}                 127.0.0.4
+${OLD_AS_PATH}              \n"as-path": {},
+${NEW_AS_PATH}              ${EMPTY}
+@{BGP_PEER_TYPES}           external    internal    internal
+@{BGP_PEER_AS_NUMBERS}      65000    64496    64496
+@{ODL_IP_INDICES_ALL}       2    3    4
+@{L3VPN_RT_CHECK}           false    true    false
 &{RT_CONSTRAIN_APP_PEER}    IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
-&{ADJ_RIB_OUT}    PATH=peer\=bgp:%2F%2F${ODL_3_IP}/adj-rib-out    BGP_RIB=${RIB_NAME}
+&{ADJ_RIB_OUT}              PATH=peer\=bgp:%2F%2F${ODL_3_IP}/adj-rib-out    BGP_RIB=${RIB_NAME}
+
 
 *** Test Cases ***
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     FOR    ${i}    ${type}    IN ZIP    ${ODL_IP_INDICES_ALL}    ${BGP_PEER_TYPES}
-        &{ODL_CONFIG}=    BuiltIn.Create_Dictionary    IP=${ODL_${i}_IP}    TYPE=${type}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-        ...    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true
+        &{ODL_CONFIG} =    BuiltIn.Create_Dictionary
+        ...    IP=${ODL_${i}_IP}
+        ...    TYPE=${type}
+        ...    HOLDTIME=${HOLDTIME}
+        ...    PEER_PORT=${BGP_TOOL_PORT}
+        ...    INITIATE=false
+        ...    BGP_RIB=${RIB_NAME}
+        ...    PASSIVE_MODE=true
         TemplatedRequests.Put_As_Xml_Templated    ${EBGP_DIR}    mapping=${ODL_CONFIG}    session=${CONFIG_SESSION}
     END
 
@@ -75,20 +85,41 @@ Play_To_Odl_ext_l3vpn_rt_arg
     [Documentation]    This TC sends route-target route containing route-target argument from node 1 to odl
     ...    so odl can identify this peer as appropriate for advertizement when it recieves such route.
     Play_To_Odl_Non_Removal_BgpRpcClient2    ext_l3vpn_rt_arg    ${RT_CONSTRAIN_DIR}
-    &{effective_rib_in}    BuiltIn.Create_Dictionary    PATH=peer\=bgp:%2F%2F${ODL_2_IP}/effective-rib-in    BGP_RIB=${RIB_NAME}    AS_PATH=${AS_PATH}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}/ext_l3vpn_rt_arg/rib    mapping=${effective_rib_in}    session=${CONFIG_SESSION}
+    &{effective_rib_in} =    BuiltIn.Create_Dictionary
+    ...    PATH=peer\=bgp:%2F%2F${ODL_2_IP}/effective-rib-in
+    ...    BGP_RIB=${RIB_NAME}
+    ...    AS_PATH=${AS_PATH}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}/ext_l3vpn_rt_arg/rib
+    ...    mapping=${effective_rib_in}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Play_To_Odl_rt_constrain_type_0
     [Documentation]    Sends RT route from node 2 to odl and then checks that odl advertizes l3vpn route from previous TC.
     Play_To_Odl_Non_Removal_BgpRpcClient3    rt_constrain_type_0    ${RT_CONSTRAIN_DIR}
-    &{loc_rib}    BuiltIn.Create_Dictionary    PATH=loc-rib    BGP_RIB=${RIB_NAME}    AS_PATH=${AS_PATH}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}/rt_constrain_type_0/rib    mapping=${loc_rib}    session=${CONFIG_SESSION}
+    &{loc_rib} =    BuiltIn.Create_Dictionary    PATH=loc-rib    BGP_RIB=${RIB_NAME}    AS_PATH=${AS_PATH}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}/rt_constrain_type_0/rib
+    ...    mapping=${loc_rib}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Check_Presence_Of_l3vpn_Route_In_Node_2_Effective_Rib_In_Table
     [Documentation]    Checks l3vpn route is present in node 2 effective-rib-in table.
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}/ext_l3vpn_rt_arg/rib    mapping=${ADJ_RIB_OUT}    session=${CONFIG_SESSION}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}/ext_l3vpn_rt_arg/rib
+    ...    mapping=${ADJ_RIB_OUT}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Check_l3vpn_Route_Advertisement_On_Each_Node
@@ -101,8 +132,17 @@ Play_To_Odl_rt_constrain_type_1
     [Documentation]    Sends RT route from node 3 to odl and then checks that odl does not advertize l3vpn route from previous TC,
     ...    that is that update message is empty.
     Play_To_Odl_Non_Removal_BgpRpcClient4    rt_constrain_type_1    ${RT_CONSTRAIN_DIR}
-    &{effective_rib_in} =    BuiltIn.Create_Dictionary    PATH=peer\=bgp:%2F%2F${ODL_4_IP}/effective-rib-in    BGP_RIB=${RIB_NAME}    AS_PATH=${AS_PATH}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}/rt_constrain_type_1/rib    mapping=${effective_rib_in}    session=${CONFIG_SESSION}
+    &{effective_rib_in} =    BuiltIn.Create_Dictionary
+    ...    PATH=peer\=bgp:%2F%2F${ODL_4_IP}/effective-rib-in
+    ...    BGP_RIB=${RIB_NAME}
+    ...    AS_PATH=${AS_PATH}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}/rt_constrain_type_1/rib
+    ...    mapping=${effective_rib_in}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
     ${update} =    BgpRpcClient4.play_get
     Comment    From neon onwards there is extra BGP End-Of-RIB message
@@ -113,7 +153,11 @@ Play_To_Odl_remove_rt
     BgpRpcClient3.play_clean
     Play_To_Odl_Routes_Removal_Template_BgpRpcClient3    rt_constrain_type_0    ${RT_CONSTRAIN_DIR}
     Comment    From neon onwards there is extra BGP End-Of-RIB message
-    CompareStream.Run_Keyword_If_At_Most_Fluorine    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Empty_Reported_Data
+    CompareStream.Run_Keyword_If_At_Most_Fluorine
+    ...    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    3x
+    ...    2s
+    ...    Verify_Empty_Reported_Data
     ${update} =    BgpRpcClient4.play_get
     Comment    From neon onwards there is extra BGP End-Of-RIB message
     CompareStream.Run_Keyword_If_At_Most_Fluorine    BuiltIn.Should_Be_Equal    ${update}    ${Empty}
@@ -135,11 +179,18 @@ Delete_Bgp_Peers_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     FOR    ${i}    ${type}    IN ZIP    ${ODL_IP_INDICES_ALL}    ${BGP_PEER_TYPES}
-        &{ODL_CONFIG} =    BuiltIn.Create_Dictionary    IP=${ODL_${i}_IP}    TYPE=${type}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-        ...    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true
+        &{ODL_CONFIG} =    BuiltIn.Create_Dictionary
+        ...    IP=${ODL_${i}_IP}
+        ...    TYPE=${type}
+        ...    HOLDTIME=${HOLDTIME}
+        ...    PEER_PORT=${BGP_TOOL_PORT}
+        ...    INITIATE=false
+        ...    BGP_RIB=${RIB_NAME}
+        ...    PASSIVE_MODE=true
         TemplatedRequests.Delete_Templated    ${EBGP_DIR}    mapping=${ODL_CONFIG}    session=${CONFIG_SESSION}
     END
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
@@ -159,83 +210,96 @@ Stop_Suite
     RequestsLibrary.Delete_All_Sessions
 
 Start_Bgp_Peer
-    [Arguments]    ${ip}    ${as_number}    ${port}    ${filename}
     [Documentation]    Starts bgp peer.
-    ${command} =    BuiltIn.Set_Variable    python3 play.py --amount 0 --myip=${ip} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --asnumber=${as_number} --peerport=${ODL_BGP_PORT} --port=${port} --usepeerip --debug --allf --wfr 1 &> ${filename} &
+    [Arguments]    ${ip}    ${as_number}    ${port}    ${filename}
+    ${command} =    BuiltIn.Set_Variable
+    ...    python3 play.py --amount 0 --myip=${ip} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --asnumber=${as_number} --peerport=${ODL_BGP_PORT} --port=${port} --usepeerip --debug --allf --wfr 1 &> ${filename} &
     BuiltIn.Log    ${command}
     ${output} =    SSHLibrary.Write    ${command}
 
 Play_To_Odl_Non_Removal_BgpRpcClient2
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/announce_${totest}.hex and send it to odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${announce_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/announce_${totest}.hex
     BgpRpcClient2.play_send    ${announce_hex}
 
 Play_To_Odl_Non_Removal_BgpRpcClient3
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/announce_${totest}.hex and send it to odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${announce_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/announce_${totest}.hex
     BgpRpcClient3.play_send    ${announce_hex}
 
 Play_To_Odl_Non_Removal_BgpRpcClient4
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/announce_${totest}.hex and send it to odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${announce_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/announce_${totest}.hex
     BgpRpcClient4.play_send    ${announce_hex}
 
 Play_To_Odl_Routes_Removal_Template_BgpRpcClient2
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/withdraw_${totest}.hex and send it to odl to remove rt argument from odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${withdraw_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/withdraw_${totest}.hex
     BgpRpcClient2.play_clean
     BgpRpcClient2.play_send    ${withdraw_hex}
 
 Play_To_Odl_Routes_Removal_Template_BgpRpcClient3
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/withdraw_${totest}.hex and send it to odl to remove rt argument from odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${withdraw_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/withdraw_${totest}.hex
     BgpRpcClient3.play_clean
     BgpRpcClient3.play_send    ${withdraw_hex}
 
 Play_To_Odl_Routes_Removal_Template_BgpRpcClient4
-    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     [Documentation]    Read contents of file ${dir}/${totest}/withdraw_${totest}.hex and send it to odl to remove rt argument from odl.
+    [Arguments]    ${totest}    ${dir}    ${ipv}=ipv4
     ${withdraw_hex} =    OperatingSystem.Get_File    ${dir}/${totest}/withdraw_${totest}.hex
     BgpRpcClient4.play_clean
     BgpRpcClient4.play_send    ${withdraw_hex}
 
 Get_Update_Message_And_Compare_With_Hex_BgpRpcClient2
-    [Arguments]    ${hex}    ${option}
     [Documentation]    Returns hex update message and compares it to hex.
+    [Arguments]    ${hex}    ${option}
     ${update} =    BgpRpcClient2.play_get
-    BuiltIn.Run_Keyword_If    "${option}" == "true"    BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
-    BuiltIn.Run_Keyword_If    "${option}" == "false"    BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    IF    "${option}" == "true"
+        BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
+    END
+    IF    "${option}" == "false"
+        BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    END
 
 Get_Update_Message_And_Compare_With_Hex_BgpRpcClient3
-    [Arguments]    ${hex}    ${option}
     [Documentation]    Returns hex update message and compares it to hex.
+    [Arguments]    ${hex}    ${option}
     ${update} =    BgpRpcClient3.play_get
-    BuiltIn.Run_Keyword_If    "${option}" == "true"    BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
-    BuiltIn.Run_Keyword_If    "${option}" == "false"    BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    IF    "${option}" == "true"
+        BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
+    END
+    IF    "${option}" == "false"
+        BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    END
 
 Get_Update_Message_And_Compare_With_Hex_BgpRpcClient4
-    [Arguments]    ${hex}    ${option}
     [Documentation]    Returns hex update message and compares it to hex.
+    [Arguments]    ${hex}    ${option}
     ${update} =    BgpRpcClient4.play_get
-    BuiltIn.Run_Keyword_If    "${option}" == "true"    BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
-    BuiltIn.Run_Keyword_If    "${option}" == "false"    BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    IF    "${option}" == "true"
+        BuiltIn.Should_Be_Equal_As_Strings    ${update}    ${hex}
+    END
+    IF    "${option}" == "false"
+        BuiltIn.Should_Not_Be_Equal_As_Strings    ${update}    ${hex}
+    END
 
 Check_For_L3VPN_Odl_Avertisement
-    [Arguments]    ${announce_hex}
     [Documentation]    Checks that each node received or did not receive update message containing given hex message.
+    [Arguments]    ${announce_hex}
     FOR    ${i}    ${option}    IN ZIP    ${ODL_IP_INDICES_ALL}    ${L3VPN_RT_CHECK}
-        ${keyword_name}=    BuiltIn.Set_Variable    Get_Update_Message_And_Compare_With_Hex_BgpRpcClient${i}
+        ${keyword_name} =    BuiltIn.Set_Variable    Get_Update_Message_And_Compare_With_Hex_BgpRpcClient${i}
         BuiltIn.Run_Keyword    ${keyword_name}    ${announce_hex}    ${option}
     END
 
 Verify_Reported_Data
-    [Arguments]    ${url}    ${exprspfile}
     [Documentation]    Verifies expected response
+    [Arguments]    ${url}    ${exprspfile}
     ${expresponse} =    OperatingSystem.Get File    ${exprspfile}
     BuiltIn.Log    expected_response: ${expresponse}
     ${rsp} =    RequestsLibrary.Get_Request    ${CONFIG_SESSION}    ${url}
@@ -245,8 +309,16 @@ Verify_Reported_Data
 
 Verify_Empty_Reported_Data
     [Documentation]    Verify empty data response
-    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}${/}empty_l3vpn    session=${CONFIG_SESSION}    mapping=${ADJ_RIB_OUT}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}${/}empty_l3vpn
+    ...    session=${CONFIG_SESSION}
+    ...    mapping=${ADJ_RIB_OUT}
+    ...    verify=True
 
 Verify_Empty_Data_Neon
     [Documentation]    Verify empty data on neon
-    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}${/}empty_route    session=${CONFIG_SESSION}    mapping=${ADJ_RIB_OUT}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${RT_CONSTRAIN_DIR}${/}empty_route
+    ...    session=${CONFIG_SESSION}
+    ...    mapping=${ADJ_RIB_OUT}
+    ...    verify=True
index 3d7bbc3c6116fc250f533720ba93d167bea34eff..62df8052998732f52dbb4970fb9c4a56cd56a34c 100644 (file)
@@ -1,44 +1,48 @@
 *** Settings ***
-Documentation     Functional test for bgp - graceful-restart
+Documentation       Functional test for bgp - graceful-restart
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distbmution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8001    WITH NAME    BgpRpcClient1
-Library           ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8002    WITH NAME    BgpRpcClient2
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           SSHLibrary
-Library           String
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distbmution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Library             ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8001    WITH NAME    BgpRpcClient1
+Library             ../../../libraries/BgpRpcClient.py    ${ODL_SYSTEM_IP}    8002    WITH NAME    BgpRpcClient2
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             SSHLibrary
+Library             String
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${HOLDTIME}       180
-${RIB_NAME}       example-bgp-rib
-${CONFIG_SESSION}    config-session
-${PLAY_SCRIPT}    ${CURDIR}/../../../../tools/fastbgp/play.py
-${GR_FOLDER}      ${CURDIR}/../../../variables/bgpfunctional/graceful_restart
-${PEER1_AS}       65000
-${PEER2_AS}       65001
-${PEER1_IP}       127.0.0.2
-${PEER2_IP}       127.0.0.3
-${PEER1_PORT}     8001
-${PEER2_PORT}     8002
-${FIRST_PREFIX}    8.1.0.0
-${SECOND_PREFIX}    8.2.0.0
-${NEXT_HOP}       1.1.1.1
-${PREFIX_LEN}     28
+${HOLDTIME}             180
+${RIB_NAME}             example-bgp-rib
+${CONFIG_SESSION}       config-session
+${PLAY_SCRIPT}          ${CURDIR}/../../../../tools/fastbgp/play.py
+${GR_FOLDER}            ${CURDIR}/../../../variables/bgpfunctional/graceful_restart
+${PEER1_AS}             65000
+${PEER2_AS}             65001
+${PEER1_IP}             127.0.0.2
+${PEER2_IP}             127.0.0.3
+${PEER1_PORT}           8001
+${PEER2_PORT}           8002
+${FIRST_PREFIX}         8.1.0.0
+${SECOND_PREFIX}        8.2.0.0
+${NEXT_HOP}             1.1.1.1
+${PREFIX_LEN}           28
+
 
 *** Test Cases ***
 Verify_Empty_Rib_After_Graceful_Restart_Timer_Expired
@@ -118,6 +122,7 @@ Verify_No_Ipv6_Route_Immediately_After_Peer_Was_Killed
     Verify_Routes    dir=empty_ipv6_route    interval=1s
     [Teardown]    Teardown_TC    gr_tc6.out
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Initialize SetupUtils. Suite setup keyword.
@@ -166,7 +171,12 @@ Setup_TC3
     ...    Start two bgp peers, each with their default values, and verify their respective routes
     ...    are present in loc-rib, than kill the first bgp speaker (effectively simulating graceful-restart)
     SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    Start_Bgp_Peer    prefix=${SECOND_PREFIX}    myip=${PEER2_IP}    port=${PEER2_PORT}    as_number=${PEER2_AS}    log_name=gr_tc3.out
+    Start_Bgp_Peer
+    ...    prefix=${SECOND_PREFIX}
+    ...    myip=${PEER2_IP}
+    ...    port=${PEER2_PORT}
+    ...    as_number=${PEER2_AS}
+    ...    log_name=gr_tc3.out
     Start_Bgp_Peer    multiple=${EMPTY}
     Verify_Routes    dir=ipv4_1_1
     BGPSpeaker.Kill_BGP_Speaker
@@ -190,66 +200,95 @@ Setup_TC6
     Verify_Routes    dir=ipv6_1
 
 Teardown_TC
-    [Arguments]    ${log_name}=play.py.out
     [Documentation]    In case Test Case failed to close Python Speakers, we close them.
     ...    Wait until there are no routes present in loc-rib.
+    [Arguments]    ${log_name}=play.py.out
     Kill_Talking_BGP_Speakers    ${log_name}
     Verify_Routes    dir=empty_route    retry=10x
     Verify_Routes    dir=empty_ipv6_route    interval=1s
 
 Verify_Routes
-    [Arguments]    ${dir}=empty_route    ${retry}=5x    ${interval}=3s
     [Documentation]    Verify route based on how many routes are present in rib.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${retry}    ${interval}    TemplatedRequests.Get_As_Json_Templated    ${GR_FOLDER}${/}${dir}    session=${CONFIG_SESSION}    verify=True
+    [Arguments]    ${dir}=empty_route    ${retry}=5x    ${interval}=3s
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${retry}
+    ...    ${interval}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${GR_FOLDER}${/}${dir}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Verify_Hex_Message
-    [Arguments]    ${file_dir}    ${peer}=${PEER1_IP}    ${file_name}=${file_dir}.hex
     [Documentation]    Verify hex message advertised from odl.
+    [Arguments]    ${file_dir}    ${peer}=${PEER1_IP}    ${file_name}=${file_dir}.hex
     ${expected} =    TemplatedRequests.Resolve_Text_From_Template_File    ${GR_FOLDER}${/}${file_dir}    ${file_name}
     ${actual} =    BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    Get_Hex_Message    peer=${peer}
     BgpOperations.Verify_Two_Hex_Messages_Are_Equal    ${expected}    ${actual}
 
 Get_Hex_Message
-    [Arguments]    ${peer}=${PEER1_IP}
     [Documentation]    Gets open message in case of first peer, and update message in case of second peer.
-    ${hex} =    BuiltIn.Run_Keyword_If    "${peer}" == "${PEER1_IP}"    BgpRpcClient1.play_get    what=open
-    ...    ELSE    BgpRpcClient2.play_get
+    [Arguments]    ${peer}=${PEER1_IP}
+    IF    "${peer}" == "${PEER1_IP}"
+        ${hex} =    BgpRpcClient1.play_get    what=open
+    ELSE
+        ${hex} =    BgpRpcClient2.play_get
+    END
     BuiltIn.Should_Not_Be_Equal    ${hex}    ${EMPTY}
-    [Return]    ${hex}
+    RETURN    ${hex}
 
 Start_Bgp_Peer
+    [Documentation]    Starts bgp peer.
     [Arguments]    ${prefix}=${FIRST_PREFIX}    ${amount}=1    ${myip}=${PEER1_IP}    ${port}=${PEER1_PORT}    ${as_number}=${PEER1_AS}    ${grace}=0
     ...    ${log_name}=play.py.out    ${multiple}=&    ${ipv6}=${EMPTY}
-    [Documentation]    Starts bgp peer.
-    ${command} =    BuiltIn.Set_Variable    python3 play.py${ipv6} --firstprefix ${prefix} --prefixlen ${PREFIX_LEN} --amount ${amount} --myip ${myip} --myport ${BGP_TOOL_PORT} --peerip ${ODL_SYSTEM_IP} --peerport ${ODL_BGP_PORT} --port ${port} --usepeerip --nexthop ${NEXT_HOP} --asnumber ${as_number} --debug --grace ${grace} --wfr 1 &> ${log_name} ${multiple}
+    ${command} =    BuiltIn.Set_Variable
+    ...    python3 play.py${ipv6} --firstprefix ${prefix} --prefixlen ${PREFIX_LEN} --amount ${amount} --myip ${myip} --myport ${BGP_TOOL_PORT} --peerip ${ODL_SYSTEM_IP} --peerport ${ODL_BGP_PORT} --port ${port} --usepeerip --nexthop ${NEXT_HOP} --asnumber ${as_number} --debug --grace ${grace} --wfr 1 &> ${log_name} ${multiple}
     BuiltIn.Log    ${command}
     ${output} =    SSHLibrary.Write    ${command}
 
 Kill_Talking_BGP_Speakers
-    [Arguments]    ${log_name}=play.py.out
     [Documentation]    Save play.py log into workspace, attempt to dump speaker logs into robot log.
     ...    Abort all Python speakers.
+    [Arguments]    ${log_name}=play.py.out
     BuiltIn.Run_Keyword_And_Ignore_Error    BGPcliKeywords.Store_File_To_Workspace    ${log_name}    ${log_name}.log
     BuiltIn.Run_Keyword_And_Ignore_Error    BGPSpeaker.Dump_BGP_Speaker_Logs
     BGPSpeaker.Kill_All_BGP_Speakers
 
 Configure_BGP_Peers
-    [Arguments]    ${folder}=${EMPTY}
     [Documentation]    Configure two eBGP peers with graceful-restart enabled
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    AS_NUMBER=${PEER1_AS}    BGP_RIB=${RIB_NAME}
-    TemplatedRequests.Put_As_Xml_Templated    ${GR_FOLDER}${/}${folder}peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    AS_NUMBER=${PEER2_AS}    BGP_RIB=${RIB_NAME}
-    TemplatedRequests.Put_As_Xml_Templated    ${GR_FOLDER}${/}${folder}peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    [Arguments]    ${folder}=${EMPTY}
+    &{mapping} =    BuiltIn.Create_Dictionary
+    ...    IP=${PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    AS_NUMBER=${PEER1_AS}
+    ...    BGP_RIB=${RIB_NAME}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${GR_FOLDER}${/}${folder}peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping} =    BuiltIn.Create_Dictionary
+    ...    IP=${PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    AS_NUMBER=${PEER2_AS}
+    ...    BGP_RIB=${RIB_NAME}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${GR_FOLDER}${/}${folder}peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Delete_Bgp_Peers_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER1_IP}    BGP_RIB=${RIB_NAME}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER1_IP}    BGP_RIB=${RIB_NAME}
     TemplatedRequests.Delete_Templated    ${GR_FOLDER}${/}peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER2_IP}    BGP_RIB=${RIB_NAME}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${PEER2_IP}    BGP_RIB=${RIB_NAME}
     TemplatedRequests.Delete_Templated    ${GR_FOLDER}${/}peers    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Post_Graceful_Restart
-    [Arguments]    ${ip}=${PEER1_IP}
     [Documentation]    Post rpc to odl, effectively restarting it.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${ip}    BGP_RIB=${RIB_NAME}
-    TemplatedRequests.Post_As_Xml_Templated    ${GR_FOLDER}${/}restart    mapping=${mapping}    session=${CONFIG_SESSION}
+    [Arguments]    ${ip}=${PEER1_IP}
+    &{mapping} =    BuiltIn.Create_Dictionary    IP=${ip}    BGP_RIB=${RIB_NAME}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${GR_FOLDER}${/}restart
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
index bc01b17d62996c4dba878a9de961deccd2cc882b..a7ca3cdccb68abb4cc93c02bb01930aec29fb87b 100644 (file)
@@ -1,46 +1,54 @@
 *** Settings ***
-Documentation     Functional test suite for bgp - n-path and all-path selection
+Documentation       Functional test suite for bgp - n-path and all-path selection
 ...
-...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests tcpmd5 connection of bgp peers. It uses odl and exabgp as bgp
-...               peer. No routes are advertized, simple peer presence in the datastore is tested.
-...               are configured via application peer.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Delete_Bgp_Peer_Configuration
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/CompareStream.robot
-Resource          ${CURDIR}/../../../libraries/ExaBgpLib.robot
-Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
+...                 This suite tests tcpmd5 connection of bgp peers. It uses odl and exabgp as bgp
+...                 peer. No routes are advertized, simple peer presence in the datastore is tested.
+...                 are configured via application peer.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/CompareStream.robot
+Resource            ${CURDIR}/../../../libraries/ExaBgpLib.robot
+Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource            ${CURDIR}/../../../libraries/WaitForFailure.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       Delete_Bgp_Peer_Configuration
+
 
 *** Variables ***
-${HOLDTIME}       180
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional/bgp_md5
-${BGP_PEER_FOLDER}    ${BGP_VAR_FOLDER}${/}bgp_peer
-${BGP_EXAMD5_CFG}    exa-md5.cfg
-${MD5_SAME_PASSWD}    topsecret
-${MD5_DIFF_PASSWD}    different
-${PROTOCOL_OPENCONFIG}    example-bgp-rib
-${CONFIG_SESSION}    session
+${HOLDTIME}                 180
+${BGP_VAR_FOLDER}           ${CURDIR}/../../../variables/bgpfunctional/bgp_md5
+${BGP_PEER_FOLDER}          ${BGP_VAR_FOLDER}${/}bgp_peer
+${BGP_EXAMD5_CFG}           exa-md5.cfg
+${MD5_SAME_PASSWD}          topsecret
+${MD5_DIFF_PASSWD}          different
+${PROTOCOL_OPENCONFIG}      example-bgp-rib
+${CONFIG_SESSION}           session
+
 
 *** Test Cases ***
 Verify Exabgp Connected
     [Documentation]    Verifies exabgp connected with md5 settings
     [Tags]    critical
     [Setup]    Reconfigure_ODL_To_Accept_Connection    ${MD5_SAME_PASSWD}
-    ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${BGP_EXAMD5_CFG}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}    connection_retries=${3}
+    ExaBgpLib.Start_ExaBgp_And_Verify_Connected
+    ...    ${BGP_EXAMD5_CFG}
+    ...    ${CONFIG_SESSION}
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    connection_retries=${3}
     ExaBgpLib.Stop_ExaBgp
 
 Verify Exabgp Not Connected
@@ -48,14 +56,23 @@ Verify Exabgp Not Connected
     [Tags]    critical
     [Setup]    Reconfigure_ODL_To_Accept_Connection    ${MD5_DIFF_PASSWD}
     ExaBgpLib.Start_ExaBgp    ${BGP_EXAMD5_CFG}
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15s    2s    ExaBgpLib.Verify_ExaBgps_Connection    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout
+    ...    15s
+    ...    2s
+    ...    ExaBgpLib.Verify_ExaBgps_Connection
+    ...    ${CONFIG_SESSION}
+    ...    ${TOOLS_SYSTEM_IP}
     ExaBgpLib.Stop_ExaBgp
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}=    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     SSHKeywords.Virtual_Env_Create
@@ -71,20 +88,25 @@ Stop_Suite
     RequestsLibrary.Delete_All_Sessions
 
 Reconfigure_ODL_To_Accept_Connection
-    [Arguments]    ${password}
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSWORD=${password}
+    [Arguments]    ${password}
+    &{mapping}=    BuiltIn.Create_Dictionary
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSWORD=${password}
     ...    PASSIVE_MODE=true
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
+    &{mapping}=    BuiltIn.Create_Dictionary    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Delete_Templated    ${BGP_PEER_FOLDER}    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Upload_Config_Files
-    [Arguments]    ${addpath}=disable
     [Documentation]    Uploads exabgp config files
+    [Arguments]    ${addpath}=disable
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}${/}exa-md5.cfg    .
     @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
index d523f5bf6fce2009fb02e05e9cb2543d43e328f0..f9f70f466fe5eb896c873769d11429605689079c 100644 (file)
@@ -1,65 +1,79 @@
 *** Settings ***
-Documentation     Functional test for ipv6 connection with bgp.
+Documentation       Functional test for ipv6 connection with bgp.
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests simple connection between one ibgp peer (exabgp) and Odl.
-...               Peer is configured with ipv6, and exabgp connectes to odl via ipv6.
-...               Exabgp sends one ipv6 unicast route, which presence is verified in
-...               example-ipv6-topology. Tests this connection multiple times, with
-...               different ipv6 accepted formats, e.g. (::1, 0:0:0:0:0:0:0:1, full text)
-...               This suite also tests a combination of afi-safis on odl and exabgp.
-...               ipv6 route injection is carried out from odl to the ibgp peer without
-...               ipv6 family enabled on the peer device and checked for exceptions
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/Genius.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/KarafKeywords.robot
+...                 This suite tests simple connection between one ibgp peer (exabgp) and Odl.
+...                 Peer is configured with ipv6, and exabgp connectes to odl via ipv6.
+...                 Exabgp sends one ipv6 unicast route, which presence is verified in
+...                 example-ipv6-topology. Tests this connection multiple times, with
+...                 different ipv6 accepted formats, e.g. (::1, 0:0:0:0:0:0:0:1, full text)
+...                 This suite also tests a combination of afi-safis on odl and exabgp.
+...                 ipv6 route injection is carried out from odl to the ibgp peer without
+...                 ipv6 family enabled on the peer device and checked for exceptions
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/Genius.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/KarafKeywords.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional/ipv6
-${CONFIG_SESSION}    config-session
-${CONTROLLER_IPV6}    ::1
-${EXABGP_ID}      1.2.3.4
-${EXABGP_ID_2}    127.0.0.1
-${EXABGP_CFG}     exaipv6.cfg
-${EXABGP_LOG}     exaipv6.log
-${EXABGP2_CFG}    exaipv4.cfg
-${EXABGP2_LOG}    exaipv4.log
-${EXABGP3_CFG}    exabgp_graceful_restart.cfg
-${EXABGP3_LOG}    exabgp_graceful_restart.log
-${EXABGP4_CFG}    exa4.cfg
-${EXABGP4_LOG}    exa4.log
-${IPV4_IP}        127.0.0.1
-${CONTROLLER_IPV4}    ${ODL_SYSTEM_IP}
-${IPV6_IP}        2607:f0d0:1002:0011:0000:0000:0000:0002
-${IPV6_IP_2}      2607:f0d0:1002:11:0:0:0:2
-${IPV6_IP_3}      2607:f0d0:1002:11::2
-${IPV6_IP_GW}     2607:f0d0:1002:0011:0000:0000:0000:0001
-${IPV6_PREFIX_LENGTH}    64
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
+${BGP_VAR_FOLDER}           ${CURDIR}/../../../variables/bgpfunctional/ipv6
+${CONFIG_SESSION}           config-session
+${CONTROLLER_IPV6}          ::1
+${EXABGP_ID}                1.2.3.4
+${EXABGP_ID_2}              127.0.0.1
+${EXABGP_CFG}               exaipv6.cfg
+${EXABGP_LOG}               exaipv6.log
+${EXABGP2_CFG}              exaipv4.cfg
+${EXABGP2_LOG}              exaipv4.log
+${EXABGP3_CFG}              exabgp_graceful_restart.cfg
+${EXABGP3_LOG}              exabgp_graceful_restart.log
+${EXABGP4_CFG}              exa4.cfg
+${EXABGP4_LOG}              exa4.log
+${IPV4_IP}                  127.0.0.1
+${CONTROLLER_IPV4}          ${ODL_SYSTEM_IP}
+${IPV6_IP}                  2607:f0d0:1002:0011:0000:0000:0000:0002
+${IPV6_IP_2}                2607:f0d0:1002:11:0:0:0:2
+${IPV6_IP_3}                2607:f0d0:1002:11::2
+${IPV6_IP_GW}               2607:f0d0:1002:0011:0000:0000:0000:0001
+${IPV6_PREFIX_LENGTH}       64
+${HOLDTIME}                 180
+${RIB_INSTANCE}             example-bgp-rib
+
 
 *** Test Cases ***
 Reconfigure_ODL_To_Accept_Connections
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Start_Exabgp
     [Documentation]    Start exabgp with
@@ -74,8 +88,15 @@ Verify_Ipv6_Topology_Filled
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Empty
@@ -85,9 +106,19 @@ Verify_Ipv6_Topology_Empty
 
 Reconfigure_ODL_To_Accept_Connections_2
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with ipv6 address without "::" shortened version.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP_2}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP_2}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Filled_2
     [Documentation]    Verifies that example-ipv6-topology is filled after configuring the peer for the second time.
@@ -96,8 +127,15 @@ Verify_Ipv6_Topology_Filled_2
 
 Delete_Bgp_Peer_Configuration_2
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP_2}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP_2}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Empty_2
@@ -107,9 +145,19 @@ Verify_Ipv6_Topology_Empty_2
 
 Reconfigure_ODL_To_Accept_Connections_3
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with full text ipv6 address.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP_3}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP_3}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Filled_3
     [Documentation]    Verifies that example-ipv6-topology is filled after configuring the peer for the third time.
@@ -118,8 +166,15 @@ Verify_Ipv6_Topology_Filled_3
 
 Delete_Bgp_Peer_Configuration_3
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP_3}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP_3}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Empty_3
@@ -135,16 +190,41 @@ Stop_All_Exabgps
 Configure_App_Peer
     [Documentation]    Configures bgp application peer.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/application_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/application_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connections_4
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
-    &{mapping}    Create Dictionary    IP=${IPV4_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_neighbor_rib    mapping=${mapping}    session=${CONFIG_SESSION}
-    RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}    timeout=5
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV4_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_neighbor_rib
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    RequestsLibrary.Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    headers=${HEADERS}
+    ...    timeout=5
 
 Start_Exabgp_2
     [Documentation]    Start exabgp and Verify BGP connection
@@ -154,28 +234,71 @@ Start_Exabgp_2
 
 Inject_Ipv6_Route_1
     [Documentation]    Inject the Ipv6 route from controller
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Post_As_Xml_Templated    ${BGP_VAR_FOLDER}/ipv6_route_injection    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_route_injection
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Check_Ipv6_Prefix_In_Bgp_Rib_1
     [Documentation]    Check for the presence of Ipv6 Prefix in the BGP RIB
-    &{mapping}    Create Dictionary    IP=${CONTROLLER_IPV4}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    TemplatedRequests.Get_As_Json_Templated    ${BGP_VAR_FOLDER}/bgp_rib    session=${CONFIG_SESSION}    mapping=${mapping}
+    &{mapping}    Create Dictionary
+    ...    IP=${CONTROLLER_IPV4}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_rib
+    ...    session=${CONFIG_SESSION}
+    ...    mapping=${mapping}
 
 Delete_Injected_Ipv6_Routes_1
     [Documentation]    Delete the injected IPV6 routes
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/ipv6_route_injection    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_route_injection
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     KarafKeywords.Fail If Exceptions Found During Test    ${SUITE_NAME}.${TEST_NAME}    fail=${True}
 
 Delete_Bgp_Peer_Configuration_4
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV4_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_neighbor_rib    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV4_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_neighbor_rib
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Empty_4
     [Documentation]    Verifies that example-ipv6-topology is empty after deconfiguring peer for the first time.
@@ -184,40 +307,100 @@ Verify_Ipv6_Topology_Empty_4
 
 Reconfigure_ODL_To_Accept_Connections_5
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
-    &{mapping}    Create Dictionary    IP=${IPV4_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV4_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Inject_Ipv6_Route_2
     [Documentation]    Inject the Ipv6 route from controller
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Post_As_Xml_Templated    ${BGP_VAR_FOLDER}/ipv6_route_injection    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_route_injection
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Check_Ipv6_Prefix_In_Bgp_Rib_2
     [Documentation]    Check for the presence of Ipv6 Prefix in the BGP RIB
-    &{mapping}    Create Dictionary    IP=${CONTROLLER_IPV4}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    TemplatedRequests.Get_As_Json_Templated    ${BGP_VAR_FOLDER}/bgp_rib    session=${CONFIG_SESSION}    mapping=${mapping}
+    &{mapping}    Create Dictionary
+    ...    IP=${CONTROLLER_IPV4}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_rib
+    ...    session=${CONFIG_SESSION}
+    ...    mapping=${mapping}
 
 Delete_Injected_Ipv6_Routes_2
     [Documentation]    Delete the injected IPV6 routes
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/ipv6_route_injection    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_route_injection
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     KarafKeywords.Fail If Exceptions Found During Test    ${SUITE_NAME}.${TEST_NAME}    fail=${True}
 
 Delete_App_Peer
     [Documentation]    Deletes bgp application peer.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    Create Dictionary    IP=127.0.0.12    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/application_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=127.0.0.12
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VAR_FOLDER}/application_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Delete_Bgp_Peer_Configuration_5
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV4_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV4_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Verify_Ipv6_Topology_Empty_5
@@ -234,9 +417,19 @@ Stop_All_Exabgps_2
 
 Reconfigure_ODL_To_Accept_Connections_6
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/graceful_restart    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/graceful_restart
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Start_Exabgp_3
     [Documentation]    Start exabgp with
@@ -259,9 +452,19 @@ Start_Exabgp_4
 
 Delete_Bgp_Peer_Configuration_6
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/graceful_restart    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VAR_FOLDER}/graceful_restart
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Stop_All_Exabgps_4
     [Documentation]    Save exabgp logs as exabgp_graceful_restart.log, and stop exabgp with ctrl-c bash signal
@@ -271,9 +474,19 @@ Stop_All_Exabgps_4
 Reconfigure_ODL_To_Accept_Connections_7
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
     [Tags]    exclude
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Start_Exabgp_5
     [Documentation]    Start exabgp with
@@ -284,8 +497,15 @@ Start_Exabgp_5
 Delete_Bgp_Peer_Configuration_7
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Tags]    exclude
-    &{mapping}    Create Dictionary    IP=${IPV6_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${IPV6_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Stop_All_Exabgps_5
@@ -294,11 +514,12 @@ Stop_All_Exabgps_5
     BGPcliKeywords.Store_File_To_Workspace    ${EXABGP4_LOG}    ${EXABGP4_LOG}
     ExaBgpLib.Stop_ExaBgp
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${conn_id}=    SSHLibrary.Open Connection    ${ODL_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=10s
+    ${conn_id}    SSHLibrary.Open Connection    ${ODL_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=10s
     Builtin.Set_Suite_Variable    ${conn_id}
     SSHKeywords.Flexible_Controller_Login
     Configure_Ipv6_Network
@@ -322,71 +543,83 @@ Configure_Ipv6_Network
     [Documentation]    Reconfigures basic network settings on controller
     SSHLibrary.Execute_Command    sudo ip -6 addr add ${IPV6_IP}/${IPV6_PREFIX_LENGTH} dev eth0
     SSHLibrary.Execute_Command    sudo ip -6 route add default via ${IPV6_IP_GW}
-    ${stdout}=    SSHLibrary.Execute_Command    sudo ip -6 addr show
+    ${stdout}    SSHLibrary.Execute_Command    sudo ip -6 addr show
     Log    ${stdout}
-    ${stdout}=    SSHLibrary.Execute_Command    sudo ip -6 route show
+    ${stdout}    SSHLibrary.Execute_Command    sudo ip -6 route show
     Log    ${stdout}
 
 Verify_Rib_Status_Empty
     [Documentation]    Verifies that example-ipv6-topology is empty
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    TemplatedRequests.Get_As_Json_Templated    ${BGP_VAR_FOLDER}/ipv6_topology_empty    session=${CONFIG_SESSION}    verify=True
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_topology_empty
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Verify_Rib_Status_Filled
     [Documentation]    Verifies that example-ipv6-topology is filled with ipv6 route
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    TemplatedRequests.Get_As_Json_Templated    ${BGP_VAR_FOLDER}/ipv6_topology_filled    session=${CONFIG_SESSION}    verify=True
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    2s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VAR_FOLDER}/ipv6_topology_filled
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Upload_Config_Files
     [Documentation]    Uploads exabgp config files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${EXABGP_CFG}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${IPV6_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${CONTROLLER_IPV6}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTERID/${EXABGP_ID}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Upload_Config_Files_exabgp_ipv4
     [Documentation]    Uploads exabgp config files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${EXABGP2_CFG}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *ipv4.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *ipv4.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/127.0.0.1/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTERID/127.0.0.1/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Upload_Config_Files_exabgp_graceful_restart
     [Documentation]    Uploads exabgp config files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${EXABGP3_CFG}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *restart.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *restart.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${IPV6_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${CONTROLLER_IPV6}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTERID/${EXABGP_ID}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
 Upload_Config_Files_Exabgp_AS_Value_Reconfigured
     [Documentation]    Uploads exabgp config files
     SSHLibrary.Put_File    ${BGP_VAR_FOLDER}/${EXABGP4_CFG}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *exa4.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *exa4.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/EXABGPIP/${IPV6_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${CONTROLLER_IPV6}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTERID/${EXABGP_ID}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
index 8173b6b5583f678aac6a30297ea2cf180d328244..34b52e4ef5c2d1a6d6b1c4a6e11e4fa937bbe30f 100644 (file)
@@ -1,43 +1,57 @@
 *** Settings ***
-Documentation     Functional test for ipv6 connection with bgp.
+Documentation       Functional test for ipv6 connection with bgp.
 ...
-...               Copyright (c) 2020 Lumina Networks Intellectual Property. All rights reserved.
+...                 Copyright (c) 2020 Lumina Networks Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite tests simple connection between one ibgp peer (goabgp) and Odl.
-...               Peer is configured with ipv6, and gobgp connectes to odl via ipv6.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/GoBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
+...                 This suite tests simple connection between one ibgp peer (goabgp) and Odl.
+...                 Peer is configured with ipv6, and gobgp connectes to odl via ipv6.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/GoBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${BGP_VAR_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional/ipv6
-${GOBGP_FOLDER}    ${CURDIR}/../../../variables/bgpfunctional/gobgp
-${CONFIG_SESSION}    config-session
-${GOBGP_CFG}      gobgp.cfg
-${GOBGP_LOG}      gobgp.log
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
-${GOBGP_BINARY_URL}    https://github.com/osrg/gobgp/releases/download/v2.18.0/gobgp_2.18.0_linux_386.tar.gz
-${FILE_NAME}      gobgp_2.18.0_linux_386.tar.gz
+${BGP_VAR_FOLDER}       ${CURDIR}/../../../variables/bgpfunctional/ipv6
+${GOBGP_FOLDER}         ${CURDIR}/../../../variables/bgpfunctional/gobgp
+${CONFIG_SESSION}       config-session
+${GOBGP_CFG}            gobgp.cfg
+${GOBGP_LOG}            gobgp.log
+${HOLDTIME}             180
+${RIB_INSTANCE}         example-bgp-rib
+${GOBGP_BINARY_URL}     https://github.com/osrg/gobgp/releases/download/v2.18.0/gobgp_2.18.0_linux_386.tar.gz
+${FILE_NAME}            gobgp_2.18.0_linux_386.tar.gz
+
 
 *** Test Cases ***
 Reconfigure_ODL_To_Accept_Connections
     [Documentation]    Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VAR_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Start_Gobgp
     [Tags]    critical
@@ -46,8 +60,15 @@ Start_Gobgp
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${BGP_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Stop_All_Gobgps
@@ -55,11 +76,15 @@ Stop_All_Gobgps
     BGPcliKeywords.Store_File_To_Workspace    ${GOBGP_LOG}    ${GOBGP_LOG}
     GoBgpLib.Stop_GoBgp
 
+
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${tools_system_conn_id}=    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
+    ${tools_system_conn_id}    SSHLibrary.Open_Connection
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    prompt=${DEFAULT_LINUX_PROMPT}
+    ...    timeout=6s
     Builtin.Set_Suite_Variable    ${tools_system_conn_id}
     SSHKeywords.Flexible_Mininet_Login    ${TOOLS_SYSTEM_USER}
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
@@ -75,14 +100,14 @@ Stop_Suite
 Upload_Config_Files
     [Documentation]    Uploads gobgp config files
     SSHLibrary.Put_File    ${GOBGP_FOLDER}/${GOBGP_CFG}    .
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/GOBGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTERID/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
 
index 5d4c20dc46e26609ee3470fa98a63f1099e1c0e6..4c0befc1d664618a0436ed131a026258529f3bd4 100644 (file)
@@ -1,38 +1,42 @@
 *** Settings ***
-Documentation     Functional test for bgp routing policies
+Documentation       Functional test for bgp routing policies
 ...
-...               Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+...                 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses 7 peers: app peer, 2x rr-client, 2x ebgp, 2x ibgp
-...               Tests results on effective-rib-in dependant on their respective configurations.
-...               Peers 1,2,4,5 are testing multiple ipv4 routes with additional arguments.
-...               Peers 3,6 have ipv4 and ipv6 mpls-labeled routes.
-Suite Setup       Start_Suite
-Suite Teardown    Stop_Suite
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Library           RequestsLibrary
-Library           SSHLibrary
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/ExaBgpLib.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/SSHKeywords.robot
+...                 This suite uses 7 peers: app peer, 2x rr-client, 2x ebgp, 2x ibgp
+...                 Tests results on effective-rib-in dependant on their respective configurations.
+...                 Peers 1,2,4,5 are testing multiple ipv4 routes with additional arguments.
+...                 Peers 3,6 have ipv4 and ipv6 mpls-labeled routes.
+
+Library             RequestsLibrary
+Library             SSHLibrary
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/ExaBgpLib.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/SSHKeywords.robot
+
+Suite Setup         Start_Suite
+Suite Teardown      Stop_Suite
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+
 
 *** Variables ***
-${POLICIES_VAR}    ${CURDIR}/../../../variables/bgpfunctional/bgppolicies
-${CMD}            env exabgp.tcp.port=1790 exabgp --debug
-@{PEER_TYPES}     ibgp_peer    ibgp_peer    ebgp_peer    ebgp_peer    rr_client_peer    rr_client_peer
-@{NUMBERS}        1    2    3    4    5    6
-${HOLDTIME}       180
-${RIB_INSTANCE}    example-bgp-rib
-${CONFIG_SESSION}    config-session
-${OLD_AS_PATH}    \n"as-path": {},
-${NEW_AS_PATH}    ${EMPTY}
+${POLICIES_VAR}         ${CURDIR}/../../../variables/bgpfunctional/bgppolicies
+${CMD}                  env exabgp.tcp.port=1790 exabgp --debug
+@{PEER_TYPES}           ibgp_peer    ibgp_peer    ebgp_peer    ebgp_peer    rr_client_peer    rr_client_peer
+@{NUMBERS}              1    2    3    4    5    6
+${HOLDTIME}             180
+${RIB_INSTANCE}         example-bgp-rib
+${CONFIG_SESSION}       config-session
+${OLD_AS_PATH}          \n"as-path": {},
+${NEW_AS_PATH}          ${EMPTY}
+
 
 *** Test Cases ***
 Verify_Rib_Empty
@@ -41,17 +45,34 @@ Verify_Rib_Empty
 
 Configure_App_Peer
     [Documentation]    Configures bgp application peer, and configures it's routes.
-    &{mapping}    BuiltIn.Create_Dictionary    RIB_INSTANCE_NAME=${RIB_INSTANCE}    APP_PEER_ID=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}    IP=${ODL_SYSTEM_IP}
-    TemplatedRequests.Post_As_Xml_Templated    ${POLICIES_VAR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    TemplatedRequests.Post_As_Xml_Templated    ${POLICIES_VAR}/app_peer_route    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    APP_PEER_ID=${ODL_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+    ...    IP=${ODL_SYSTEM_IP}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${POLICIES_VAR}/app_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${POLICIES_VAR}/app_peer_route
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connections
     [Documentation]    Configure BGP peer modules with initiate-connection set to false.
     ...    Configures 6 different peers, two internal, two external and two route-reflectors.
     FOR    ${index}    ${peer_type}    IN ZIP    ${NUMBERS}    ${PEER_TYPES}
-        &{mapping}    Create Dictionary    IP=127.0.0.${index}    HOLDTIME=${HOLDTIME}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+        &{mapping}    Create Dictionary
+        ...    IP=127.0.0.${index}
+        ...    HOLDTIME=${HOLDTIME}
+        ...    PASSIVE_MODE=true
+        ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
         ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-        TemplatedRequests.Put_As_Xml_Templated    ${POLICIES_VAR}${/}${peer_type}    mapping=${mapping}    session=${CONFIG_SESSION}
+        TemplatedRequests.Put_As_Xml_Templated
+        ...    ${POLICIES_VAR}${/}${peer_type}
+        ...    mapping=${mapping}
+        ...    session=${CONFIG_SESSION}
     END
 
 Start_Exabgps
@@ -79,22 +100,33 @@ Stop_All_Peers
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     FOR    ${index}    ${peer_type}    IN ZIP    ${NUMBERS}    ${PEER_TYPES}
-        &{mapping}    Create Dictionary    IP=127.0.0.${index}    HOLDTIME=${HOLDTIME}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
+        &{mapping}    Create Dictionary
+        ...    IP=127.0.0.${index}
+        ...    HOLDTIME=${HOLDTIME}
+        ...    PASSIVE_MODE=true
+        ...    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
         ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-        TemplatedRequests.Delete_Templated    ${POLICIES_VAR}/${peer_type}    mapping=${mapping}    session=${CONFIG_SESSION}
+        TemplatedRequests.Delete_Templated
+        ...    ${POLICIES_VAR}/${peer_type}
+        ...    mapping=${mapping}
+        ...    session=${CONFIG_SESSION}
     END
 
 Deconfigure_App_Peer
     [Documentation]    Revert the BGP configuration to the original state: without application peer
     &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
     TemplatedRequests.Delete_Templated    ${POLICIES_VAR}/app_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    TemplatedRequests.Delete_Templated    ${POLICIES_VAR}/app_peer_route    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${POLICIES_VAR}/app_peer_route
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Start_Suite
     [Documentation]    Suite setup keyword.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    ${conn_id}=    SSHLibrary.Open Connection    ${ODL_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=10s
+    ${conn_id}    SSHLibrary.Open Connection    ${ODL_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=10s
     Builtin.Set_Suite_Variable    ${conn_id}
     SSHKeywords.Flexible_Controller_Login
     SSHKeywords.Virtual_Env_Create    upgrade_pip=False
@@ -116,20 +148,38 @@ Verify_Rib_Status
     # gets and outputs full rib output for debug purposes if one of the peers reports faulty data.
     ${output}    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/rib_state    session=${CONFIG_SESSION}
     BuiltIn.Log    ${output}
-    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
+    ${AS_PATH}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
     FOR    ${index}    IN    @{NUMBERS}
         &{mapping}    BuiltIn.Create_Dictionary    IP=127.0.0.${index}    AS_PATH=${AS_PATH}
-        BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/effective_rib_in/peer_${index}    mapping=${mapping}
-        ...    session=${CONFIG_SESSION}    verify=True
+        BuiltIn.Wait_Until_Keyword_Succeeds
+        ...    5x
+        ...    3s
+        ...    TemplatedRequests.Get_As_Json_Templated
+        ...    ${POLICIES_VAR}/effective_rib_in/peer_${index}
+        ...    mapping=${mapping}
+        ...    session=${CONFIG_SESSION}
+        ...    verify=True
     END
     &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    AS_PATH=${AS_PATH}
     # application peer verification
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/app_peer_rib    mapping=${mapping}    session=${CONFIG_SESSION}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    5x
+    ...    3s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${POLICIES_VAR}/app_peer_rib
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 Verify_Rib_Status_Empty
     [Documentation]    Checks that example-ipv4-topology is ready, and therefore full rib is ready to be configured.
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/topology_state    session=${CONFIG_SESSION}    verify=True
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    60s
+    ...    3s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${POLICIES_VAR}/topology_state
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Upload_Config_Files
     [Documentation]    Uploads exabgp config files and replaces variables within those
@@ -137,11 +187,11 @@ Upload_Config_Files
     FOR    ${index}    IN    @{NUMBERS}
         SSHLibrary.Put_File    ${POLICIES_VAR}/exabgp_configs/exabgp${index}.cfg    .
     END
-    @{cfgfiles}=    SSHLibrary.List_Files_In_Directory    .    *.cfg
+    @{cfgfiles}    SSHLibrary.List_Files_In_Directory    .    *.cfg
     FOR    ${cfgfile}    IN    @{cfgfiles}
         SSHLibrary.Execute_Command    sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
         SSHLibrary.Execute_Command    sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
-        ${stdout}=    SSHLibrary.Execute_Command    cat ${cfgfile}
+        ${stdout}    SSHLibrary.Execute_Command    cat ${cfgfile}
         Log    ${stdout}
     END
index 379eccf77a357ea2a7c185909fb29d9560695444..2099ceee6e8535dba6aa410eb76322d2d87c9c66 100644 (file)
@@ -1,76 +1,86 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 BGP application peer
+Documentation       BGP performance of ingesting from 1 BGP application peer
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic BGP performance test cases for
-...               BGP application peer. BGP application peer introduces routes -
-...               using restconf - in two steps:
-...               1. introduces the ${PREFILL} number of routes in one POST request
-...               2. POSTs the rest of routes (up to the ${COUNT} number) one by one
-...               Test suite checks that the prefixes are propagated to
-...               IPv4 topology and announced to BGP peer via updates. Test case
-...               where the BGP peer is disconnected and reconnected and all routes
-...               are deleted by BGP application peer are performed as well.
-...               Brief description how to configure BGP application peer and
-...               how to use restconf application peer interface:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#application-peer-configuration
+...                 Test suite performs basic BGP performance test cases for
+...                 BGP application peer. BGP application peer introduces routes -
+...                 using restconf - in two steps:
+...                 1. introduces the ${PREFILL} number of routes in one POST request
+...                 2. POSTs the rest of routes (up to the ${COUNT} number) one by one
+...                 Test suite checks that the prefixes are propagated to
+...                 IPv4 topology and announced to BGP peer via updates. Test case
+...                 where the BGP peer is disconnected and reconnected and all routes
+...                 are deleted by BGP application peer are performed as well.
+...                 Brief description how to configure BGP application peer and
+...                 how to use restconf application peer interface:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#application-peer-configuration
 ...
-...               Reported bugs:
-...               Bug 4689 - Not a reasonable duration of 1M prefix introduction from BGP application peer via restconf
-...               Bug 4791 - BGPSessionImpl: Failed to send message Update logged even all UPDATE mesages received by iBGP peer
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Force Tags        critical
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 Reported bugs:
+...                 Bug 4689 - Not a reasonable duration of 1M prefix introduction from BGP application peer via restconf
+...                 Bug 4791 - BGPSessionImpl: Failed to send message Update logged even all UPDATE mesages received by iBGP peer
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
+Force Tags          critical
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${HOLDTIME}       180
-${HOLDTIME_APP_PEER_PREFIX_COUNT}    ${HOLDTIME}
-${COUNT}          180000
-${PREFILL}        100000
-${COUNT_APP_PEER_PREFIX_COUNT}    ${COUNT}
-${CHECK_PERIOD}    10
-${CHECK_PERIOD_APP_PEER_PREFIX_COUNT}    ${CHECK_PERIOD}
-${REPETITIONS_APP_PEER_PREFIX_COUNT}    1
-${BGP_PEER_LOG_LEVEL}    info
-${BGP_APP_PEER_LOG_LEVEL}    info
-${ODL_LOG_LEVEL}    INFO
-${ODL_BGP_LOG_LEVEL}    DEFAULT
-${BGP_PEER_COMMAND}    python3 play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
-${BGP_PEER_OPTIONS}    &>bgp_peer.log
-${BGP_APP_PEER_ID}    10.0.0.10
-${BGP_APP_PEER_INITIAL_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_PUT_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_DELETE_ALL_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_GET_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_OPTIONS}    &>bgp_app_peer.log
-${TEST_DURATION_MULTIPLIER}    30
-${last_prefix_count}    -1
-${DEVICE_NAME}    controller-config
-${BGP_PEER_NAME}    example-bgp-peer
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
+${BGP_VARIABLES_FOLDER}                     ${CURDIR}/../../../variables/bgpuser/
+${HOLDTIME}                                 180
+${HOLDTIME_APP_PEER_PREFIX_COUNT}           ${HOLDTIME}
+${COUNT}                                    180000
+${PREFILL}                                  100000
+${COUNT_APP_PEER_PREFIX_COUNT}              ${COUNT}
+${CHECK_PERIOD}                             10
+${CHECK_PERIOD_APP_PEER_PREFIX_COUNT}       ${CHECK_PERIOD}
+${REPETITIONS_APP_PEER_PREFIX_COUNT}        1
+${BGP_PEER_LOG_LEVEL}                       info
+${BGP_APP_PEER_LOG_LEVEL}                   info
+${ODL_LOG_LEVEL}                            INFO
+${ODL_BGP_LOG_LEVEL}                        DEFAULT
+${BGP_PEER_COMMAND}
+...                                         python3 play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
+${BGP_PEER_OPTIONS}                         &>bgp_peer.log
+${BGP_APP_PEER_ID}                          10.0.0.10
+${BGP_APP_PEER_INITIAL_COMMAND}
+...                                         python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_PUT_COMMAND}
+...                                         python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_ALL_COMMAND}
+...                                         python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_GET_COMMAND}
+...                                         python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_OPTIONS}                     &>bgp_app_peer.log
+${TEST_DURATION_MULTIPLIER}                 30
+${last_prefix_count}                        -1
+${DEVICE_NAME}                              controller-config
+${BGP_PEER_NAME}                            example-bgp-peer
+${RIB_INSTANCE}                             example-bgp-rib
+${PROTOCOL_OPENCONFIG}                      ${RIB_INSTANCE}
+
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Starting
@@ -79,13 +89,27 @@ Check_For_Empty_Ipv4_Topology_Before_Starting
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME_APP_PEER_PREFIX_COUNT}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME_APP_PEER_PREFIX_COUNT}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Reconfigure_ODL_To_Accept_BGP_Application_Peer
     [Documentation]    Configure BGP application peer module.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer-app    RIB_INSTANCE_NAME=${RIB_INSTANCE}    IP=${BGP_APP_PEER_ID}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer-app
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    IP=${BGP_APP_PEER_ID}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer    mapping=${mapping}
 
 Connect_BGP_Peer
@@ -103,29 +127,49 @@ BGP_Application_Peer_Prefill_Routes
 
 Wait_For_Ipv4_Topology_Is_Prefilled
     [Documentation]    Wait until example-ipv4-topology reaches the target prfix count.
-    BuiltIn.Wait Until Keyword Succeeds    ${bgp_filling_timeout}    10s    PrefixCounting.Check_Ipv4_Topology_Count    ${PREFILL}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    10s
+    ...    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${PREFILL}
 
 Check_Bgp_Peer_Updates_For_Prefilled_Routes
     [Documentation]    Count the routes introduced by updates.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-    ${count}    BuiltIn.Wait Until Keyword Succeeds    ${bgp_filling_timeout}    3s    Check_For_String_In_File    bgp_peer.log    total_received_nlri_prefix_counter: ${PREFILL}
+    ${count}    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    3s
+    ...    Check_For_String_In_File
+    ...    bgp_peer.log
+    ...    total_received_nlri_prefix_counter: ${PREFILL}
     BuiltIn.Log    ${count}
 
 BGP_Application_Peer_Introduce_Single_Routes
     [Documentation]    Start BGP application peer tool and introduce routes.
     SSHLibrary.Switch Connection    bgp_app_peer_console
-    BGPcliKeywords.Start_Console_Tool    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command add --count ${remaining_prefixes} --prefix 12.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM} ${script_uri_opt}    ${BGP_APP_PEER_OPTIONS}
+    BGPcliKeywords.Start_Console_Tool
+    ...    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command add --count ${remaining_prefixes} --prefix 12.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM} ${script_uri_opt}
+    ...    ${BGP_APP_PEER_OPTIONS}
     BGPcliKeywords.Wait_Until_Console_Tool_Finish    ${bgp_filling_timeout}
     BGPcliKeywords.Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_singles.log
 
 Wait_For_Ipv4_Topology_Is_Filled
     [Documentation]    Wait until example-ipv4-topology reaches the target prfix count.
-    BuiltIn.Wait Until Keyword Succeeds    ${bgp_filling_timeout}    10s    PrefixCounting.Check_Ipv4_Topology_Count    ${COUNT_APP_PEER_PREFIX_COUNT}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    10s
+    ...    PrefixCounting.Check_Ipv4_Topology_Count
+    ...    ${COUNT_APP_PEER_PREFIX_COUNT}
 
 Check_Bgp_Peer_Updates_For_All_Routes
     [Documentation]    Count the routes introduced by updates.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-    BuiltIn.Wait Until Keyword Succeeds    ${bgp_filling_timeout}    3s    Check_For_String_In_File    bgp_peer.log    total_received_nlri_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    3s
+    ...    Check_For_String_In_File
+    ...    bgp_peer.log
+    ...    total_received_nlri_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
 
 Disconnect_BGP_Peer
     [Documentation]    Stop BGP peer tool
@@ -142,18 +186,29 @@ Reconnect_BGP_Peer
 Check_Bgp_Peer_Updates_For_Reintroduced_Routes
     [Documentation]    Count the routes introduced by updates.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-    BuiltIn.Wait Until Keyword Succeeds    ${bgp_filling_timeout}    3s    Check_For_String_In_File    bgp_peer.log    total_received_nlri_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    3s
+    ...    Check_For_String_In_File
+    ...    bgp_peer.log
+    ...    total_received_nlri_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
 
 BGP_Application_Peer_Delete_All_Routes
     [Documentation]    Start BGP application peer tool and delete all routes.
     SSHLibrary.Switch Connection    bgp_app_peer_console
-    BGPcliKeywords.Start_Console_Tool    ${BGP_APP_PEER_DELETE_ALL_COMMAND} --stream=${ODL_STREAM} ${script_uri_opt}    ${BGP_APP_PEER_OPTIONS}
+    BGPcliKeywords.Start_Console_Tool
+    ...    ${BGP_APP_PEER_DELETE_ALL_COMMAND} --stream=${ODL_STREAM} ${script_uri_opt}
+    ...    ${BGP_APP_PEER_OPTIONS}
     BGPcliKeywords.Wait_Until_Console_Tool_Finish    ${bgp_emptying_timeout}
     BGPcliKeywords.Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_delete_all.log
 
 Wait_For_Stable_Topology_After_Deletion
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_APP_PEER_PREFIX_COUNT}    repetitions=${REPETITIONS_APP_PEER_PREFIX_COUNT}    excluded_count=${COUNT_APP_PEER_PREFIX_COUNT}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_emptying_timeout}
+    ...    period=${CHECK_PERIOD_APP_PEER_PREFIX_COUNT}
+    ...    repetitions=${REPETITIONS_APP_PEER_PREFIX_COUNT}
+    ...    excluded_count=${COUNT_APP_PEER_PREFIX_COUNT}
 
 Check_For_Empty_Ipv4_Topology_After_Deleting
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -162,7 +217,12 @@ Check_For_Empty_Ipv4_Topology_After_Deleting
 Check_Bgp_Peer_Updates_For_Prefix_Withdrawals
     [Documentation]    Count the routes withdrawn by updates.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-    BuiltIn.Wait Until Keyword Succeeds    ${bgp_emptying_timeout}    3s    Check_For_String_In_File    bgp_peer.log    total_received_withdrawn_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
+    BuiltIn.Wait Until Keyword Succeeds
+    ...    ${bgp_emptying_timeout}
+    ...    3s
+    ...    Check_For_String_In_File
+    ...    bgp_peer.log
+    ...    total_received_withdrawn_prefix_counter: ${COUNT_APP_PEER_PREFIX_COUNT}
 
 Stop_BGP_Peer
     [Documentation]    Stop BGP peer tool
@@ -172,14 +232,23 @@ Stop_BGP_Peer
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Delete_Bgp_Application_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer-app    IP=${BGP_APP_PEER_ID}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer-app
+    ...    IP=${BGP_APP_PEER_ID}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer    mapping=${mapping}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to tools system,
@@ -188,7 +257,12 @@ Setup_Everything
     TemplatedRequests.Create_Default_Session
     PrefixCounting.PC_Setup
     SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -201,15 +275,18 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/ipv4-routes-template.xml*
     # Calculate the timeout value based on how many routes are going to be pushed.
     # The offset (20) is set for keeping reasonable timeout for low COUNT values.
-    ${timeout}    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER} * ${COUNT_APP_PEER_PREFIX_COUNT} * 3.0 / 10000 + 20
+    ${timeout}    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER} * ${COUNT_APP_PEER_PREFIX_COUNT} * 3.0 / 10000 + 20
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
     Builtin.Set_Suite_Variable    ${bgp_emptying_timeout}    ${bgp_filling_timeout*3.0/4}
-    ${result}    BuiltIn.Evaluate    str(int(${COUNT_APP_PEER_PREFIX_COUNT}) - int(${PREFILL}))
+    ${result}    BuiltIn.Evaluate    str(int(${COUNT_APP_PEER_PREFIX_COUNT}) - int(${PREFILL}))
     Builtin.Set_Suite_Variable    ${remaining_prefixes}    ${result}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_LOG_LEVEL}
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
-    ${script_uri_opt}=    Set Variable    --uri data/bgp-rib:application-rib=${BGP_APP_PEER_ID}/tables=bgp-types%3Aipv4-address-family,bgp-types%3Aunicast-subsequent-address-family
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
+    ${script_uri_opt}    Set Variable
+    ...    --uri data/bgp-rib:application-rib=${BGP_APP_PEER_ID}/tables=bgp-types%3Aipv4-address-family,bgp-types%3Aunicast-subsequent-address-family
     BuiltIn.Set_Suite_Variable    ${script_uri_opt}
 
 Teardown_Everything
@@ -232,8 +309,8 @@ Open_BGP_Aplicationp_Peer_Console
     SSHKeywords.Flexible_Mininet_Login
 
 Check_For_String_In_File
-    [Arguments]    ${file_name}    ${string}    ${threshold}=2
     [Documentation]    Check file for ${string} and returns number of occurences
-    ${matches} =    SSHLibrary.Execute_Command    grep -c '${string}' '${file_name}'
-    ${count} =    Convert To Integer    ${matches}
+    [Arguments]    ${file_name}    ${string}    ${threshold}=2
+    ${matches}    SSHLibrary.Execute_Command    grep -c '${string}' '${file_name}'
+    ${count}    Convert To Integer    ${matches}
     BuiltIn.Should_Be_True    ${count} >= ${threshold}
index 8bc7cb519173ba33d65d3630dc9139274bf0754a..0f1743fe4e0ac05c1e601d32526be510024fa8da 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from many iBGP peers, data change counter is used.
+Documentation       BGP performance of ingesting from many iBGP peers, data change counter is used.
 ...
-...               Copyright (c) 2018 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2018 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
 ...
-...               This suite uses play.py processes as iBGP peers.
-...               This is analogue of single peer performance suite, which uses many peers.
-...               Each peer is of ibgp type, and they contribute to the same example-bgp-rib,
-...               and thus to the same single example-ipv4-topology.
-...               The suite only looks at example-ipv4-topology, so RIB is not examined.
+...                 This suite uses play.py processes as iBGP peers.
+...                 This is analogue of single peer performance suite, which uses many peers.
+...                 Each peer is of ibgp type, and they contribute to the same example-bgp-rib,
+...                 and thus to the same single example-ipv4-topology.
+...                 The suite only looks at example-ipv4-topology, so RIB is not examined.
 ...
-...               This suite requires odl-bgpcep-data-change-counter to be installed so
-...               make sure it is added to "install-features" of any jobs that are going to invoke it.
-...               Use the other version of the suite (manypeers_prefixcount.robot) if the feature does not work.
+...                 This suite requires odl-bgpcep-data-change-counter to be installed so
+...                 make sure it is added to "install-features" of any jobs that are going to invoke it.
+...                 Use the other version of the suite (manypeers_prefixcount.robot) if the feature does not work.
 ...
-...               The suite consists of two halves, differing on which side initiates BGP connection.
-...               Data change counter is a lightweight way to detect "work is being done".
-...               WaitUtils provide a nice Keyword to wait for stability, but it needs
-...               initial value, that is why Store_Change_Count appears just before work-inducing action.
-...               The time for Wait_For_Stable_* cases to finish is the main performance metric.
-...               After waiting for stability is done, full check on number of prefixes present is performed.
+...                 The suite consists of two halves, differing on which side initiates BGP connection.
+...                 Data change counter is a lightweight way to detect "work is being done".
+...                 WaitUtils provide a nice Keyword to wait for stability, but it needs
+...                 initial value, that is why Store_Change_Count appears just before work-inducing action.
+...                 The time for Wait_For_Stable_* cases to finish is the main performance metric.
+...                 After waiting for stability is done, full check on number of prefixes present is performed.
 ...
-...               TODO: Currently, if a bug causes zero increase of data changes,
-...               affected test cases will wait for max time. Reconsider.
-...               If zero increase is allowed as stable, higher number of repetitions should be required.
+...                 TODO: Currently, if a bug causes zero increase of data changes,
+...                 affected test cases will wait for max time. Reconsider.
+...                 If zero increase is allowed as stable, higher number of repetitions should be required.
 ...
-...               ODL distinguishes peers by their IP addresses.
-...               Currently, this suite requires python utils to be started on ODL System,
-...               to guarantee IP address block is available for them to bind to.
-...               TODO: Figure out how to use Docker and docker IP pool available in RelEng.
+...                 ODL distinguishes peers by their IP addresses.
+...                 Currently, this suite requires python utils to be started on ODL System,
+...                 to guarantee IP address block is available for them to bind to.
+...                 TODO: Figure out how to use Docker and docker IP pool available in RelEng.
 ...
-...               Currently, 127.0.0.1 is hardcoded as the first peer address to use.
-...               TODO: Figure out how to make it configurable.
-...               As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
+...                 Currently, 127.0.0.1 is hardcoded as the first peer address to use.
+...                 TODO: Figure out how to make it configurable.
+...                 As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
 ...
-...               Brief description how to configure BGP peer can be found here:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+...                 Brief description how to configure BGP peer can be found here:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
 ...
-...               TODO: Is there a need for version of this suite where ODL connects to pers?
-...               Note that configuring ODL is slow, which may affect measured performance singificantly.
-...               Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           DateTime
-Library           RequestsLibrary
-Library           SSHLibrary    timeout=10s
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ChangeCounter.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 TODO: Is there a need for version of this suite where ODL connects to pers?
+...                 Note that configuring ODL is slow, which may affect measured performance singificantly.
+...                 Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
+
+Library             DateTime
+Library             RequestsLibrary
+Library             SSHLibrary    timeout=10s
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ChangeCounter.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD}    60
-${CHECK_PERIOD_CHANGE_COUNT}    ${CHECK_PERIOD}
-${CHECK_PERIOD_CHANGE_COUNT_MANY}    ${CHECK_PERIOD_CHANGE_COUNT}
-${COUNT}          600000
-${COUNT_CHANGE_COUNT}    ${COUNT}
-${COUNT_CHANGE_COUNT_MANY}    ${COUNT_CHANGE_COUNT}
-${FIRST_PEER_IP}    127.0.0.1
-${HOLDTIME}       180
-${HOLDTIME_CHANGE_COUNT}    ${HOLDTIME}
-${HOLDTIME_CHANGE_COUNT_MANY}    ${HOLDTIME_CHANGE_COUNT}
-${KARAF_LOG_LEVEL}    INFO
-${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
-${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
-${MULTIPLICITY}    2    # May be increased after Bug 4488 is fixed.
-${MULTIPLICITY_CHANGE_COUNT}    ${MULTIPLICITY}
-${MULTIPLICITY_CHANGE_COUNT_MANY}    ${MULTIPLICITY_CHANGE_COUNT}
-${PEER_GROUP}     internal-neighbors
-${REPETITIONS}    1    # Should be increased depending on multiplicity.
-${REPETITIONS_CHANGE_COUNT}    ${REPETITIONS}
-${REPETITIONS_CHANGE_COUNT_MANY}    ${REPETITIONS_CHANGE_COUNT}
-${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}    ${TEST_DURATION_MULTIPLIER}
-${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY}    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
+${BGP_TOOL_LOG_LEVEL}                               info
+${BGP_VARIABLES_FOLDER}                             ${CURDIR}/../../../variables/bgpuser/
+${CHECK_PERIOD}                                     60
+${CHECK_PERIOD_CHANGE_COUNT}                        ${CHECK_PERIOD}
+${CHECK_PERIOD_CHANGE_COUNT_MANY}                   ${CHECK_PERIOD_CHANGE_COUNT}
+${COUNT}                                            600000
+${COUNT_CHANGE_COUNT}                               ${COUNT}
+${COUNT_CHANGE_COUNT_MANY}                          ${COUNT_CHANGE_COUNT}
+${FIRST_PEER_IP}                                    127.0.0.1
+${HOLDTIME}                                         180
+${HOLDTIME_CHANGE_COUNT}                            ${HOLDTIME}
+${HOLDTIME_CHANGE_COUNT_MANY}                       ${HOLDTIME_CHANGE_COUNT}
+${KARAF_LOG_LEVEL}                                  INFO
+${KARAF_BGPCEP_LOG_LEVEL}                           ${KARAF_LOG_LEVEL}
+${KARAF_PROTOCOL_LOG_LEVEL}                         ${KARAF_BGPCEP_LOG_LEVEL}
+${MULTIPLICITY}                                     2    # May be increased after Bug 4488 is fixed.
+${MULTIPLICITY_CHANGE_COUNT}                        ${MULTIPLICITY}
+${MULTIPLICITY_CHANGE_COUNT_MANY}                   ${MULTIPLICITY_CHANGE_COUNT}
+${PEER_GROUP}                                       internal-neighbors
+${REPETITIONS}                                      1    # Should be increased depending on multiplicity.
+${REPETITIONS_CHANGE_COUNT}                         ${REPETITIONS}
+${REPETITIONS_CHANGE_COUNT_MANY}                    ${REPETITIONS_CHANGE_COUNT}
+${TEST_DURATION_MULTIPLIER}                         1
+${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}            ${TEST_DURATION_MULTIPLIER}
+${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY}       ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
+${RIB_INSTANCE}                                     example-bgp-rib
+${PROTOCOL_OPENCONFIG}                              ${RIB_INSTANCE}
+${DEVICE_NAME}                                      controller-config
 # TODO: Option names can be better.
-${last_change_count_many}    1
+${last_change_count_many}                           1
+
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
@@ -112,9 +116,19 @@ Reconfigure_ODL_To_Accept_Connections
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_CHANGE_COUNT_MANY}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${peer_name}    IP=${peer_ip}    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}
-        ...    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-        ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
+        &{mapping} =    Create Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    BGP_NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}
+        ...    PEER_PORT=${BGP_TOOL_PORT}
+        ...    INITIATE=false
+        ...    BGP_RIB=${RIB_INSTANCE}
+        ...    PASSIVE_MODE=true
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+        ...    PEER_GROUP_NAME=${PEER_GROUP}
+        ...    RR_CLIENT=false
         TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}
         # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready.
     END
@@ -129,17 +143,24 @@ Verify_For_Data_Change_Counter_Ready
 
 Change_Karaf_Logging_Levels
     [Documentation]    We may want to set more verbose logging here after configuration is done.
-    KarafKeywords.Set_Bgpcep_Log_Levels    bgpcep_level=${KARAF_BGPCEP_LOG_LEVEL}    protocol_level=${KARAF_PROTOCOL_LOG_LEVEL}
+    KarafKeywords.Set_Bgpcep_Log_Levels
+    ...    bgpcep_level=${KARAF_BGPCEP_LOG_LEVEL}
+    ...    protocol_level=${KARAF_PROTOCOL_LOG_LEVEL}
 
 Start_Talking_BGP_Manager
     [Documentation]    Start Python manager to connect speakers to ODL.
     Store_Change_Count
     # Myport value is needed for checking whether connection at precise port was established.
-    BGPSpeaker.Start_BGP_Manager    --amount=${COUNT_CHANGE_COUNT_MANY} --multiplicity=${MULTIPLICITY_CHANGE_COUNT_MANY} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT}
+    BGPSpeaker.Start_BGP_Manager
+    ...    --amount=${COUNT_CHANGE_COUNT_MANY} --multiplicity=${MULTIPLICITY_CHANGE_COUNT_MANY} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT}
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable. This is done by checking stability of the change counter.
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_MANY}    repetitions=${REPETITIONS_CHANGE_COUNT_MANY}    count_to_overcome=${last_change_count_many}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_MANY}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_MANY}
+    ...    count_to_overcome=${last_change_count_many}
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -160,7 +181,11 @@ Kill_Talking_BGP_Speakers
 Wait_For_Stable_Ipv4_Topology_After_Talking
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
     [Tags]    critical
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_MANY}    repetitions=${REPETITIONS_CHANGE_COUNT_MANY}    count_to_overcome=${last_change_count_many}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_MANY}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_MANY}
+    ...    count_to_overcome=${last_change_count_many}
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -184,12 +209,18 @@ Delete_Bgp_Peer_Configuration
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_CHANGE_COUNT_MANY}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${peer_name}    IP=${peer_ip}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-        ...    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
+        &{mapping} =    BuiltIn.Create_Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    BGP_NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        ...    PEER_GROUP_NAME=${PEER_GROUP}
+        ...    RR_CLIENT=false
         TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}
     END
     Deconfigure_Peer_Group
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to ODL system,
@@ -199,7 +230,12 @@ Setup_Everything
     ChangeCounter.CC_Setup
     PrefixCounting.PC_Setup
     KarafKeywords.Open Controller Karaf Console On Background
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -211,9 +247,11 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     # Calculate the timeout value based on how many routes are going to be pushed
     ${period} =    DateTime.Convert_Time    ${CHECK_PERIOD_CHANGE_COUNT_MANY}    result_format=number
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY} * (${COUNT_CHANGE_COUNT_MANY} * 3.0 / 10000 + ${period} * (${REPETITIONS_CHANGE_COUNT_MANY} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY} * (${COUNT_CHANGE_COUNT_MANY} * 3.0 / 10000 + ${period} * (${REPETITIONS_CHANGE_COUNT_MANY} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY} * (${COUNT_CHANGE_COUNT_MANY} * 2.0 / 10000 + ${period} * (${REPETITIONS_CHANGE_COUNT_MANY} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY} * (${COUNT_CHANGE_COUNT_MANY} * 2.0 / 10000 + ${period} * (${REPETITIONS_CHANGE_COUNT_MANY} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_emptying_timeout}    ${timeout}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${KARAF_LOG_LEVEL}
 
@@ -228,21 +266,49 @@ Teardown_Everything
 Store_Change_Count
     [Documentation]    Get the count of changes from BGP change counter. Ignore error or store the value.
     ${status}    ${count} =    BuiltIn.Run_Keyword_And_Ignore_Error    ChangeCounter.Get_Change_Count
-    BuiltIn.Run_Keyword_If    '${status}' == 'PASS'    BuiltIn.Set_Suite_Variable    ${last_change_count_many}    ${count}
+    IF    '${status}' == 'PASS'
+        BuiltIn.Set_Suite_Variable    ${last_change_count_many}    ${count}
+    END
 
 Configure_Peer_Group
     [Documentation]    Configures peer group which is template for all the neighbors which are going
     ...    to be configured. Also after PUT, this case verifies presence of peer group within
     ...    peer-groups.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
-    ${verify_peer_group_folder}    CompareStream.Run_Keyword_If_At_Least_Else    sulfur    BuiltIn.Set Variable    verify_peer_group.sulfur
-    ...    ELSE    BuiltIn.Set Variable    verify_peer_group
+    &{mapping} =    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    PEER_GROUP_NAME=${PEER_GROUP}
+    ...    RR_CLIENT=false
+    ${verify_peer_group_folder} =    CompareStream.Run_Keyword_If_At_Least_Else
+    ...    sulfur
+    ...    BuiltIn.Set Variable
+    ...    verify_peer_group.sulfur
+    ...    ELSE
+    ...    BuiltIn.Set Variable
+    ...    verify_peer_group
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}peer_group    mapping=${mapping}
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}${verify_peer_group_folder}    mapping=${mapping}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${verify_peer_group_folder}
+    ...    mapping=${mapping}
+    ...    verify=True
 
 Deconfigure_Peer_Group
     [Documentation]    Deconfigures peer group which is template for all the neighbors.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
+    &{mapping} =    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    PEER_GROUP_NAME=${PEER_GROUP}
+    ...    RR_CLIENT=false
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}peer_group    mapping=${mapping}
index 3800e9b4fe3828a4e5f2c902511ebb1d02e380c2..22dc8629f0032d51074dd9f481ac0baefc3785df 100644 (file)
@@ -1,63 +1,69 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from many iBGP rrc peers, iBGPs receive updates.
+Documentation       BGP performance of ingesting from many iBGP rrc peers, iBGPs receive updates.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               This suite uses play.py processes as iBGP rrc peers.
-...               This is analogue of single peer performance suite, which uses many peers.
-...               Each peer is of ibgp rrc type, and they contribute to the same example-bgp-rib,
-...               and thus to the same single example-ipv4-topology.
-...               The suite looks at example-ipv4-topology and checks BGP peers log for received updates.
+...                 This suite uses play.py processes as iBGP rrc peers.
+...                 This is analogue of single peer performance suite, which uses many peers.
+...                 Each peer is of ibgp rrc type, and they contribute to the same example-bgp-rib,
+...                 and thus to the same single example-ipv4-topology.
+...                 The suite looks at example-ipv4-topology and checks BGP peers log for received updates.
 ...
-...               ODL distinguishes peers by their IP addresses.
-...               Currently, this suite requires python utils to be started on ODL System,
-...               to guarantee IP address block is available for them to bind to.
+...                 ODL distinguishes peers by their IP addresses.
+...                 Currently, this suite requires python utils to be started on ODL System,
+...                 to guarantee IP address block is available for them to bind to.
 ...
-...               Brief description how to configure BGP peer can be found here:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           DateTime
-Library           RequestsLibrary
-Library           SSHLibrary    timeout=10s
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 Brief description how to configure BGP peer can be found here:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+
+Library             DateTime
+Library             RequestsLibrary
+Library             SSHLibrary    timeout=10s
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_PEERS_LOG_FILE_NAME}    bgp_peer.log
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    60
-${COUNT}          300000    # With AdjRibsOut, the amount of data present is on the same scale as 600k ingest with single peer.
-${COUNT_PREFIX_COUNT_MANY_RRC}    ${COUNT}
-${FIRST_PEER_IP}    127.0.0.1
-${HOLDTIME}       180
-${HOLDTIME_PREFIX_COUNT_MANY_RRC}    ${HOLDTIME}
-${KARAF_LOG_LEVEL}    INFO
-${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
-${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
-${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}    2
-${REPETITIONS_PREFIX_COUNT_MANY_RRC}    2
-${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC}    ${TEST_DURATION_MULTIPLIER}
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
+${BGP_TOOL_LOG_LEVEL}                                   info
+${BGP_PEERS_LOG_FILE_NAME}                              bgp_peer.log
+${BGP_VARIABLES_FOLDER}                                 ${CURDIR}/../../../variables/bgpuser/
+${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}                   60
+# With AdjRibsOut, the amount of data present is on the same scale as 600k ingest with single peer.
+${COUNT}
+...                                                     300000
+${COUNT_PREFIX_COUNT_MANY_RRC}                          ${COUNT}
+${FIRST_PEER_IP}                                        127.0.0.1
+${HOLDTIME}                                             180
+${HOLDTIME_PREFIX_COUNT_MANY_RRC}                       ${HOLDTIME}
+${KARAF_LOG_LEVEL}                                      INFO
+${KARAF_BGPCEP_LOG_LEVEL}                               ${KARAF_LOG_LEVEL}
+${KARAF_PROTOCOL_LOG_LEVEL}                             ${KARAF_BGPCEP_LOG_LEVEL}
+${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}                   2
+${REPETITIONS_PREFIX_COUNT_MANY_RRC}                    2
+${TEST_DURATION_MULTIPLIER}                             1
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC}       ${TEST_DURATION_MULTIPLIER}
+${RIB_INSTANCE}                                         example-bgp-rib
+${PROTOCOL_OPENCONFIG}                                  ${RIB_INSTANCE}
+${DEVICE_NAME}                                          controller-config
+
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
@@ -72,15 +78,26 @@ Reconfigure_ODL_To_Accept_Connections
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=${peer_name}    IP=${peer_ip}    HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY_RRC}
-        ...    PEER_PORT=${BGP_TOOL_PORT}    PEER_ROLE=rr-client    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true
-        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    RR_CLIENT=true
+        &{mapping} =    BuiltIn.Create_Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY_RRC}
+        ...    PEER_PORT=${BGP_TOOL_PORT}
+        ...    PEER_ROLE=rr-client
+        ...    INITIATE=false
+        ...    BGP_RIB=${RIB_INSTANCE}
+        ...    PASSIVE_MODE=true
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+        ...    RR_CLIENT=true
         TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}
     END
 
 Start_Talking_BGP_Manager
     [Documentation]    Start Python manager to connect speakers to ODL.
-    BGPSpeaker.Start_BGP_Manager    --amount=${COUNT_PREFIX_COUNT_MANY_RRC} --multiplicity=${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --logfile=${BGP_PEERS_LOG_FILE_NAME} --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Manager
+    ...    --amount=${COUNT_PREFIX_COUNT_MANY_RRC} --multiplicity=${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --logfile=${BGP_PEERS_LOG_FILE_NAME} --${BGP_TOOL_LOG_LEVEL}
 
 Wait_For_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology reaches the target prefix count.
@@ -88,7 +105,10 @@ Wait_For_Ipv4_Topology
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     BuiltIn.Log    max. ${bgp_filling_timeout}s    console=yes
     Init_Check_Ipv4_Topology_Keyword    ${COUNT_PREFIX_COUNT_MANY_RRC}    ${REPETITIONS_PREFIX_COUNT_MANY_RRC}
-    ${message}=    BuiltIn.Wait_Until_Keyword_Succeeds    ${bgp_filling_timeout}    ${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    Check_Ipv4_Topology
+    ${message} =    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${bgp_filling_timeout}
+    ...    ${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}
+    ...    Check_Ipv4_Topology
     BuiltIn.Should_Be_Equal_As_Strings    ${message}    Target value reached.
 
 Check_Logs_For_Updates
@@ -97,10 +117,17 @@ Check_Logs_For_Updates
     ${timeout} =    BuiltIn.Set_Variable    ${bgp_filling_timeout}
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1
         ${bgp_peer_label} =    BuiltIn.Set_Variable    BGP-Dummy-${index}
-        ${expected_prefixcount} =    BuiltIn.Evaluate    ${COUNT_PREFIX_COUNT_MANY_RRC} - ${COUNT_PREFIX_COUNT_MANY_RRC} // ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}
+        ${expected_prefixcount} =    BuiltIn.Evaluate
+        ...    ${COUNT_PREFIX_COUNT_MANY_RRC} - ${COUNT_PREFIX_COUNT_MANY_RRC} // ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}
         ${expected_string} =    BuiltIn.Set_Variable    total_received_nlri_prefix_counter: ${expected_prefixcount}
-        BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    1s    Check_File_For_Occurence    ${BGP_PEERS_LOG_FILE_NAME}    ${bgp_peer_label}
-        ...    ${expected_string}    2
+        BuiltIn.Wait_Until_Keyword_Succeeds
+        ...    ${timeout}
+        ...    1s
+        ...    Check_File_For_Occurence
+        ...    ${BGP_PEERS_LOG_FILE_NAME}
+        ...    ${bgp_peer_label}
+        ...    ${expected_string}
+        ...    2
         ${timeout} =    BuiltIn.Set_Variable    20s
         # FIXME: Calculation of ${expected_prefixcount} correct just when the ${COUNT_PREFIX_COUNT_MANY_RRC} is a multiplication of ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}
     END
@@ -118,7 +145,11 @@ Wait_For_Stable_Ipv4_Topology_After_Talking
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
     [Tags]    critical
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    repetitions=${REPETITIONS_PREFIX_COUNT_MANY_RRC}    excluded_count=${COUNT_PREFIX_COUNT_MANY_RRC}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_emptying_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_MANY_RRC}
+    ...    excluded_count=${COUNT_PREFIX_COUNT_MANY_RRC}
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -133,10 +164,15 @@ Delete_Bgp_Peer_Configuration
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=${peer_name}    IP=${peer_ip}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        &{mapping} =    BuiltIn.Create_Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
         TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}
     END
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to ODL system,
@@ -144,7 +180,12 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     TemplatedRequests.Create_Default_Session
     PrefixCounting.PC_Setup
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -156,9 +197,11 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     # Calculate the timeout value based on how many routes are going to be pushed.
     ${period} =    DateTime.Convert_Time    ${CHECK_PERIOD_PREFIX_COUNT_MANY_RRC}    result_format=number
-    ${timeout} =    BuiltIn.Evaluate    ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} * ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC} * (${COUNT_PREFIX_COUNT_MANY_RRC} * 6.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY_RRC} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} * ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC} * (${COUNT_PREFIX_COUNT_MANY_RRC} * 6.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY_RRC} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC} * (${COUNT_PREFIX_COUNT_MANY_RRC} * 2.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY_RRC} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC} * (${COUNT_PREFIX_COUNT_MANY_RRC} * 2.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY_RRC} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_emptying_timeout}    ${timeout}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${KARAF_LOG_LEVEL}
 
@@ -171,9 +214,9 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Init_Check_Ipv4_Topology_Keyword
-    [Arguments]    ${expected_count}=0    ${deadlock_cycles}=-1
     [Documentation]    Initialise test variables for Check_Ipv4_Topology keyword.
-    ${deadlock_cycles}=    Convert To Integer    ${deadlock_cycles}
+    [Arguments]    ${expected_count}=0    ${deadlock_cycles}=-1
+    ${deadlock_cycles} =    Convert To Integer    ${deadlock_cycles}
     BuiltIn.Set_Test_Variable    ${deadlock_cycles}
     BuiltIn.Set_Test_Variable    ${ipv4_topology_deadlock_countdown}    ${deadlock_cycles}
     BuiltIn.Set_Test_Variable    ${expected_count}
@@ -182,19 +225,26 @@ Init_Check_Ipv4_Topology_Keyword
 Check_Ipv4_Topology
     [Documentation]    Check and log the IPv4 topology count. PASS if ${expected_count} or ${actual_count} not changed for ${deadlock_cycles} keyword calls.
     ${actual_count} =    PrefixCounting.Get_Ipv4_Topology_Count
-    ${ipv4_topology_deadlock_countdown}=    BuiltIn.Set_Variable_If    (${actual_count} == ${ipv4_topology_last_count}) and (${ipv4_topology_deadlock_countdown} >= 0)    ${ipv4_topology_deadlock_countdown - 1}    ${deadlock_cycles}
+    ${ipv4_topology_deadlock_countdown} =    BuiltIn.Set_Variable_If
+    ...    (${actual_count} == ${ipv4_topology_last_count}) and (${ipv4_topology_deadlock_countdown} >= 0)
+    ...    ${ipv4_topology_deadlock_countdown - 1}
+    ...    ${deadlock_cycles}
     ${hour}    ${min}    ${sec} =    BuiltIn.Get_Time    hour min sec
     BuiltIn.Set_Test_Variable    ${ipv4_topology_deadlock_countdown}
     BuiltIn.Set_Test_Variable    ${ipv4_topology_last_count}    ${actual_count}
-    BuiltIn.Log    ${hour}:${min}:${sec} actual/expected prefix count is ${actual_count}/${expected_count} (countdown:${ipv4_topology_deadlock_countdown})    console=yes
-    BuiltIn.Return_From_Keyword_If    ${ipv4_topology_deadlock_countdown} == 0    Deadlock detected (ipv4-topology not changed for ${deadlock_cycles} cycles)
+    BuiltIn.Log
+    ...    ${hour}:${min}:${sec} actual/expected prefix count is ${actual_count}/${expected_count} (countdown:${ipv4_topology_deadlock_countdown})
+    ...    console=yes
+    IF    ${ipv4_topology_deadlock_countdown} == 0
+        RETURN    Deadlock detected (ipv4-topology not changed for ${deadlock_cycles} cycles)
+    END
     BuiltIn.Should_Be_Equal_As_Integers    ${actual_count}    ${expected_count}
-    [Return]    Target value reached.
+    RETURN    Target value reached.
 
 Check_File_For_Occurence
-    [Arguments]    ${file_name}    ${keyword}    ${value}=''    ${threshold}=1
     [Documentation]    Check file for ${keyword} or ${keyword} ${value} pair and returns number of occurences
-    ${output_log}=    SSHLibrary.Execute_Command    grep '${keyword}' '${file_name}' | grep -c '${value}'
-    ${count}=    Convert To Integer    ${output_log}
+    [Arguments]    ${file_name}    ${keyword}    ${value}=''    ${threshold}=1
+    ${output_log} =    SSHLibrary.Execute_Command    grep '${keyword}' '${file_name}' | grep -c '${value}'
+    ${count} =    Convert To Integer    ${output_log}
     BuiltIn.Should_Be_True    ${count} >= ${threshold}
-    [Return]    ${count}
+    RETURN    ${count}
index 996c67d0895e62e7a3486b575e698a2a5ec06d83..ba0e57745c02c82da8ca3616c55e39a0d8018b67 100644 (file)
 *** Settings ***
-Documentation     BGP performance of ingesting from many iBGP peers, data change counter NOT used.
+Documentation       BGP performance of ingesting from many iBGP peers, data change counter NOT used.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
 ...
-...               This suite uses play.py processes as iBGP peers.
-...               This is analogue of single peer performance suite, which uses many peers.
-...               Each peer is of ibgp type, and they contribute to the same example-bgp-rib,
-...               and thus to the same single example-ipv4-topology.
-...               The suite only looks at example-ipv4-topology, so RIB is not examined.
+...                 This suite uses play.py processes as iBGP peers.
+...                 This is analogue of single peer performance suite, which uses many peers.
+...                 Each peer is of ibgp type, and they contribute to the same example-bgp-rib,
+...                 and thus to the same single example-ipv4-topology.
+...                 The suite only looks at example-ipv4-topology, so RIB is not examined.
 ...
-...               The suite consists of two halves, differing on which side initiates BGP connection.
-...               State of "work is being done" is detected by increasing value of prefixes in topology.
-...               The time for Wait_For_Stable_* cases to finish is the main performance metric.
-...               After waiting for stability is done, full check on number of prefixes present is performed.
+...                 The suite consists of two halves, differing on which side initiates BGP connection.
+...                 State of "work is being done" is detected by increasing value of prefixes in topology.
+...                 The time for Wait_For_Stable_* cases to finish is the main performance metric.
+...                 After waiting for stability is done, full check on number of prefixes present is performed.
 ...
-...               TODO: Currently, if a bug causes prefix count to remain at zero,
-...               affected test cases will wait for max time. Reconsider.
-...               If zero is allowed as stable, higher period or repetitions would be required.
+...                 TODO: Currently, if a bug causes prefix count to remain at zero,
+...                 affected test cases will wait for max time. Reconsider.
+...                 If zero is allowed as stable, higher period or repetitions would be required.
 ...
-...               The prefix counting is quite heavyweight and may induce large variation in time.
-...               Try the other version of the suite (manypeers_changecount.robot) to get better precision.
+...                 The prefix counting is quite heavyweight and may induce large variation in time.
+...                 Try the other version of the suite (manypeers_changecount.robot) to get better precision.
 ...
-...               ODL distinguishes peers by their IP addresses.
-...               Currently, this suite requires python utils to be started on ODL System,
-...               to guarantee IP address block is available for them to bind to.
-...               TODO: Figure out how to use Docker and docker IP pool available in RelEng.
+...                 ODL distinguishes peers by their IP addresses.
+...                 Currently, this suite requires python utils to be started on ODL System,
+...                 to guarantee IP address block is available for them to bind to.
+...                 TODO: Figure out how to use Docker and docker IP pool available in RelEng.
 ...
-...               Currently, 127.0.0.1 is hardcoded as the first peer address to use.
-...               TODO: Figure out how to make it configurable.
-...               As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
+...                 Currently, 127.0.0.1 is hardcoded as the first peer address to use.
+...                 TODO: Figure out how to make it configurable.
+...                 As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
 ...
-...               Brief description how to configure BGP peer can be found here:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+...                 Brief description how to configure BGP peer can be found here:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
 ...
-...               TODO: Is there a need for version of this suite where ODL connects to pers?
-...               Note that configuring ODL is slow, which may affect measured performance singificantly.
-...               Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           DateTime
-Library           RequestsLibrary
-Library           SSHLibrary    timeout=10s
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 TODO: Is there a need for version of this suite where ODL connects to pers?
+...                 Note that configuring ODL is slow, which may affect measured performance singificantly.
+...                 Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
+
+Library             DateTime
+Library             RequestsLibrary
+Library             SSHLibrary    timeout=10s
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD}    60    # ${MULTIPLICITY*2} recommended for this suite, but keeping the common default.
-${CHECK_PERIOD_PREFIX_COUNT}    ${CHECK_PERIOD}
-${CHECK_PERIOD_PREFIX_COUNT_MANY}    ${CHECK_PERIOD_PREFIX_COUNT}
-${COUNT}          600000
-${COUNT_PREFIX_COUNT}    ${COUNT}
-${COUNT_PREFIX_COUNT_MANY}    ${COUNT_PREFIX_COUNT}
-${FIRST_PEER_IP}    127.0.0.1
-${HOLDTIME}       180
-${HOLDTIME_PREFIX_COUNT}    ${HOLDTIME}
-${HOLDTIME_PREFIX_COUNT_MANY}    ${HOLDTIME_PREFIX_COUNT}
-${KARAF_LOG_LEVEL}    INFO
-${KARAF_BGPCEP_LOG_LEVEL}    ${KARAF_LOG_LEVEL}
-${KARAF_PROTOCOL_LOG_LEVEL}    ${KARAF_BGPCEP_LOG_LEVEL}
-${MULTIPLICITY}    2    # Changed in releng-builder variables
-${MULTIPLICITY_PREFIX_COUNT}    ${MULTIPLICITY}
-${MULTIPLICITY_PREFIX_COUNT_MANY}    ${MULTIPLICITY_PREFIX_COUNT}
-${REPETITIONS}    1
-${REPETITIONS_PREFIX_COUNT}    ${REPETITIONS}
-${REPETITIONS_PREFIX_COUNT_MANY}    ${REPETITIONS_PREFIX_COUNT}
-${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}    ${TEST_DURATION_MULTIPLIER}
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY}    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
+${BGP_TOOL_LOG_LEVEL}                               info
+${BGP_VARIABLES_FOLDER}                             ${CURDIR}/../../../variables/bgpuser/
+# ${MULTIPLICITY*2} recommended for this suite, but keeping the common default.
+${CHECK_PERIOD}
+...                                                 60
+${CHECK_PERIOD_PREFIX_COUNT}                        ${CHECK_PERIOD}
+${CHECK_PERIOD_PREFIX_COUNT_MANY}                   ${CHECK_PERIOD_PREFIX_COUNT}
+${COUNT}                                            600000
+${COUNT_PREFIX_COUNT}                               ${COUNT}
+${COUNT_PREFIX_COUNT_MANY}                          ${COUNT_PREFIX_COUNT}
+${FIRST_PEER_IP}                                    127.0.0.1
+${HOLDTIME}                                         180
+${HOLDTIME_PREFIX_COUNT}                            ${HOLDTIME}
+${HOLDTIME_PREFIX_COUNT_MANY}                       ${HOLDTIME_PREFIX_COUNT}
+${KARAF_LOG_LEVEL}                                  INFO
+${KARAF_BGPCEP_LOG_LEVEL}                           ${KARAF_LOG_LEVEL}
+${KARAF_PROTOCOL_LOG_LEVEL}                         ${KARAF_BGPCEP_LOG_LEVEL}
+${MULTIPLICITY}                                     2    # Changed in releng-builder variables
+${MULTIPLICITY_PREFIX_COUNT}                        ${MULTIPLICITY}
+${MULTIPLICITY_PREFIX_COUNT_MANY}                   ${MULTIPLICITY_PREFIX_COUNT}
+${REPETITIONS}                                      1
+${REPETITIONS_PREFIX_COUNT}                         ${REPETITIONS}
+${REPETITIONS_PREFIX_COUNT_MANY}                    ${REPETITIONS_PREFIX_COUNT}
+${TEST_DURATION_MULTIPLIER}                         1
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}            ${TEST_DURATION_MULTIPLIER}
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY}       ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
+${RIB_INSTANCE}                                     example-bgp-rib
+${PROTOCOL_OPENCONFIG}                              ${RIB_INSTANCE}
+${DEVICE_NAME}                                      controller-config
 # TODO: Option names can be better.
 
+
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
     [Documentation]    Wait for example-ipv4-topology to come up and empty. Give large timeout for case when BGP boots slower than restconf.
@@ -102,8 +108,16 @@ Reconfigure_ODL_To_Accept_Connections
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_PREFIX_COUNT_MANY}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${peer_name}    IP=${peer_ip}    HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY}
-        ...    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        &{mapping} =    Create Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    BGP_NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY}
+        ...    PEER_PORT=${BGP_TOOL_PORT}
+        ...    INITIATE=false
+        ...    BGP_RIB=${RIB_INSTANCE}
+        ...    PASSIVE_MODE=true
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
         ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
         TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
         # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready.
@@ -111,16 +125,23 @@ Reconfigure_ODL_To_Accept_Connections
 
 Change_Karaf_Logging_Levels
     [Documentation]    We may want to set more verbose logging here after configuration is done.
-    KarafKeywords.Set_Bgpcep_Log_Levels    bgpcep_level=${KARAF_BGPCEP_LOG_LEVEL}    protocol_level=${KARAF_PROTOCOL_LOG_LEVEL}
+    KarafKeywords.Set_Bgpcep_Log_Levels
+    ...    bgpcep_level=${KARAF_BGPCEP_LOG_LEVEL}
+    ...    protocol_level=${KARAF_PROTOCOL_LOG_LEVEL}
 
 Start_Talking_BGP_Manager
     [Documentation]    Start Python manager to connect speakers to ODL.
     # Myport value is needed for checking whether connection at precise port was established.
-    BGPSpeaker.Start_BGP_Manager    --amount=${COUNT_PREFIX_COUNT_MANY} --multiplicity=${MULTIPLICITY_PREFIX_COUNT_MANY} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT}
+    BGPSpeaker.Start_BGP_Manager
+    ...    --amount=${COUNT_PREFIX_COUNT_MANY} --multiplicity=${MULTIPLICITY_PREFIX_COUNT_MANY} --myip=${FIRST_PEER_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT}
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable. This is done by checking stability of prefix count.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_MANY}    repetitions=${REPETITIONS_PREFIX_COUNT_MANY}    excluded_count=0
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_MANY}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_MANY}
+    ...    excluded_count=0
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -142,7 +163,11 @@ Wait_For_Stable_Ipv4_Topology_After_Talking
     # TODO: Is is possible to have failed at Check_Talking_Ipv4_Topology_Count and still have initial period of constant count?
     # FIXME: If yes, do count here to get the initial value and use it (if nonzero).
     # TODO: If yes, decide whether access to the FailFast state should have keyword or just variable name.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_MANY}    repetitions=${REPETITIONS_PREFIX_COUNT_MANY}    excluded_count=${COUNT_PREFIX_COUNT_MANY}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_MANY}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_MANY}
+    ...    excluded_count=${COUNT_PREFIX_COUNT_MANY}
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -161,10 +186,15 @@ Delete_Bgp_Peer_Configuration
     FOR    ${index}    IN RANGE    1    ${MULTIPLICITY_PREFIX_COUNT_MANY}+1
         ${peer_name} =    BuiltIn.Set_Variable    example-bgp-peer-${index}
         ${peer_ip} =    BuiltIn.Evaluate    str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1)    modules=ipaddr
-        &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${peer_name}    IP=${peer_ip}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+        &{mapping} =    BuiltIn.Create_Dictionary
+        ...    DEVICE_NAME=${DEVICE_NAME}
+        ...    BGP_NAME=${peer_name}
+        ...    IP=${peer_ip}
+        ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
         TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
     END
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to ODL system,
@@ -172,7 +202,12 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     TemplatedRequests.Create_Default_Session
     PrefixCounting.PC_Setup
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -184,9 +219,11 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     # Calculate the timeout value based on how many routes are going to be pushed.
     ${period} =    DateTime.Convert_Time    ${CHECK_PERIOD_PREFIX_COUNT_MANY}    result_format=number
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY} * (${COUNT_PREFIX_COUNT_MANY} * 3.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY} * (${COUNT_PREFIX_COUNT_MANY} * 3.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY} * (${COUNT_PREFIX_COUNT_MANY} * 2.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY} + 1)) + 20
+    ${timeout} =    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY} * (${COUNT_PREFIX_COUNT_MANY} * 2.0 / 10000 + ${period} * (${REPETITIONS_PREFIX_COUNT_MANY} + 1)) + 20
     Builtin.Set_Suite_Variable    ${bgp_emptying_timeout}    ${timeout}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${KARAF_LOG_LEVEL}
 
index e7c30d5ade7e936b7b0d7e8eb683ff6ad5f569b4..7f15f4cfdbefbb287c9e26c65d976f739d60a168 100644 (file)
@@ -1,84 +1,88 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is used.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
 ...
-...               This suite uses play.py as single iBGP peer.
-...               The suite only looks at example-ipv4-topology, so RIB is not examined.
+...                 This suite uses play.py as single iBGP peer.
+...                 The suite only looks at example-ipv4-topology, so RIB is not examined.
 ...
-...               This suite requires odl-bgpcep-data-change-counter to be installed so
-...               make sure it is added to "install-features" of any jobs that are going
-...               to invoke it.
+...                 This suite requires odl-bgpcep-data-change-counter to be installed so
+...                 make sure it is added to "install-features" of any jobs that are going
+...                 to invoke it.
 ...
-...               The suite consists of two halves, differing on which side initiates BGP connection.
-...               Data change counter is a lightweight way to detect "work is being done".
-...               WaitUtils provide a nice Keyword to wait for stability, but it needs
-...               initial value, that is why Store_Change_Count appears just before work-inducing action.
-...               The time for Wait_For_Stable_* cases to finish is the main performance metric.
-...               After waiting for stability is done, full check on number of prefixes present is performed.
+...                 The suite consists of two halves, differing on which side initiates BGP connection.
+...                 Data change counter is a lightweight way to detect "work is being done".
+...                 WaitUtils provide a nice Keyword to wait for stability, but it needs
+...                 initial value, that is why Store_Change_Count appears just before work-inducing action.
+...                 The time for Wait_For_Stable_* cases to finish is the main performance metric.
+...                 After waiting for stability is done, full check on number of prefixes present is performed.
 ...
-...               Brief description how to configure BGP peer can be found here:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+...                 Brief description how to configure BGP peer can be found here:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
 ...
-...               TODO: Currently, if a bug causes zero increase of data changes,
-...               affected test cases will wait for max time. Reconsider.
-...               If zero increase is allowed as stable, higher number of repetitions should be required.
+...                 TODO: Currently, if a bug causes zero increase of data changes,
+...                 affected test cases will wait for max time. Reconsider.
+...                 If zero increase is allowed as stable, higher number of repetitions should be required.
 ...
-...               Additionally this test suite is not compatible with Helium and Hydrogen
-...               releases as they don't include data change counter feature.
-...               Use the other version of the suite (singlepeer_prefixcount.robot) to test them.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/ChangeCounter.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 Additionally this test suite is not compatible with Helium and Hydrogen
+...                 releases as they don't include data change counter feature.
+...                 Use the other version of the suite (singlepeer_prefixcount.robot) to test them.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/ChangeCounter.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD}    60
-${CHECK_PERIOD_CHANGE_COUNT}    ${CHECK_PERIOD}
-${CHECK_PERIOD_CHANGE_COUNT_SINGLE}    ${CHECK_PERIOD_CHANGE_COUNT}
-${COUNT}          600000
-${COUNT_CHANGE_COUNT}    ${COUNT}
-${COUNT_CHANGE_COUNT_SINGLE}    ${COUNT_CHANGE_COUNT}
-${HOLDTIME}       180
-${HOLDTIME_CHANGE_COUNT}    ${HOLDTIME}
-${HOLDTIME_CHANGE_COUNT_SINGLE}    ${HOLDTIME_CHANGE_COUNT}
-${INSERT}         1
-${PREFILL}        0
-${REPETITIONS}    1
-${REPETITIONS_CHANGE_COUNT}    ${REPETITIONS}
-${REPETITIONS_CHANGE_COUNT_SINGLE}    ${REPETITIONS_CHANGE_COUNT}
-${RESULTS_FILE_NAME}    bgp.csv
-${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}    ${TEST_DURATION_MULTIPLIER}
-${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_SINGLE}    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
-${UPDATE}         single
-${WITHDRAW}       0
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
-${BGP_PEER_NAME}    example-bgp-peer
+${BGP_TOOL_LOG_LEVEL}                               info
+${BGP_VARIABLES_FOLDER}                             ${CURDIR}/../../../variables/bgpuser/
+${CHECK_PERIOD}                                     60
+${CHECK_PERIOD_CHANGE_COUNT}                        ${CHECK_PERIOD}
+${CHECK_PERIOD_CHANGE_COUNT_SINGLE}                 ${CHECK_PERIOD_CHANGE_COUNT}
+${COUNT}                                            600000
+${COUNT_CHANGE_COUNT}                               ${COUNT}
+${COUNT_CHANGE_COUNT_SINGLE}                        ${COUNT_CHANGE_COUNT}
+${HOLDTIME}                                         180
+${HOLDTIME_CHANGE_COUNT}                            ${HOLDTIME}
+${HOLDTIME_CHANGE_COUNT_SINGLE}                     ${HOLDTIME_CHANGE_COUNT}
+${INSERT}                                           1
+${PREFILL}                                          0
+${REPETITIONS}                                      1
+${REPETITIONS_CHANGE_COUNT}                         ${REPETITIONS}
+${REPETITIONS_CHANGE_COUNT_SINGLE}                  ${REPETITIONS_CHANGE_COUNT}
+${RESULTS_FILE_NAME}                                bgp.csv
+${TEST_DURATION_MULTIPLIER}                         1
+${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}            ${TEST_DURATION_MULTIPLIER}
+${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_SINGLE}     ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
+${UPDATE}                                           single
+${WITHDRAW}                                         0
+${RIB_INSTANCE}                                     example-bgp-rib
+${PROTOCOL_OPENCONFIG}                              ${RIB_INSTANCE}
+${DEVICE_NAME}                                      controller-config
+${BGP_PEER_NAME}                                    example-bgp-peer
 # TODO: Option names can be better.
-${last_change_count_single}    1
+${last_change_count_single}                         1
+
 
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
@@ -89,8 +93,17 @@ Check_For_Empty_Ipv4_Topology_Before_Talking
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME_CHANGE_COUNT_SINGLE}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME_CHANGE_COUNT_SINGLE}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Reconfigure_Data_Change_Counter
@@ -105,11 +118,16 @@ Start_Talking_BGP_Speaker
     [Documentation]    Start Python speaker to connect to ODL.
     Store_Change_Count
     # Myport value is needed for checking whether connection at precise port was established.
-    BGPSpeaker.Start_BGP_Speaker    --amount ${COUNT_CHANGE_COUNT_SINGLE} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount ${COUNT_CHANGE_COUNT_SINGLE} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable. This is done by checking the change counter.
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}    count_to_overcome=${last_change_count_single}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}
+    ...    count_to_overcome=${last_change_count_single}
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -138,7 +156,11 @@ Store_Results_For_Talking_BGP_Speaker
 Wait_For_Stable_Ipv4_Topology_After_Talking
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
     [Tags]    critical
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}    count_to_overcome=${last_change_count_single}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_emptying_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}
+    ...    count_to_overcome=${last_change_count_single}
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -148,18 +170,32 @@ Check_For_Empty_Ipv4_Topology_After_Talking
 
 Start_Listening_BGP_Speaker
     [Documentation]    Start Python speaker in listening mode.
-    BGPSpeaker.Start_BGP_Speaker    --amount ${COUNT_CHANGE_COUNT_SINGLE} --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount ${COUNT_CHANGE_COUNT_SINGLE} --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
 
 Reconfigure_ODL_To_Initiate_Connection
     [Documentation]    Replace BGP peer config module, now with initiate-connection set to true.
     Store_Change_Count
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME_CHANGE_COUNT_SINGLE}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=true    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=false    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME_CHANGE_COUNT_SINGLE}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=true
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=false
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Wait_For_Stable_Listening_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable.
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}    count_to_overcome=${last_change_count_single}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}
+    ...    count_to_overcome=${last_change_count_single}
 
 Check_Listening_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -183,12 +219,18 @@ Store_Results_For_Listening_BGP_Speaker
     Store_File_To_Workspace    totals-${RESULTS_FILE_NAME}    totals-${RESULTS_FILE_NAME}
     Store_File_To_Workspace    performance-${RESULTS_FILE_NAME}    performance-${RESULTS_FILE_NAME}
     Store_File_To_Workspace    totals-${RESULTS_FILE_NAME}    changecount-listening-totals-${RESULTS_FILE_NAME}
-    Store_File_To_Workspace    performance-${RESULTS_FILE_NAME}    changecount-listening-performance-${RESULTS_FILE_NAME}
+    Store_File_To_Workspace
+    ...    performance-${RESULTS_FILE_NAME}
+    ...    changecount-listening-performance-${RESULTS_FILE_NAME}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
     [Tags]    critical
-    ChangeCounter.Wait_For_Change_Count_To_Become_Stable    timeout=${bgp_emptying_timeout}    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}    count_to_overcome=${last_change_count_single}
+    ChangeCounter.Wait_For_Change_Count_To_Become_Stable
+    ...    timeout=${bgp_emptying_timeout}
+    ...    period=${CHECK_PERIOD_CHANGE_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_CHANGE_COUNT_SINGLE}
+    ...    count_to_overcome=${last_change_count_single}
 
 Check_For_Empty_Ipv4_Topology_After_Listening
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -204,9 +246,14 @@ Restore_Data_Change_Counter_Configuration
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to tools system,
@@ -215,7 +262,12 @@ Setup_Everything
     TemplatedRequests.Create_Default_Session
     ChangeCounter.CC_Setup
     PrefixCounting.PC_Setup
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -227,7 +279,8 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     # Calculate the timeout value based on how many routes are going to be pushed
     # TODO: Unify formulas with other suites in this directory.
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_SINGLE} * (${COUNT_CHANGE_COUNT_SINGLE} * 9.0 / 10000 + 20)
+    ${timeout}    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_SINGLE} * (${COUNT_CHANGE_COUNT_SINGLE} * 9.0 / 10000 + 20)
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
     Builtin.Set_Suite_Variable    ${bgp_emptying_timeout}    ${bgp_filling_timeout*3.0/4}
 
@@ -241,13 +294,15 @@ Teardown_Everything
 
 Store_Change_Count
     [Documentation]    Get the count of changes from BGP change counter. Ignore error or store the value.
-    ${status}    ${count} =    BuiltIn.Run_Keyword_And_Ignore_Error    ChangeCounter.Get_Change_Count
-    BuiltIn.Run_Keyword_If    '${status}' == 'PASS'    BuiltIn.Set_Suite_Variable    ${last_change_count_single}    ${count}
+    ${status}    ${count}    BuiltIn.Run_Keyword_And_Ignore_Error    ChangeCounter.Get_Change_Count
+    IF    '${status}' == 'PASS'
+        BuiltIn.Set_Suite_Variable    ${last_change_count_single}    ${count}
+    END
 
 Store_File_To_Workspace
-    [Arguments]    ${src_file_name}    ${dst_file_name}
     [Documentation]    Store the provided file from the SSH client to workspace.
-    ${files}=    SSHLibrary.List Files In Directory    .
-    ${output_log}=    SSHLibrary.Execute_Command    cat ${src_file_name}
+    [Arguments]    ${src_file_name}    ${dst_file_name}
+    ${files}    SSHLibrary.List Files In Directory    .
+    ${output_log}    SSHLibrary.Execute_Command    cat ${src_file_name}
     BuiltIn.Log    ${output_log}
     Create File    ${dst_file_name}    ${output_log}
index 3db541ab3ab93fef0f62f31fbac8753c08120dc3..751d805ffbefd6e6d706bdbc739e3a15c8f655ba 100644 (file)
@@ -1,76 +1,80 @@
 *** Settings ***
-Documentation     BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
+Documentation       BGP performance of ingesting from 1 iBGP peer, data change counter is NOT used.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
 ...
-...               This suite uses play.py as single iBGP peer.
-...               The suite only looks at example-ipv4-topology, so RIB is not examined.
+...                 This suite uses play.py as single iBGP peer.
+...                 The suite only looks at example-ipv4-topology, so RIB is not examined.
 ...
-...               The suite consists of two halves, differing on which side initiates BGP connection.
-...               State of "work is being done" is detected by increasing value of prefixes in topology.
-...               The time for Wait_For_Stable_* cases to finish is the main performance metric.
-...               After waiting for stability is done, full check on number of prefixes present is performed.
+...                 The suite consists of two halves, differing on which side initiates BGP connection.
+...                 State of "work is being done" is detected by increasing value of prefixes in topology.
+...                 The time for Wait_For_Stable_* cases to finish is the main performance metric.
+...                 After waiting for stability is done, full check on number of prefixes present is performed.
 ...
-...               Brief description how to configure BGP peer can be found here:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
-...               http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+...                 Brief description how to configure BGP peer can be found here:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+...                 http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
 ...
-...               TODO: Currently, if a bug causes prefix count to remain at zero,
-...               affected test cases will wait for max time. Reconsider.
-...               If zero is allowed as stable, higher period or repetitions would be required.
+...                 TODO: Currently, if a bug causes prefix count to remain at zero,
+...                 affected test cases will wait for max time. Reconsider.
+...                 If zero is allowed as stable, higher period or repetitions would be required.
 ...
-...               The prefix counting is quite heavyweight and may induce large variation in time.
-...               Try the other version of the suite (singlepeer_changecount.robot) to get better precision.
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/PrefixCounting.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../variables/Variables.robot
+...                 The prefix counting is quite heavyweight and may induce large variation in time.
+...                 Try the other version of the suite (singlepeer_changecount.robot) to get better precision.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/PrefixCounting.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
+
 
 *** Variables ***
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CHECK_PERIOD}    60
-${CHECK_PERIOD_PREFIX_COUNT}    ${CHECK_PERIOD}
-${CHECK_PERIOD_PREFIX_COUNT_SINGLE}    ${CHECK_PERIOD_PREFIX_COUNT}
-${COUNT}          600000
-${COUNT_PREFIX_COUNT}    ${COUNT}
-${COUNT_PREFIX_COUNT_SINGLE}    ${COUNT_PREFIX_COUNT}
-${HOLDTIME}       180
-${HOLDTIME_PREFIX_COUNT}    ${HOLDTIME}
-${HOLDTIME_PREFIX_COUNT_SINGLE}    ${HOLDTIME_PREFIX_COUNT}
-${INSERT}         1
-${PREFILL}        0
-${REPETITIONS}    1
-${REPETITIONS_PREFIX_COUNT}    ${REPETITIONS}
-${REPETITIONS_PREFIX_COUNT_SINGLE}    ${REPETITIONS_PREFIX_COUNT}
-${RESULTS_FILE_NAME}    bgp.csv
-${TEST_DURATION_MULTIPLIER}    1
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}    ${TEST_DURATION_MULTIPLIER}
-${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_SINGLE}    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
-${UPDATE}         single
-${WITHDRAW}       0
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
-${BGP_PEER_NAME}    example-bgp-peer
+${BGP_TOOL_LOG_LEVEL}                               info
+${BGP_VARIABLES_FOLDER}                             ${CURDIR}/../../../variables/bgpuser/
+${CHECK_PERIOD}                                     60
+${CHECK_PERIOD_PREFIX_COUNT}                        ${CHECK_PERIOD}
+${CHECK_PERIOD_PREFIX_COUNT_SINGLE}                 ${CHECK_PERIOD_PREFIX_COUNT}
+${COUNT}                                            600000
+${COUNT_PREFIX_COUNT}                               ${COUNT}
+${COUNT_PREFIX_COUNT_SINGLE}                        ${COUNT_PREFIX_COUNT}
+${HOLDTIME}                                         180
+${HOLDTIME_PREFIX_COUNT}                            ${HOLDTIME}
+${HOLDTIME_PREFIX_COUNT_SINGLE}                     ${HOLDTIME_PREFIX_COUNT}
+${INSERT}                                           1
+${PREFILL}                                          0
+${REPETITIONS}                                      1
+${REPETITIONS_PREFIX_COUNT}                         ${REPETITIONS}
+${REPETITIONS_PREFIX_COUNT_SINGLE}                  ${REPETITIONS_PREFIX_COUNT}
+${RESULTS_FILE_NAME}                                bgp.csv
+${TEST_DURATION_MULTIPLIER}                         1
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}            ${TEST_DURATION_MULTIPLIER}
+${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_SINGLE}     ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
+${UPDATE}                                           single
+${WITHDRAW}                                         0
+${RIB_INSTANCE}                                     example-bgp-rib
+${PROTOCOL_OPENCONFIG}                              ${RIB_INSTANCE}
+${DEVICE_NAME}                                      controller-config
+${BGP_PEER_NAME}                                    example-bgp-peer
 # TODO: Option names can be better.
 
+
 *** Test Cases ***
 Check_For_Empty_Ipv4_Topology_Before_Talking
     [Documentation]    Wait for example-ipv4-topology to come up and empty. Give large timeout for case when BGP boots slower than restconf.
@@ -80,18 +84,32 @@ Check_For_Empty_Ipv4_Topology_Before_Talking
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME_PREFIX_COUNT_SINGLE}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME_PREFIX_COUNT_SINGLE}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Start_Talking_BGP_Speaker
     [Documentation]    Start Python speaker to connect to ODL.
     # Myport value is needed for checking whether connection at precise port was established.
-    BGPSpeaker.Start_BGP_Speaker    --amount ${COUNT_PREFIX_COUNT_SINGLE} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount ${COUNT_PREFIX_COUNT_SINGLE} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
 
 Wait_For_Stable_Talking_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable. This is done by checking stability of prefix count.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}    excluded_count=0
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}
+    ...    excluded_count=0
 
 Check_Talking_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -122,7 +140,11 @@ Wait_For_Stable_Ipv4_Topology_After_Talking
     # TODO: Is is possible to have failed at Check_Talking_Ipv4_Topology_Count and still have initial period of constant count?
     # FIXME: If yes, do count here to get the initial value and use it (if nonzero).
     # TODO: If yes, decide whether access to the FailFast state should have keyword or just variable name.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}    excluded_count=${COUNT_PREFIX_COUNT_SINGLE}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}
+    ...    excluded_count=${COUNT_PREFIX_COUNT_SINGLE}
 
 Check_For_Empty_Ipv4_Topology_After_Talking
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -132,17 +154,31 @@ Check_For_Empty_Ipv4_Topology_After_Talking
 
 Start_Listening_BGP_Speaker
     [Documentation]    Start Python speaker in listening mode.
-    BGPSpeaker.Start_BGP_Speaker    --amount ${COUNT_PREFIX_COUNT_SINGLE} --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount ${COUNT_PREFIX_COUNT_SINGLE} --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --insert=${INSERT} --withdraw=${WITHDRAW} --prefill ${PREFILL} --update ${UPDATE} --${BGP_TOOL_LOG_LEVEL} --results ${RESULTS_FILE_NAME}
 
 Reconfigure_ODL_To_Initiate_Connection
     [Documentation]    Replace BGP peer config module, now with initiate-connection set to true.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME_PREFIX_COUNT_SINGLE}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=true    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=false    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME_PREFIX_COUNT_SINGLE}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=true
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=false
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
 Wait_For_Stable_Listening_Ipv4_Topology
     [Documentation]    Wait until example-ipv4-topology becomes stable.
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}    excluded_count=0
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}
+    ...    excluded_count=0
 
 Check_Listening_Ipv4_Topology_Count
     [Documentation]    Count the routes in example-ipv4-topology and fail if the count is not correct.
@@ -165,12 +201,18 @@ Store_Results_For_Listening_BGP_Speaker
     Store_File_To_Workspace    totals-${RESULTS_FILE_NAME}    totals-${RESULTS_FILE_NAME}
     Store_File_To_Workspace    performance-${RESULTS_FILE_NAME}    performance-${RESULTS_FILE_NAME}
     Store_File_To_Workspace    totals-${RESULTS_FILE_NAME}    prefixcount-listening-totals-${RESULTS_FILE_NAME}
-    Store_File_To_Workspace    performance-${RESULTS_FILE_NAME}    prefixcount-listening-performance-${RESULTS_FILE_NAME}
+    Store_File_To_Workspace
+    ...    performance-${RESULTS_FILE_NAME}
+    ...    prefixcount-listening-performance-${RESULTS_FILE_NAME}
 
 Wait_For_Stable_Ipv4_Topology_After_Listening
     [Documentation]    Wait until example-ipv4-topology becomes stable again.
     [Tags]    critical
-    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable    timeout=${bgp_filling_timeout}    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}    excluded_count=${COUNT_PREFIX_COUNT_SINGLE}
+    PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable
+    ...    timeout=${bgp_filling_timeout}
+    ...    period=${CHECK_PERIOD_PREFIX_COUNT_SINGLE}
+    ...    repetitions=${REPETITIONS_PREFIX_COUNT_SINGLE}
+    ...    excluded_count=${COUNT_PREFIX_COUNT_SINGLE}
 
 Check_For_Empty_Ipv4_Topology_After_Listening
     [Documentation]    Example-ipv4-topology should be empty now.
@@ -181,9 +223,14 @@ Check_For_Empty_Ipv4_Topology_After_Listening
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup imported resources, SSH-login to tools system,
@@ -191,7 +238,12 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     TemplatedRequests.Create_Default_Session
     PrefixCounting.PC_Setup
-    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=125    max_retries=0
+    RequestsLibrary.Create_Session
+    ...    operational
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH}
+    ...    timeout=125
+    ...    max_retries=0
     # TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
     # TODO: Alternatively, create variable in Variables which starts with http.
     # Both TODOs would probably need to update every suite relying on current Variables.
@@ -203,7 +255,8 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     # Calculate the timeout value based on how many routes are going to be pushed
     # TODO: Replace 20 with some formula from period and repetitions.
-    ${timeout} =    BuiltIn.Evaluate    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_SINGLE} * (${COUNT_PREFIX_COUNT_SINGLE} * 9.0 / 10000 + 20)
+    ${timeout}    BuiltIn.Evaluate
+    ...    ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_SINGLE} * (${COUNT_PREFIX_COUNT_SINGLE} * 9.0 / 10000 + 20)
     Builtin.Set_Suite_Variable    ${bgp_filling_timeout}    ${timeout}
 
 Teardown_Everything
@@ -215,9 +268,9 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Store_File_To_Workspace
-    [Arguments]    ${src_file_name}    ${dst_file_name}
     [Documentation]    Store the provided file from the SSH client to workspace.
-    ${files}=    SSHLibrary.List Files In Directory    .
-    ${output_log}=    SSHLibrary.Execute_Command    cat ${src_file_name}
+    [Arguments]    ${src_file_name}    ${dst_file_name}
+    ${files}    SSHLibrary.List Files In Directory    .
+    ${output_log}    SSHLibrary.Execute_Command    cat ${src_file_name}
     BuiltIn.Log    ${output_log}
     Create File    ${dst_file_name}    ${output_log}
index f1b66863b9d195a2e6409896798a9703f9c72fd5..301c0c7601faaf9d8209dbf8870ffda67fa81634 100644 (file)
@@ -1,72 +1,76 @@
 *** Settings ***
-Documentation     Basic tests for odl-bgpcep-bgp-all feature.
+Documentation       Basic tests for odl-bgpcep-bgp-all feature.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic BGP functional test cases:
-...               BGP peer initiated connection
-...               - introduce and check 3 prefixes in one update message
-...               ODL controller initiated connection:
-...               - introduce and check 3 prefixes in one update message
-...               - introduce 2 prefixes in first update message and then additional 2 prefixes
-...               in another update while the very first prefix is withdrawn
-...               - introduce 3 prefixes and try to withdraw the first one
-...               (to be ignored by controller) in a single update message
+...                 Test suite performs basic BGP functional test cases:
+...                 BGP peer initiated connection
+...                 - introduce and check 3 prefixes in one update message
+...                 ODL controller initiated connection:
+...                 - introduce and check 3 prefixes in one update message
+...                 - introduce 2 prefixes in first update message and then additional 2 prefixes
+...                 in another update while the very first prefix is withdrawn
+...                 - introduce 3 prefixes and try to withdraw the first one
+...                 (to be ignored by controller) in a single update message
 ...
-...               TC_R (test case reset) tests session-reset functionality.
-...               Resets the session, and than verifies that example-ipv4-topology is empty again.
+...                 TC_R (test case reset) tests session-reset functionality.
+...                 Resets the session, and than verifies that example-ipv4-topology is empty again.
 ...
-...               TC_LA (test case local address) tests configuration of internal peer
-...               with local-address configured
-...               - configure peer with local-address and connect bgp-speaker to it
-...               with tools_system_ip
-...               - check filled topology
+...                 TC_LA (test case local address) tests configuration of internal peer
+...                 with local-address configured
+...                 - configure peer with local-address and connect bgp-speaker to it
+...                 with tools_system_ip
+...                 - check filled topology
 ...
-...               TC_PG (test case peer group) tests configuration and reconfiguration
-...               of peer-groups and neighbors configured by them.
-...               - configure peer-group, and assign neighbor to this peer-group
-...               - check filled topology
-...               - reconfigure peer-group without ipv4 unicast afi-safi
-...               - check empty topology
-...               - reconfigre neighbor without peer-group, delete peer-group
+...                 TC_PG (test case peer group) tests configuration and reconfiguration
+...                 of peer-groups and neighbors configured by them.
+...                 - configure peer-group, and assign neighbor to this peer-group
+...                 - check filled topology
+...                 - reconfigure peer-group without ipv4 unicast afi-safi
+...                 - check empty topology
+...                 - reconfigre neighbor without peer-group, delete peer-group
 ...
-...               Brief description how to perform BGP functional test:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_Feature_Tests#How_to_test_2
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           OperatingSystem
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/WaitForFailure.robot
+...                 Brief description how to perform BGP functional test:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_Feature_Tests#How_to_test_2
+
+Library             OperatingSystem
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/WaitForFailure.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
-${BGP_PEER_NAME}    example-bgp-peer
-${BGP_TOOL_LOG_LEVEL}    info
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${CONFIG_SESSION}    session
-${DEVICE_NAME}    controller-config
-${HOLDTIME}       180
-${ODL_BGP_LOG_LEVEL}    DEFAULT
-${ODL_LOG_LEVEL}    INFO
-${PEER_GROUP}     internal-neighbors
-${RIB_NAME}       example-bgp-rib
-${TOOLS_SYSTEM_PROMPT}    ${DEFAULT_LINUX_PROMPT}
+${BGP_PEER_NAME}            example-bgp-peer
+${BGP_TOOL_LOG_LEVEL}       info
+${BGP_VARIABLES_FOLDER}     ${CURDIR}/../../../variables/bgpuser/
+${CONFIG_SESSION}           session
+${DEVICE_NAME}              controller-config
+${HOLDTIME}                 180
+${ODL_BGP_LOG_LEVEL}        DEFAULT
+${ODL_LOG_LEVEL}            INFO
+${PEER_GROUP}               internal-neighbors
+${RIB_NAME}                 example-bgp-rib
+${TOOLS_SYSTEM_PROMPT}      ${DEFAULT_LINUX_PROMPT}
+
 
 *** Test Cases ***
 Check_For_Empty_Topology_Before_Talking
@@ -76,16 +80,28 @@ Check_For_Empty_Topology_Before_Talking
 
 TC_LA_Reconfigure_Odl_To_Initiate_Connection
     [Documentation]    Configure ibgp peer with local-address.
-    &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=false    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    &{mapping}    Create Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=false
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
     ...    LOCAL=${ODL_SYSTEM_IP}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_local_address    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_local_address
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 TC_LA_Start_Bgp_Speaker_And_Verify_Connected
     [Documentation]    Verify that peer is present in odl's rib under local-address ip.
     [Tags]    critical
-    ${speaker_args}    BuiltIn.Set_Variable    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --debug
-    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected    ${speaker_args}    session=${CONFIG_SESSION}    speaker_ip=${TOOLS_SYSTEM_IP}
+    ${speaker_args}    BuiltIn.Set_Variable
+    ...    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --debug
+    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected
+    ...    ${speaker_args}
+    ...    session=${CONFIG_SESSION}
+    ...    speaker_ip=${TOOLS_SYSTEM_IP}
     BuiltIn.Log    ${output}
 
 TC_LA_Kill_Bgp_Speaker
@@ -100,19 +116,34 @@ TC_LA_Kill_Bgp_Speaker
 TC_LA_Delete_Bgp_Peer_Configuration
     [Documentation]    Delete peer configuration.
     &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_local_address    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_local_address
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_NAME}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 Start_Talking_BGP_speaker
     [Documentation]    Start Python speaker to connect to ODL, verify that the tool does not promptly exit.
     # Myport value is needed for checking whether connection at precise port was established.
-    BGPSpeaker.Start_BGP_Speaker    --amount 3 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 3 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Talking_Connection_Is_Established
@@ -127,9 +158,12 @@ Check_Talking_Topology_Is_Filled
 
 TC_R_Reset_Bgp_Peer_Session
     [Documentation]    Reset Peer Session
-    [Tags]    Critical
+    [Tags]    critical
     &{mapping}    Create Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_NAME}
-    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
@@ -138,12 +172,31 @@ TC_R_Check_For_Empty_Topology_After_Resetting
 
 TC_PG_Reconfigure_ODL_With_Peer_Group_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    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_NAME}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{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_NAME}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    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
@@ -170,10 +223,25 @@ TC_PG_Check_For_Empty_Topology_After_Deconfiguration
 
 TC_PG_Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    &{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_NAME}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    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}
+    &{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_NAME}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    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
 
@@ -193,7 +261,8 @@ Check_For_Empty_Topology_After_Talking
 
 Start_Listening_BGP_Speaker
     [Documentation]    Start Python speaker in listening mode, verify that the tool does not exit quickly.
-    BGPSpeaker.Start_BGP_Speaker    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --${BGP_TOOL_LOG_LEVEL}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Listening_Connection_Is_Not_Established_Yet
@@ -207,9 +276,20 @@ Check_For_Empty_Topology_Before_Listening
 
 Reconfigure_ODL_To_Initiate_Connection
     [Documentation]    Replace BGP peer config module, now with initiate-connection set to true.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=true    BGP_RIB=${RIB_NAME}    PASSIVE_MODE=false    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=true
+    ...    BGP_RIB=${RIB_NAME}
+    ...    PASSIVE_MODE=false
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Check_Listening_Connection_Is_Established
     [Documentation]    See TCP (BGP) connection in established state.
@@ -236,7 +316,8 @@ Check_For_Empty_Topology_After_Listening
 
 Start_Listening_BGP_Speaker_Case_2
     [Documentation]    BGP Speaker introduces 2 prefixes in the first update & another 2 prefixes while the very first is withdrawn in 2nd update
-    BGPSpeaker.Start_BGP_Speaker    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --prefill=2 --insert=2 --withdraw=1 --updates=single --firstprefix=8.0.0.240 --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 3 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --prefill=2 --insert=2 --withdraw=1 --updates=single --firstprefix=8.0.0.240 --${BGP_TOOL_LOG_LEVEL}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Listening_Connection_Is_Established_Case_2
@@ -264,7 +345,8 @@ Check_For_Empty_Topology_After_Listening_Case_2
 
 Start_Listening_BGP_Speaker_Case_3
     [Documentation]    BGP Speaker introduces 3 prefixes while the first one occures again in the withdrawn list (to be ignored by controller)
-    BGPSpeaker.Start_BGP_Speaker    --amount 2 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --prefill=0 --insert=3 --withdraw=1 --updates=single --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 2 --listen --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --prefill=0 --insert=3 --withdraw=1 --updates=single --${BGP_TOOL_LOG_LEVEL}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Listening_Connection_Is_Established_Case_3
@@ -292,8 +374,16 @@ Check_For_Empty_Topology_After_Listening_Case_3
 
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${RIB_NAME}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Setup_Everything
@@ -308,8 +398,10 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_LOG_LEVEL}
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
 
 Teardown_Everything
     [Documentation]    Make sure Python tool was killed, delete all sessions, tear down imported Resources.
@@ -318,19 +410,26 @@ Teardown_Everything
     SSHLibrary.Close_All_Connections
 
 Wait_For_Topology_To_Change_To
-    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     [Documentation]    Wait until Compare_Topology matches expected result.
+    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${refresh}    Compare_Topology    ${folder_name}
 
 Verify_That_Topology_Does_Not_Change_From
-    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     [Documentation]    Verify that Compare_Topology keeps passing, it will hold its last result.
-    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${timeout}    ${refresh}    Compare_Topology    ${folder_name}
+    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
+    ...    ${timeout}
+    ...    ${refresh}
+    ...    Compare_Topology
+    ...    ${folder_name}
 
 Compare_Topology
-    [Arguments]    ${folder_name}
     [Documentation]    Get current example-ipv4-topology as json, and compare it to expected result.
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}${folder_name}    session=${CONFIG_SESSION}    verify=True
+    [Arguments]    ${folder_name}
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${folder_name}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Check_Speaker_Is_Not_Connected
     [Documentation]    Give it a few tries to see zero established connections.
@@ -341,33 +440,65 @@ Check_Speaker_Is_Connected
     BuiltIn.Wait_Until_Keyword_Succeeds    5s    1s    Check_Number_Of_Speaker_Connections    1
 
 Check_Number_Of_Speaker_Connections
-    [Arguments]    ${howmany}
     [Documentation]    Run netstat in mininet machine and parse it for number of established connections. Check it is ${howmany}.
-    ${output}=    SSHKeywords.Count_Port_Occurences    17900    ESTABLISHED    python
+    [Arguments]    ${howmany}
+    ${output}    SSHKeywords.Count_Port_Occurences    17900    ESTABLISHED    python
     BuiltIn.Should_Be_Equal_As_Strings    ${output}    ${howmany}
 
 Configure_Peer_Group
-    [Arguments]    ${peer_group_folder}=peer_group
     [Documentation]    Configures peer group which is template for all the neighbors which are going
     ...    to be configured. Also after PUT, this case verifies presence of peer group within
     ...    peer-groups.
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_NAME}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_NAME}    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
-    ${verify_peer_group_folder}    CompareStream.Run_Keyword_If_At_Least_Else    sulfur    BuiltIn.Set Variable    verify_${peer_group_folder}.sulfur
-    ...    ELSE    BuiltIn.Set Variable    verify_${peer_group_folder}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}${peer_group_folder}    mapping=${mapping}    session=${CONFIG_SESSION}
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}${verify_peer_group_folder}    mapping=${mapping}    session=${CONFIG_SESSION}    verify=True
+    [Arguments]    ${peer_group_folder}=peer_group
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_NAME}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    ...    PEER_GROUP_NAME=${PEER_GROUP}
+    ...    RR_CLIENT=false
+    ${verify_peer_group_folder}    CompareStream.Run_Keyword_If_At_Least_Else
+    ...    sulfur
+    ...    BuiltIn.Set Variable
+    ...    verify_${peer_group_folder}.sulfur
+    ...    ELSE
+    ...    BuiltIn.Set Variable
+    ...    verify_${peer_group_folder}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${peer_group_folder}
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${verify_peer_group_folder}
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Deconfigure_Peer_Group
     [Documentation]    Deconfigures peer group which is template for all the neighbors
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    INITIATE=false    BGP_RIB=${RIB_NAME}
-    ...    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${RIB_NAME}    PEER_GROUP_NAME=${PEER_GROUP}    RR_CLIENT=false
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}peer_group    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_NAME}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${RIB_NAME}
+    ...    PEER_GROUP_NAME=${PEER_GROUP}
+    ...    RR_CLIENT=false
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}peer_group
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Restart_Talking_BGP_Speaker
     [Documentation]    Abort the Python speaker. Also, attempt to stop failing fast. And Start it again.
     ...    We have to restart it this way because we reset session before
     BGPSpeaker.Kill_BGP_Speaker
     FailFast.Do_Not_Fail_Fast_From_Now_On
-    BGPSpeaker.Start_BGP_Speaker    --amount 3 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL}
+    BGPSpeaker.Start_BGP_Speaker
+    ...    --amount 3 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL}
     Read_And_Fail_If_Prompt_Is_Seen
index 3871defc190281ab424711836a25c2dcb526bbfa..5eeba2448311cab353a48772b18891085eacd6e8 100644 (file)
 *** Settings ***
-Documentation     Basic tests for BGP application peer.
+Documentation       Basic tests for BGP application peer.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic BGP functional test cases for
-...               BGP application peer operations and checks for IP4 topology updates
-...               and updates towards BGP peer as follows:
+...                 Test suite performs basic BGP functional test cases for
+...                 BGP application peer operations and checks for IP4 topology updates
+...                 and updates towards BGP peer as follows:
 ...
-...               Test case 1: Initial BGP peer connection with pre-filled topology,
-...               POST and simple DELETE requests used.
-...               BGP_Application_Peer_Post_3_Initial_Routes,
-...               Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
-...               Connect_BGP_Peer,
-...               BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
-...               BGP_Application_Peer_Delete_3_Initial_Routes,
-...               Check_Example-IPv4-Topology_Is_Empty,
-...               Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
-...               Stop_BGP_Peer.
+...                 Test case 1: Initial BGP peer connection with pre-filled topology,
+...                 POST and simple DELETE requests used.
+...                 BGP_Application_Peer_Post_3_Initial_Routes,
+...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
+...                 Connect_BGP_Peer,
+...                 BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
+...                 BGP_Application_Peer_Delete_3_Initial_Routes,
+...                 Check_Example-IPv4-Topology_Is_Empty,
+...                 Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
+...                 Stop_BGP_Peer.
 ...
-...               Test case 2: PUT and DELETE all routes requests while BGP peer is connected.
-...               Reconnect_BGP_Peer,
-...               BGP_Application_Peer_Put_3_Routes,
-...               Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
-...               BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
-...               BGP_Application_Peer_Delete_All_Routes,
-...               Check_Example-IPv4-Topology_Is_Empty,
-...               BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
-...               Stop_BGP_Peer.
+...                 Test case 2: PUT and DELETE all routes requests while BGP peer is connected.
+...                 Reconnect_BGP_Peer,
+...                 BGP_Application_Peer_Put_3_Routes,
+...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
+...                 BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
+...                 BGP_Application_Peer_Delete_All_Routes,
+...                 Check_Example-IPv4-Topology_Is_Empty,
+...                 BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
+...                 Stop_BGP_Peer.
 ...
-...               Test case 3: Repeated BGP peer re-connection with pre-filled topology.
-...               BGP_Application_Peer_Put_3_Routes,
-...               Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
-...               Reconnect_BGP_Peer_And_Check_Incomming_Updates_For_3_Introduced_Prefixes,
-...               BGP_Application_Peer_Delete_All_Routes,
-...               Check_Example-IPv4-Topology_Is_Empty,
-...               BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
-...               Stop_BGP_Peer.
+...                 Test case 3: Repeated BGP peer re-connection with pre-filled topology.
+...                 BGP_Application_Peer_Put_3_Routes,
+...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
+...                 Reconnect_BGP_Peer_And_Check_Incomming_Updates_For_3_Introduced_Prefixes,
+...                 BGP_Application_Peer_Delete_All_Routes,
+...                 Check_Example-IPv4-Topology_Is_Empty,
+...                 BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
+...                 Stop_BGP_Peer.
 ...
-...               Brief description how to configure BGP application peer and
-...               how to use restconf application peer interface:
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
-Suite Setup       Setup_Everything
-Suite Teardown    Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           OperatingSystem
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KillPythonTool.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/WaitForFailure.robot
-Resource          ../../../variables/Variables.robot
+...                 Brief description how to configure BGP application peer and
+...                 how to use restconf application peer interface:
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
+
+Library             OperatingSystem
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KillPythonTool.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/WaitForFailure.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${TOOLS_SYSTEM_PROMPT}    ${DEFAULT_LINUX_PROMPT}
-${HOLDTIME}       180
-${BGP_PEER_LOG_LEVEL}    debug
-${BGP_APP_PEER_LOG_LEVEL}    debug
-${BGP_PEER_COMMAND}    python3 play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
-${BGP_PEER_OPTIONS}    ${EMPTY}
-${BGP_APP_PEER_ID}    ${ODL_SYSTEM_IP}
-${BGP_APP_PEER_POST_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_PUT_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_DELETE_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_DELETE_ALL_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_GET_COMMAND}    python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
-${BGP_APP_PEER_OPTIONS}    &>/dev/null
-${BGP_APP_PEER_TIMEOUT}    30s
-${BGP_PEER_APP_NAME}    example-bgp-peer-app
-${CONFIG_SESSION}    session
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
-${BGP_PEER_NAME}    example-bgp-peer
-${RIB_INSTANCE}    example-bgp-rib
-${SCRIPT_URI_OPT}    --uri data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=bgp-types%3Aipv4-address-family,bgp-types%3Aunicast-subsequent-address-family
+${BGP_VARIABLES_FOLDER}                 ${CURDIR}/../../../variables/bgpuser/
+${TOOLS_SYSTEM_PROMPT}                  ${DEFAULT_LINUX_PROMPT}
+${HOLDTIME}                             180
+${BGP_PEER_LOG_LEVEL}                   debug
+${BGP_APP_PEER_LOG_LEVEL}               debug
+${BGP_PEER_COMMAND}
+...                                     python3 play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
+${BGP_PEER_OPTIONS}                     ${EMPTY}
+${BGP_APP_PEER_ID}                      ${ODL_SYSTEM_IP}
+${BGP_APP_PEER_POST_COMMAND}
+...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_PUT_COMMAND}
+...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_COMMAND}
+...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_ALL_COMMAND}
+...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_GET_COMMAND}
+...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_OPTIONS}                 &>/dev/null
+${BGP_APP_PEER_TIMEOUT}                 30s
+${BGP_PEER_APP_NAME}                    example-bgp-peer-app
+${CONFIG_SESSION}                       session
+${RIB_INSTANCE}                         example-bgp-rib
+${PROTOCOL_OPENCONFIG}                  ${RIB_INSTANCE}
+${DEVICE_NAME}                          controller-config
+${BGP_PEER_NAME}                        example-bgp-peer
+${RIB_INSTANCE}                         example-bgp-rib
+${SCRIPT_URI_OPT}
+...                                     --uri data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=bgp-types%3Aipv4-address-family,bgp-types%3Aunicast-subsequent-address-family
+
 
 *** Test Cases ***
 Reconfigure_ODL_To_Accept_BGP_Peer_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Tags]    critical
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Reconfigure_ODL_To_Accept_BGP_Application_Peer
     [Documentation]    Configure BGP application peer module.
     [Tags]    critical
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=${BGP_PEER_APP_NAME}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    IP=${BGP_APP_PEER_ID}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=${BGP_PEER_APP_NAME}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    IP=${BGP_APP_PEER_ID}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Check_For_Empty_Example-IPv4-Topology
     [Documentation]    Sanity check example-ipv4-topology is up but empty.
@@ -129,7 +160,13 @@ TC1_BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     Switch_To_BGP_Peer_Console
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    nlri_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.32/28    1
@@ -152,7 +189,13 @@ TC1_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     Switch_To_BGP_Peer_Console
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    withdrawn_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
@@ -191,7 +234,13 @@ TC2_BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     Switch_To_BGP_Peer_Console
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    nlri_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.32/28    1
@@ -214,7 +263,13 @@ TC2_BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     Switch_To_BGP_Peer_Console
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    withdrawn_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
@@ -246,7 +301,13 @@ TC3_Reconnect_BGP_Peer_And_Check_Incomming_Updates_For_3_Introduced_Prefixes
     Switch_To_BGP_Peer_Console
     Start_Console_Tool    ${BGP_PEER_COMMAND}    ${BGP_PEER_OPTIONS}
     Read_And_Fail_If_Prompt_Is_Seen
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    nlri_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
@@ -270,7 +331,13 @@ TC3_BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     Switch_To_BGP_Peer_Console
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    3
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    10s
+    ...    1s
+    ...    Check_File_For_Word_Count
+    ...    bgp_peer.log
+    ...    withdrawn_prefix_received:
+    ...    3
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
@@ -286,14 +353,29 @@ TC3_Stop_BGP_Peer
 Delete_Bgp_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 Delete_Bgp_Application_Peer_Configuration
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=${BGP_PEER_APP_NAME}    IP=${ODL_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=${BGP_PEER_APP_NAME}
+    ...    IP=${ODL_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Setup_Everything
@@ -335,16 +417,23 @@ Switch_To_BGP_Application_Peer_Console
     SSHLibrary.Switch Connection    bgp_app_peer_console
 
 Wait_For_Topology_To_Change_To
-    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     [Documentation]    Wait until Compare_Topology matches expected result.
+    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${refresh}    Compare_Topology    ${folder_name}
 
 Verify_That_Topology_Does_Not_Change_From
-    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
     [Documentation]    Verify that Compare_Topology keeps passing, it will hold its last result.
-    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${timeout}    ${refresh}    Compare_Topology    ${folder_name}
+    [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
+    ...    ${timeout}
+    ...    ${refresh}
+    ...    Compare_Topology
+    ...    ${folder_name}
 
 Compare_Topology
-    [Arguments]    ${folder_name}
     [Documentation]    Get current example-ipv4-topology as json, and compare it to expected result.
-    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}${folder_name}    session=${CONFIG_SESSION}    verify=True
+    [Arguments]    ${folder_name}
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}${folder_name}
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
index 42ab199424571fd416e5f1d1f99f42aa7da7fbc6..b4c9cb8fe2c6ff58337325e969e3bb9a88945a69 100644 (file)
 *** Settings ***
-Documentation     Basic tests for eBGP application peers.
+Documentation       Basic tests for eBGP application peers.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic eBGP functional tests:
-...               Two eBGP peers advertise the same group of prefixes (aka BGP HA)
-...               https://wiki.opendaylight.org/view/BGP_LS_PCEP:BGP
-...               Reported bugs:
-...               Bug 4834 - ODL controller announces the same route twice (two eBGP scenario aka HA)
-...               Bug 4835 - Routes not withdrawn when eBGP peers are disconnected (the same prefixes announced)
+...                 Test suite performs basic eBGP functional tests:
+...                 Two eBGP peers advertise the same group of prefixes (aka BGP HA)
+...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:BGP
+...                 Reported bugs:
+...                 Bug 4834 - ODL controller announces the same route twice (two eBGP scenario aka HA)
+...                 Bug 4835 - Routes not withdrawn when eBGP peers are disconnected (the same prefixes announced)
 ...
-...               For versions Fluorine and above, there are test cases:
-...               TC_LAS (test case local AS)
-...               - configuration of ebgp with local-as and ibgp without local-as
-...               - connect bgp speakers (play.py) to both peers and check their connection
-...               - check adj-rib-out on both peers, expecting local-as in as-sequence on both peers.
+...                 For versions Fluorine and above, there are test cases:
+...                 TC_LAS (test case local AS)
+...                 - configuration of ebgp with local-as and ibgp without local-as
+...                 - connect bgp speakers (play.py) to both peers and check their connection
+...                 - check adj-rib-out on both peers, expecting local-as in as-sequence on both peers.
 ...
-...               TODO: Extend testsuite by tests dedicated to path selection algorithm
-...               TODO: Choose keywords used by more than one test suite to be placed in a common place.
-Suite Setup       Setup_Everything
-Suite Teardown    BgpOperations.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/BGPSpeaker.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../variables/Variables.robot
+...                 TODO: Extend testsuite by tests dedicated to path selection algorithm
+...                 TODO: Choose keywords used by more than one test suite to be placed in a common place.
+
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/BGPSpeaker.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      BgpOperations.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${BGP_PEER_LOG_LEVEL}    debug
-${CONFIG_SESSION}    config-session
-${HOLDTIME}       180
-${ODL_LOG_LEVEL}    INFO
-${ODL_BGP_LOG_LEVEL}    DEFAULT
-${iBGP_PEER1_IP}    127.0.0.1
-${eBGP_PEER1_IP}    127.0.0.3
-${eBGP_PEER2_IP}    127.0.0.4
-${iBGP_PEER1_FIRST_PREFIX_IP}    8.1.0.0
-${eBGP_PEERS_FIRST_PREFIX_IP}    8.0.0.0
-${eBGP_PEER1_FIRST_PREFIX_IP}    ${eBGP_PEERS_FIRST_PREFIX_IP}
-${eBGP_PEER2_FIRST_PREFIX_IP}    ${eBGP_PEERS_FIRST_PREFIX_IP}
-${eBGP_PEER1_NEXT_HOP}    1.1.1.1
-${eBGP_PEER2_NEXT_HOP}    2.2.2.2
-${PREFIX_LEN}     28
-${iBGP_PEER1_PREFIX_LEN}    ${PREFIX_LEN}
-${eBGP_PEER1_PREFIX_LEN}    ${PREFIX_LEN}
-${eBGP_PEER2_PREFIX_LEN}    ${PREFIX_LEN}
-${PREFIX_COUNT}    2
-${iBGP_PEER1_PREFIX_COUNT}    0
-${eBGP_PEER1_PREFIX_COUNT}    ${PREFIX_COUNT}
-${eBGP_PEER2_PREFIX_COUNT}    ${PREFIX_COUNT}
-${eBGP_PEERS_AS}    32768
-${eBGP_PEER1_AS}    ${eBGP_PEERS_AS}
-${eBGP_PEER2_AS}    ${eBGP_PEERS_AS}
-${iBGP_PEER1_LOG_FILE}    bgp_peer1.log
-${eBGP_PEER1_LOG_FILE}    ebgp_peer1.log
-${eBGP_PEER2_LOG_FILE}    ebgp_peer2.log
-${iBGP_PEER1_COMMAND}    python3 play.py --firstprefix ${iBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${iBGP_PEER1_PREFIX_LEN} --amount ${iBGP_PEER1_PREFIX_COUNT} --myip=${iBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${iBGP_PEER1_LOG_FILE}
-${eBGP_PEER1_COMMAND}    python3 play.py --firstprefix ${eBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${eBGP_PEER1_PREFIX_LEN} --amount ${eBGP_PEER1_PREFIX_COUNT} --myip=${eBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --nexthop ${eBGP_PEER1_NEXT_HOP} --asnumber ${eBGP_PEER1_AS} --${BGP_PEER_LOG_LEVEL} --logfile ${eBGP_PEER1_LOG_FILE}
-${eBGP_PEER2_COMMAND}    python3 play.py --firstprefix ${eBGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${eBGP_PEER2_PREFIX_LEN} --amount ${eBGP_PEER2_PREFIX_COUNT} --myip=${eBGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --nexthop ${eBGP_PEER2_NEXT_HOP} --asnumber ${eBGP_PEER2_AS} --${BGP_PEER_LOG_LEVEL} --logfile ${eBGP_PEER2_LOG_FILE}
-${iBGP_PEER1_OPTIONS}    &>${iBGP_PEER1_LOG_FILE}
-${eBGP_PEER1_OPTIONS}    &>${eBGP_PEER1_LOG_FILE}
-${eBGP_PEER2_OPTIONS}    &>${eBGP_PEER2_LOG_FILE}
-${DEFAULT_LOG_CHECK_TIMEOUT}    20s
-${DEFAULT_LOG_CHECK_PERIOD}    1s
-${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    10s
-${DEFAULT_TOPOLOGY_CHECK_PERIOD}    1s
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${DEVICE_NAME}    controller-config
-${DEFAULT_AS}     64496
-${LOCAL_AS}       65432
-${eBGP_AS}        64497
+${BGP_VARIABLES_FOLDER}                 ${CURDIR}/../../../variables/bgpuser/
+${BGP_PEER_LOG_LEVEL}                   debug
+${CONFIG_SESSION}                       config-session
+${HOLDTIME}                             180
+${ODL_LOG_LEVEL}                        INFO
+${ODL_BGP_LOG_LEVEL}                    DEFAULT
+${iBGP_PEER1_IP}                        127.0.0.1
+${eBGP_PEER1_IP}                        127.0.0.3
+${eBGP_PEER2_IP}                        127.0.0.4
+${iBGP_PEER1_FIRST_PREFIX_IP}           8.1.0.0
+${eBGP_PEERS_FIRST_PREFIX_IP}           8.0.0.0
+${eBGP_PEER1_FIRST_PREFIX_IP}           ${eBGP_PEERS_FIRST_PREFIX_IP}
+${eBGP_PEER2_FIRST_PREFIX_IP}           ${eBGP_PEERS_FIRST_PREFIX_IP}
+${eBGP_PEER1_NEXT_HOP}                  1.1.1.1
+${eBGP_PEER2_NEXT_HOP}                  2.2.2.2
+${PREFIX_LEN}                           28
+${iBGP_PEER1_PREFIX_LEN}                ${PREFIX_LEN}
+${eBGP_PEER1_PREFIX_LEN}                ${PREFIX_LEN}
+${eBGP_PEER2_PREFIX_LEN}                ${PREFIX_LEN}
+${PREFIX_COUNT}                         2
+${iBGP_PEER1_PREFIX_COUNT}              0
+${eBGP_PEER1_PREFIX_COUNT}              ${PREFIX_COUNT}
+${eBGP_PEER2_PREFIX_COUNT}              ${PREFIX_COUNT}
+${eBGP_PEERS_AS}                        32768
+${eBGP_PEER1_AS}                        ${eBGP_PEERS_AS}
+${eBGP_PEER2_AS}                        ${eBGP_PEERS_AS}
+${iBGP_PEER1_LOG_FILE}                  bgp_peer1.log
+${eBGP_PEER1_LOG_FILE}                  ebgp_peer1.log
+${eBGP_PEER2_LOG_FILE}                  ebgp_peer2.log
+${iBGP_PEER1_COMMAND}
+...                                     python3 play.py --firstprefix ${iBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${iBGP_PEER1_PREFIX_LEN} --amount ${iBGP_PEER1_PREFIX_COUNT} --myip=${iBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${iBGP_PEER1_LOG_FILE}
+${eBGP_PEER1_COMMAND}
+...                                     python3 play.py --firstprefix ${eBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${eBGP_PEER1_PREFIX_LEN} --amount ${eBGP_PEER1_PREFIX_COUNT} --myip=${eBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --nexthop ${eBGP_PEER1_NEXT_HOP} --asnumber ${eBGP_PEER1_AS} --${BGP_PEER_LOG_LEVEL} --logfile ${eBGP_PEER1_LOG_FILE}
+${eBGP_PEER2_COMMAND}
+...                                     python3 play.py --firstprefix ${eBGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${eBGP_PEER2_PREFIX_LEN} --amount ${eBGP_PEER2_PREFIX_COUNT} --myip=${eBGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --nexthop ${eBGP_PEER2_NEXT_HOP} --asnumber ${eBGP_PEER2_AS} --${BGP_PEER_LOG_LEVEL} --logfile ${eBGP_PEER2_LOG_FILE}
+${iBGP_PEER1_OPTIONS}                   &>${iBGP_PEER1_LOG_FILE}
+${eBGP_PEER1_OPTIONS}                   &>${eBGP_PEER1_LOG_FILE}
+${eBGP_PEER2_OPTIONS}                   &>${eBGP_PEER2_LOG_FILE}
+${DEFAULT_LOG_CHECK_TIMEOUT}            20s
+${DEFAULT_LOG_CHECK_PERIOD}             1s
+${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}       10s
+${DEFAULT_TOPOLOGY_CHECK_PERIOD}        1s
+${RIB_INSTANCE}                         example-bgp-rib
+${PROTOCOL_OPENCONFIG}                  ${RIB_INSTANCE}
+${DEVICE_NAME}                          controller-config
+${DEFAULT_AS}                           64496
+${LOCAL_AS}                             65432
+${eBGP_AS}                              64497
+
 
 *** Test Cases ***
 Configure_BGP_Peers
     [Documentation]    Configure an iBGP and two eBGP peers
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-ibgp-peer1    IP=${iBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ibgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-ibgp-peer1
+    ...    IP=${iBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ibgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=false
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-ebgp-peer1    IP=${eBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ebgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    ...    RR_CLIENT=false    AS_NUMBER=${eBGP_PEER1_AS}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-ebgp-peer1
+    ...    IP=${eBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ebgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    RR_CLIENT=false
+    ...    AS_NUMBER=${eBGP_PEER1_AS}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ebgp_peers    mapping=${mapping}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-ebgp-peer2    IP=${eBGP_PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ebgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    ...    RR_CLIENT=false    AS_NUMBER=${eBGP_PEER2_AS}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-ebgp-peer2
+    ...    IP=${eBGP_PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ebgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    RR_CLIENT=false
+    ...    AS_NUMBER=${eBGP_PEER2_AS}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ebgp_peers    mapping=${mapping}
 
 Connect_iBGP_Peer1
@@ -120,18 +159,37 @@ Connect_eBGP_Peer1
 
 Check_IPv4_Topology_For_First_Path
     [Documentation]    The IPv4 topology shall contain the route announced by the first eBGP
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    "node-id":"${eBGP_PEER1_NEXT_HOP}"
-    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    "prefix":"${eBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    "node-id":"${eBGP_PEER1_NEXT_HOP}"
+    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    "prefix":"${eBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"
 
 iBGP_Check_Log_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for introduced routes
     [Tags]    critical
     SSHLibrary.Switch Connection    ibgp_peer1_console
-    ${total_prefix_count}=    BuiltIn.Evaluate    ${eBGP_PEER1_PREFIX_COUNT}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    Check_File_For_Word_Count    ${iBGP_PEER1_LOG_FILE}    nlri_prefix_received:    ${total_prefix_count}
-    ${count}=    Count_Key_Value_Pairs    ${iBGP_PEER1_LOG_FILE}    Network Address of Next Hop    ${eBGP_PEER1_NEXT_HOP}
+    ${total_prefix_count}    BuiltIn.Evaluate    ${eBGP_PEER1_PREFIX_COUNT}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    Check_File_For_Word_Count
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${total_prefix_count}
+    ${count}    Count_Key_Value_Pairs
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    Network Address of Next Hop
+    ...    ${eBGP_PEER1_NEXT_HOP}
     BuiltIn.Should_Be_Equal_As_Integers    ${count}    ${eBGP_PEER1_PREFIX_COUNT}
-    ${count}=    Count_Key_Value_Pairs    ${iBGP_PEER1_LOG_FILE}    Network Address of Next Hop    ${eBGP_PEER2_NEXT_HOP}
+    ${count}    Count_Key_Value_Pairs
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    Network Address of Next Hop
+    ...    ${eBGP_PEER2_NEXT_HOP}
     BuiltIn.Should_Be_Equal_As_Integers    ${count}    0
 
 Connect_eBGP_Peer2
@@ -150,18 +208,37 @@ Disconnect_eBGP_Peer1
 
 Check_IPv4_Topology_For_Second_Path
     [Documentation]    The IPv4 topology shall contain the route announced by the second eBGP now
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    "node-id":"${eBGP_PEER2_NEXT_HOP}"
-    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    "prefix":"${eBGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    "node-id":"${eBGP_PEER2_NEXT_HOP}"
+    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    "prefix":"${eBGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"
 
 iBGP_Check_Log_For_Updated_Prefixes
     [Documentation]    Check incomming updates for updated routes
     [Tags]    critical
     SSHLibrary.Switch Connection    ibgp_peer1_console
-    ${total_prefix_count}=    BuiltIn.Evaluate    ${eBGP_PEER1_PREFIX_COUNT} + ${eBGP_PEER2_PREFIX_COUNT}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    Check_File_For_Word_Count    ${iBGP_PEER1_LOG_FILE}    nlri_prefix_received:    ${total_prefix_count}
-    ${count}=    Count_Key_Value_Pairs    ${iBGP_PEER1_LOG_FILE}    Network Address of Next Hop    ${eBGP_PEER1_NEXT_HOP}
+    ${total_prefix_count}    BuiltIn.Evaluate    ${eBGP_PEER1_PREFIX_COUNT} + ${eBGP_PEER2_PREFIX_COUNT}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    Check_File_For_Word_Count
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${total_prefix_count}
+    ${count}    Count_Key_Value_Pairs
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    Network Address of Next Hop
+    ...    ${eBGP_PEER1_NEXT_HOP}
     BuiltIn.Should_Be_Equal_As_Integers    ${count}    ${eBGP_PEER1_PREFIX_COUNT}
-    ${count}=    Count_Key_Value_Pairs    ${iBGP_PEER1_LOG_FILE}    Network Address of Next Hop    ${eBGP_PEER2_NEXT_HOP}
+    ${count}    Count_Key_Value_Pairs
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    Network Address of Next Hop
+    ...    ${eBGP_PEER2_NEXT_HOP}
     BuiltIn.Should_Be_Equal_As_Integers    ${count}    ${eBGP_PEER2_PREFIX_COUNT}
     [Teardown]    Report_Failure_Due_To_Bug    4834
 
@@ -174,15 +251,26 @@ Disconnect_eBGP_Peer2
 
 Check_For_Empty_IPv4_Topology
     [Documentation]    The IPv4 topology shall be empty
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain    ${CONFIG_SESSION}    prefix
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    prefix
     [Teardown]    Report_Failure_Due_To_Bug    4835
 
 iBGP_Check_Log_For_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for withdrawn routes
     [Tags]    critical
     SSHLibrary.Switch Connection    ibgp_peer1_console
-    ${prefixes_to_be_removed}=    BuiltIn.Evaluate    max(${eBGP_PEER1_PREFIX_COUNT}, ${eBGP_PEER2_PREFIX_COUNT})
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    Check_File_For_Word_Count    ${iBGP_PEER1_LOG_FILE}    withdrawn_prefix_received:    ${prefixes_to_be_removed}
+    ${prefixes_to_be_removed}    BuiltIn.Evaluate    max(${eBGP_PEER1_PREFIX_COUNT}, ${eBGP_PEER2_PREFIX_COUNT})
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    Check_File_For_Word_Count
+    ...    ${iBGP_PEER1_LOG_FILE}
+    ...    withdrawn_prefix_received:
+    ...    ${prefixes_to_be_removed}
     [Teardown]    Report_Failure_Due_To_Bug    4835
 
 Disconnect_iBGP_Peer1
@@ -195,7 +283,11 @@ Disconnect_iBGP_Peer1
 Delete_BGP_Peers_Configuration
     [Documentation]    Delete all previously configured BGP peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-ibgp-peer1    IP=${iBGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-ibgp-peer1
+    ...    IP=${iBGP_PEER1_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}
     Collections.Set To Dictionary    ${mapping}    NAME=example-ebgp-peer1    IP=${eBGP_PEER1_IP}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ebgp_peers    mapping=${mapping}
@@ -204,53 +296,110 @@ Delete_BGP_Peers_Configuration
 
 TC_LAS_Reconfigure_Odl_To_Accept_Connection
     [Documentation]    Configure neighbors. One ibgp and one ebgp neighbor with local-as configured.
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
-    &{mapping}    Create Dictionary    IP=${iBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
+    &{mapping}    Create Dictionary
+    ...    IP=${iBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
-    &{mapping}    Create Dictionary    IP=${eBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    ...    AS_NUMBER=${LOCAL_AS}    PEER_AS=${eBGP_AS}
+    &{mapping}    Create Dictionary
+    ...    IP=${eBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    AS_NUMBER=${LOCAL_AS}
+    ...    PEER_AS=${eBGP_AS}
     TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}local_as/ebgp_peer    mapping=${mapping}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
 TC_LAS_Start_iBgp_Speaker_And_Verify_Connected
     [Documentation]    Verify that peer is present in odl's rib. Peer is configured with local-as.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
     SSHLibrary.Switch Connection    ibgp_peer1_console
-    ${speaker_args}    BuiltIn.Set_Variable    --firstprefix ${iBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --myip=${iBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
-    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected    ${speaker_args}    session=default    speaker_ip=${iBGP_PEER1_IP}
+    ${speaker_args}    BuiltIn.Set_Variable
+    ...    --firstprefix ${iBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --myip=${iBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
+    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected
+    ...    ${speaker_args}
+    ...    session=default
+    ...    speaker_ip=${iBGP_PEER1_IP}
     BuiltIn.Log    ${output}
 
 TC_LAS_Start_eBgp_Speaker_And_Verify_Connected
     [Documentation]    Verify that peer is present in odl's rib. Peer is configured with local-as.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
     SSHLibrary.Switch Connection    ebgp_peer1_console
-    ${speaker_args}    BuiltIn.Set_Variable    --firstprefix ${eBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --asnumber=${eBGP_AS} --myip=${eBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
-    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected    ${speaker_args}    session=default    speaker_ip=${eBGP_PEER1_IP}
+    ${speaker_args}    BuiltIn.Set_Variable
+    ...    --firstprefix ${eBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --asnumber=${eBGP_AS} --myip=${eBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
+    ${output}    BGPSpeaker.Start_BGP_Speaker_And_Verify_Connected
+    ...    ${speaker_args}
+    ...    session=default
+    ...    speaker_ip=${eBGP_PEER1_IP}
     BuiltIn.Log    ${output}
 
 TC_LAS_Verify_iBGP_Rib_Out
     [Documentation]    Verifies iBGP's adj-rib-out output. Expects local-as, and ebgp peer-as presence.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
-    &{mapping}    Create Dictionary    IP=${iBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    ...    AS_NUMBER=${LOCAL_AS}    PEER_AS=${eBGP_AS}    PREFIXLEN=${eBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}local_as/adj_rib_out    mapping=${mapping}    verify=True
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
+    &{mapping}    Create Dictionary
+    ...    IP=${iBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    AS_NUMBER=${LOCAL_AS}
+    ...    PEER_AS=${eBGP_AS}
+    ...    PREFIXLEN=${eBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}local_as/adj_rib_out
+    ...    mapping=${mapping}
+    ...    verify=True
 
 TC_LAS_Verify_eBGP_Rib_Out
     [Documentation]    Verifies eBGP's adj-rib-out output. Expects local-as, and ibgp peer-as presence.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
-    &{mapping}    Create Dictionary    IP=${eBGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    ...    AS_NUMBER=${LOCAL_AS}    PEER_AS=${DEFAULT_AS}    PREFIXLEN=${iBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}local_as/adj_rib_out    mapping=${mapping}    verify=True
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
+    &{mapping}    Create Dictionary
+    ...    IP=${eBGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    AS_NUMBER=${LOCAL_AS}
+    ...    PEER_AS=${DEFAULT_AS}
+    ...    PREFIXLEN=${iBGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}local_as/adj_rib_out
+    ...    mapping=${mapping}
+    ...    verify=True
 
 TC_LAS_Kill_iBgp_Speaker_After_Talking
     [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_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
     SSHLibrary.Switch Connection    ibgp_peer1_console
     BGPSpeaker.Kill_BGP_Speaker
     FailFast.Do_Not_Fail_Fast_From_Now_On
@@ -261,7 +410,9 @@ TC_LAS_Kill_eBgp_Speaker_After_Talking
     [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_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
     SSHLibrary.Switch Connection    ebgp_peer1_console
     BGPSpeaker.Kill_BGP_Speaker
     FailFast.Do_Not_Fail_Fast_From_Now_On
@@ -270,13 +421,16 @@ TC_LAS_Kill_eBgp_Speaker_After_Talking
 
 TC_LAS_Delete_Bgp_Peer_Configurations
     [Documentation]    Delete peer configuration.
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid only for versions fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid only for versions fluorine and above.
     &{mapping}    Create Dictionary    IP=${iBGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}
     &{mapping}    Create Dictionary    IP=${eBGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}local_as/ebgp_peer    mapping=${mapping}
     [Teardown]    SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 
+
 *** Keywords ***
 Setup_Everything
     [Documentation]    Initialize SetupUtils. SSH-login to mininet machine, create HTTP session,
@@ -295,18 +449,20 @@ Setup_Everything
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     TemplatedRequests.Create_Default_Session
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_LOG_LEVEL}
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
 
 Read_Text_Before_Prompt
     [Documentation]    Log text gathered by SSHLibrary.Read_Until_Prompt.
     ...    This needs to be a separate keyword just because how Read_And_Fail_If_Prompt_Is_Seen is implemented.
-    ${text}=    SSHLibrary.Read_Until_Prompt
+    ${text}    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${text}
 
 Store_File_To_Workspace
-    [Arguments]    ${source_file_name}    ${target_file_name}
     [Documentation]    Store the ${source_file_name} to the workspace as ${target_file_name}.
-    ${output_log}=    SSHLibrary.Execute_Command    cat ${source_file_name}
+    [Arguments]    ${source_file_name}    ${target_file_name}
+    ${output_log}    SSHLibrary.Execute_Command    cat ${source_file_name}
     BuiltIn.Log    ${output_log}
     Create File    ${target_file_name}    ${output_log}
index 2bb7d649012d0042f9e21850b49c53370030a1d0..a144bbd1ae78282f25f9d7b19b1bbcfdad264d92 100644 (file)
@@ -1,59 +1,76 @@
 *** Settings ***
-Documentation     Basic tests for iBGP peers.
+Documentation       Basic tests for iBGP peers.
 ...
-...               Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic iBGP functional test case for
-...               carrying LSP State Information in BGP as described in
-...               http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03
-Suite Setup       Setup_Everything
-Suite Teardown    BgpOperations.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           DateTime
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/WaitForFailure.robot
-Resource          ../../../variables/Variables.robot
+...                 Test suite performs basic iBGP functional test case for
+...                 carrying LSP State Information in BGP as described in
+...                 http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03
+
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             DateTime
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/WaitForFailure.robot
+Resource            ../../../variables/Variables.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      BgpOperations.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${COUNT}          1
-${HOLDTIME}       180
-${BGP_PEER_LOG_FILE}    bgp_peer.log
-${BGP_PEER_COMMAND}    python3 play.py --amount ${COUNT} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER_LOG_FILE} --bgpls True
-${BGP_PEER_OPTIONS}    &>${BGP_PEER_LOG_FILE}
-${DEFAULT_RIB_CHECK_PERIOD}    1s
+${BGP_VARIABLES_FOLDER}         ${CURDIR}/../../../variables/bgpuser/
+${COUNT}                        1
+${HOLDTIME}                     180
+${BGP_PEER_LOG_FILE}            bgp_peer.log
+${BGP_PEER_COMMAND}
+...                             python3 play.py --amount ${COUNT} --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER_LOG_FILE} --bgpls True
+${BGP_PEER_OPTIONS}             &>${BGP_PEER_LOG_FILE}
+${DEFAULT_RIB_CHECK_PERIOD}     1s
 ${DEFAULT_RIB_CHECK_TIMEOUT}    10s
-${BGP_PEER_LOG_LEVEL}    debug
-${JSONKEYSTR}     "linkstate-route"
-${BGP_PEER_NAME}    example-bgp-peer
-${DEVICE_NAME}    controller-config
-${CONFIG_SESSION}    config-session
-${SKIP_PARAMS}    --skipattr
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
-${OLD_ROUTE_KEY}    [0, 5, 0, 21, 7, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 0, 1, 0, 1, 5, 6, 7, 8]
-${NEW_ROUTE_KEY}    AAUAFQcAAAAAAAAAAQECAwQAAQABBQYHCA==
+${BGP_PEER_LOG_LEVEL}           debug
+${JSONKEYSTR}                   "linkstate-route"
+${BGP_PEER_NAME}                example-bgp-peer
+${DEVICE_NAME}                  controller-config
+${CONFIG_SESSION}               config-session
+${SKIP_PARAMS}                  --skipattr
+${RIB_INSTANCE}                 example-bgp-rib
+${PROTOCOL_OPENCONFIG}          ${RIB_INSTANCE}
+${OLD_ROUTE_KEY}                [0, 5, 0, 21, 7, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 0, 1, 0, 1, 5, 6, 7, 8]
+${NEW_ROUTE_KEY}                AAUAFQcAAAAAAAAAAQECAwQAAQABBQYHCA==
+
 
 *** Test Cases ***
 TC1_Configure_iBGP_Peer
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
     [Tags]    critical
-    &{mapping}    Create Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    Create Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC1_Check_Example_Bgp_Rib_Is_Empty
     [Documentation]    Check RIB for none linkstate-routes
@@ -63,14 +80,21 @@ TC1_Check_Example_Bgp_Rib_Is_Empty
 TC1_Connect_BGP_Peer
     [Documentation]    Connect BGP peer with advertising the routes without mandatory params like LOC_PREF.
     [Tags]    critical
-    BuiltIn.Run_Keyword_And_Ignore_Error    KarafKeywords.Log_Message_To_Controller_Karaf    Error = WELL_KNOWN_ATTR_MISSING is EXPECTED in this test case, and should be thrown when missing mandatory attributes.
+    BuiltIn.Run_Keyword_And_Ignore_Error
+    ...    KarafKeywords.Log_Message_To_Controller_Karaf
+    ...    Error = WELL_KNOWN_ATTR_MISSING is EXPECTED in this test case, and should be thrown when missing mandatory attributes.
     BGPcliKeywords.Start_Console_Tool    ${BGP_PEER_COMMAND} ${SKIP_PARAMS}    ${BGP_PEER_OPTIONS}
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
 
 TC1_Check_Example_Bgp_Rib
     [Documentation]    Check RIB for not containig linkstate-route(s), because update messages were not good.
     [Tags]    critical
-    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DEFAULT_RIB_CHECK_TIMEOUT}    ${DEFAULT_RIB_CHECK_PERIOD}    BgpOperations.Check_Example_Bgp_Rib_Does_Not_Contain    ${CONFIG_SESSION}    ${JSONKEYSTR}
+    WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
+    ...    ${DEFAULT_RIB_CHECK_TIMEOUT}
+    ...    ${DEFAULT_RIB_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_Bgp_Rib_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    ${JSONKEYSTR}
 
 TC1_Disconnect_BGP_Peer
     [Documentation]    Stop BGP peer & store logs
@@ -80,14 +104,32 @@ TC1_Disconnect_BGP_Peer
 
 TC1_Deconfigure_iBGP_Peer
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC2_Configure_iBGP_Peer
     [Documentation]    Configures BGP peer module with initiate-connection set to false.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    INITIATE=false    RIB_INSTANCE_NAME=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    INITIATE=false
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC2_Check_Example_Bgp_Rib_Is_Empty
     [Documentation]    Check RIB for none linkstate-routes
@@ -103,9 +145,15 @@ TC2_Connect_BGP_Peer
 TC2_Check_Example_Bgp_Rib
     [Documentation]    Check RIB for linkstate-route(s) and check all of their attributes.
     [Tags]    critical
-    ${route_key}    CompareStream.Set_Variable_If_At_Least_Fluorine    ${NEW_ROUTE_KEY}    ${OLD_ROUTE_KEY}
+    ${route_key}    CompareStream.Set_Variable_If_At_Least_Fluorine    ${NEW_ROUTE_KEY}    ${OLD_ROUTE_KEY}
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    ROUTE_KEY=${route_key}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_RIB_CHECK_TIMEOUT}    ${DEFAULT_RIB_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}/lsp/effective_rib_in    mapping=${mapping}    session=${CONFIG_SESSION}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_RIB_CHECK_TIMEOUT}
+    ...    ${DEFAULT_RIB_CHECK_PERIOD}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/lsp/effective_rib_in
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 TC2_Disconnect_BGP_Peer
@@ -116,8 +164,16 @@ TC2_Disconnect_BGP_Peer
 
 TC2_Deconfigure_iBGP_Peer
     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    BGP_NAME=${BGP_PEER_NAME}    IP=${TOOLS_SYSTEM_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    BGP_NAME=${BGP_PEER_NAME}
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}/bgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Setup_Everything
index 195a1c0de81e63dba9c4aea5c73561e05455e921..61ccf7ecd54cb8e4b410efdd27ac1d18ee10d602 100644 (file)
 *** Settings ***
-Documentation     Basic tests for iBGP peers.
+Documentation       Basic tests for iBGP peers.
 ...
-...               Copyright (c) 2015-2018 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015-2018 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic iBGP functional test cases for
-...               BGP peers in different roles (iBGP, iBGP RR-client):
+...                 Test suite performs basic iBGP functional test cases for
+...                 BGP peers in different roles (iBGP, iBGP RR-client):
 ...
-...               Test Case 1: Two iBGP RR-client peers introduce prefixes
-...               Expected result: controller forwards updates towards both peers
+...                 Test Case 1: Two iBGP RR-client peers introduce prefixes
+...                 Expected result: controller forwards updates towards both peers
 ...
-...               Test Case 2: Two iBGP peers: one RR client and one non-client introduces prefixes
-...               Expected result: controller forwards updates towards both peers
+...                 Test Case 2: Two iBGP peers: one RR client and one non-client introduces prefixes
+...                 Expected result: controller forwards updates towards both peers
 ...
-...               Test Case 3: Two iBGP RR non-client peers introduce prefixes
-...               Expected result: controller does not forward any update towards peers
+...                 Test Case 3: Two iBGP RR non-client peers introduce prefixes
+...                 Expected result: controller does not forward any update towards peers
 ...
-...               Test Case 4: Two iBGP(play.py) RR-client peers configured, first of them configured
-...               with route-reflector-cluster-id, second inherits it's cluster-id from global config.
-...               Each of them introduces 3 prefixes.
-...               Expected result: controller forwards updates towards both peers and each of their
-...               adj-rib-in contains routes. First peer should contain default cluster-id and
-...               second cluster-id from first peers configuration.
+...                 Test Case 4: Two iBGP(play.py) RR-client peers configured, first of them configured
+...                 with route-reflector-cluster-id, second inherits it's cluster-id from global config.
+...                 Each of them introduces 3 prefixes.
+...                 Expected result: controller forwards updates towards both peers and each of their
+...                 adj-rib-in contains routes. First peer should contain default cluster-id and
+...                 second cluster-id from first peers configuration.
 ...
-...               For polices see: https://wiki.opendaylight.org/view/BGP_LS_PCEP:BGP
-Suite Setup       Setup_Everything
-Suite Teardown    BgpOperations.Teardown_Everything
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           DateTime
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/BGPcliKeywords.robot
-Resource          ../../../libraries/BgpOperations.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/SSHKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/CompareStream.robot
+...                 For polices see: https://wiki.opendaylight.org/view/BGP_LS_PCEP:BGP
+
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             DateTime
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/BGPcliKeywords.robot
+Resource            ../../../libraries/BgpOperations.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/SetupUtils.robot
+Resource            ../../../libraries/SSHKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/CompareStream.robot
+
+Suite Setup         Setup_Everything
+Suite Teardown      BgpOperations.Teardown_Everything
+Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
-${BGP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/bgpuser/
-${HOLDTIME}       180
-${BGP_PEER_LOG_LEVEL}    debug
-${ODL_LOG_LEVEL}    INFO
-${ODL_BGP_LOG_LEVEL}    DEFAULT
-${DEVICE_NAME}    controller-config
-${BGP_PEER1_IP}    127.0.0.1
-${BGP_PEER2_IP}    127.0.0.2
-${BGP_PEER1_FIRST_PREFIX_IP}    8.1.0.0
-${BGP_PEER2_FIRST_PREFIX_IP}    8.2.0.0
-${PREFIX_LEN}     28
-${BGP_PEER1_PREFIX_LEN}    ${PREFIX_LEN}
-${BGP_PEER2_PREFIX_LEN}    ${PREFIX_LEN}
-${PREFIX_COUNT}    3
-${BGP_PEER1_PREFIX_COUNT}    ${PREFIX_COUNT}
-${BGP_PEER2_PREFIX_COUNT}    ${PREFIX_COUNT}
-${BGP_PEER1_LOG_FILE}    bgp_peer1.log
-${BGP_PEER2_LOG_FILE}    bgp_peer2.log
-${BGP_PEER1_COMMAND}    python3 play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
-${BGP_PEER2_COMMAND}    python3 play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
-${BGP_PEER1_OPTIONS}    &>${BGP_PEER1_LOG_FILE}
-${BGP_PEER2_OPTIONS}    &>${BGP_PEER2_LOG_FILE}
-${DEFAULT_LOG_CHECK_TIMEOUT}    20s
-${DEFAULT_LOG_CHECK_PERIOD}    1s
-${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    10s
-${DEFAULT_TOPOLOGY_CHECK_PERIOD}    1s
-${CONFIG_SESSION}    session
-${RIB_INSTANCE}    example-bgp-rib
-${PROTOCOL_OPENCONFIG}    ${RIB_INSTANCE}
+${BGP_VARIABLES_FOLDER}                 ${CURDIR}/../../../variables/bgpuser/
+${HOLDTIME}                             180
+${BGP_PEER_LOG_LEVEL}                   debug
+${ODL_LOG_LEVEL}                        INFO
+${ODL_BGP_LOG_LEVEL}                    DEFAULT
+${DEVICE_NAME}                          controller-config
+${BGP_PEER1_IP}                         127.0.0.1
+${BGP_PEER2_IP}                         127.0.0.2
+${BGP_PEER1_FIRST_PREFIX_IP}            8.1.0.0
+${BGP_PEER2_FIRST_PREFIX_IP}            8.2.0.0
+${PREFIX_LEN}                           28
+${BGP_PEER1_PREFIX_LEN}                 ${PREFIX_LEN}
+${BGP_PEER2_PREFIX_LEN}                 ${PREFIX_LEN}
+${PREFIX_COUNT}                         3
+${BGP_PEER1_PREFIX_COUNT}               ${PREFIX_COUNT}
+${BGP_PEER2_PREFIX_COUNT}               ${PREFIX_COUNT}
+${BGP_PEER1_LOG_FILE}                   bgp_peer1.log
+${BGP_PEER2_LOG_FILE}                   bgp_peer2.log
+${BGP_PEER1_COMMAND}
+...                                     python3 play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
+${BGP_PEER2_COMMAND}
+...                                     python3 play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
+${BGP_PEER1_OPTIONS}                    &>${BGP_PEER1_LOG_FILE}
+${BGP_PEER2_OPTIONS}                    &>${BGP_PEER2_LOG_FILE}
+${DEFAULT_LOG_CHECK_TIMEOUT}            20s
+${DEFAULT_LOG_CHECK_PERIOD}             1s
+${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}       10s
+${DEFAULT_TOPOLOGY_CHECK_PERIOD}        1s
+${CONFIG_SESSION}                       session
+${RIB_INSTANCE}                         example-bgp-rib
+${PROTOCOL_OPENCONFIG}                  ${RIB_INSTANCE}
+
 
 *** Test Cases ***
 TC1_Configure_Two_iBGP_Route_Reflector_Client_Peers
     [Documentation]    Configure two iBGP peers as routing reflector clients.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=rr-client    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=rr-client
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=rr-client    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=rr-client
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC1_Connect_BGP_Peer1
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER1_COMMAND}    ${BGP_PEER1_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC1_Connect_BGP_Peer2
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER2_COMMAND}    ${BGP_PEER2_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC1_BGP_Peer1_Check_Log_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    nlri_prefix_received:    ${BGP_PEER2_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${BGP_PEER2_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN}
+    ...    1
     BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    withdrawn_prefix_received:    0
 
 TC1_BGP_Peer2_Check_Log_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    nlri_prefix_received:    ${BGP_PEER1_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${BGP_PEER1_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}
+    ...    1
     BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received:    0
 
 TC1_Disconnect_BGP_Peer1
@@ -128,8 +188,17 @@ TC1_BGP_Peer2_Check_Log_For_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for withdrawn routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received:    ${BGP_PEER1_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    withdrawn_prefix_received:
+    ...    ${BGP_PEER1_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}
+    ...    1
 
 TC1_Disconnect_BGP_Peer2
     [Documentation]    Stop BGP peer & store logs
@@ -139,56 +208,129 @@ TC1_Disconnect_BGP_Peer2
     BGPCliKeywords.Store_File_To_Workspace    ${BGP_PEER2_LOG_FILE}    tc1_${BGP_PEER2_LOG_FILE}
 
 TC_1_Check_for_Empty_IPv4_Topology
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain    ${CONFIG_SESSION}    prefix
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    prefix
 
 TC1_Delete_BGP_Peers_Configuration
     [Documentation]    Delete all previously configured BGP peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC2_Configure_One_iBGP_Route_Reflector_Client_And_One_iBGP_Non_Client
     [Documentation]    Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=rr-client    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=rr-client
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ibgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ibgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=false
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC2_Connect_BGP_Peer1
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER1_COMMAND}    ${BGP_PEER1_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC2_Connect_BGP_Peer2
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER2_COMMAND}    ${BGP_PEER2_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC2_BGP_Peer1_Check_Log_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    nlri_prefix_received:    ${BGP_PEER2_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${BGP_PEER2_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER1_LOG_FILE}
+    ...    nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN}
+    ...    1
     BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    withdrawn_prefix_received:    0
 
 TC2_BGP_Peer2_Check_Log_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    nlri_prefix_received:    ${BGP_PEER1_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    nlri_prefix_received:
+    ...    ${BGP_PEER1_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}
+    ...    1
     BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received:    0
 
 TC2_Disconnect_BGP_Peer1
@@ -202,8 +344,17 @@ TC2_BGP_Peer2_Check_Log_For_Withdrawn_Prefixes
     [Documentation]    Check incomming updates for withdrawn routes
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received:    ${BGP_PEER1_PREFIX_COUNT}
-    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}    1
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    withdrawn_prefix_received:
+    ...    ${BGP_PEER1_PREFIX_COUNT}
+    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN}
+    ...    1
 
 TC2_Disconnect_BGP_Peer2
     [Documentation]    Stop BGP peer & store logs
@@ -213,41 +364,96 @@ TC2_Disconnect_BGP_Peer2
     BGPCliKeywords.Store_File_To_Workspace    ${BGP_PEER2_LOG_FILE}    tc2_${BGP_PEER2_LOG_FILE}
 
 TC_2_Check_for_Empty_IPv4_Topology
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain    ${CONFIG_SESSION}    prefix
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    prefix
 
 TC2_Delete_BGP_Peers_Configuration
     [Documentation]    Delete all previously configured BGP peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC3_Configure_Two_iBGP_Non_Client_Peers
     [Documentation]    Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ibgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ibgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=false
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}
-    ...    PEER_ROLE=ibgp    INITIATE=false    BGP_RIB=${RIB_INSTANCE}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    RIB_INSTANCE_NAME=${RIB_INSTANCE}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PEER_ROLE=ibgp
+    ...    INITIATE=false
+    ...    BGP_RIB=${RIB_INSTANCE}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
     ...    RR_CLIENT=false
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC3_Connect_BGP_Peer1
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER1_COMMAND}    ${BGP_PEER1_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC3_Connect_BGP_Peer2
     [Documentation]    Connect BGP peer
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER2_COMMAND}    ${BGP_PEER2_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC3_BGP_Peer1_Check_Log_For_No_Updates
     [Documentation]    Check for no updates received by iBGP peer No. 1
@@ -255,7 +461,13 @@ TC3_BGP_Peer1_Check_Log_For_No_Updates
     SSHLibrary.Switch Connection    bgp_peer1_console
     Comment    From neon onwards there is extra BGP End-Of-RIB message
     ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    0    1
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    total_received_update_message_counter: ${update_messages}    2
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_LOG_CHECK_TIMEOUT}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER1_LOG_FILE}
+    ...    total_received_update_message_counter: ${update_messages}
+    ...    2
 
 TC3_Disconnect_BGP_Peer1
     [Documentation]    Stop BGP peer & store logs
@@ -268,10 +480,16 @@ TC3_BGP_Peer2_Check_Log_For_No_Updates
     [Documentation]    Consequent check for no updates received by iBGP peer No. 2
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
-    ${log_check_timeout}=    DateTime.Convert_Time    ${DEFAULT_LOG_CHECK_TIMEOUT}    result_format=number
+    ${log_check_timeout}    DateTime.Convert_Time    ${DEFAULT_LOG_CHECK_TIMEOUT}    result_format=number
     Comment    From neon onwards there is extra BGP End-Of-RIB message
     ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    0    1
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${log_check_timeout*2}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    total_received_update_message_counter: ${update_messages}    4
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${log_check_timeout*2}
+    ...    ${DEFAULT_LOG_CHECK_PERIOD}
+    ...    BGPCliKeywords.Check_File_For_Word_Count
+    ...    ${BGP_PEER2_LOG_FILE}
+    ...    total_received_update_message_counter: ${update_messages}
+    ...    4
 
 TC3_Disconnect_BGP_Peer2
     [Documentation]    Stop BGP peer & store logs
@@ -281,63 +499,140 @@ TC3_Disconnect_BGP_Peer2
     BGPCliKeywords.Store_File_To_Workspace    ${BGP_PEER2_LOG_FILE}    tc3_${BGP_PEER2_LOG_FILE}
 
 TC_3_Check_for_Empty_IPv4_Topology
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain    ${CONFIG_SESSION}    prefix
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    prefix
 
 TC3_Delete_BGP_Peers_Configuration
     [Documentation]    Delete all previously configured BGP peers.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer1    IP=${BGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    DEVICE_NAME=${DEVICE_NAME}    NAME=example-bgp-peer2    IP=${BGP_PEER2_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer1
+    ...    IP=${BGP_PEER1_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    DEVICE_NAME=${DEVICE_NAME}
+    ...    NAME=example-bgp-peer2
+    ...    IP=${BGP_PEER2_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC4_Configure_Two_iBGP_RR_Clients_With_Cluster_Id
     [Documentation]    Configure two iBGP peers as routing reflector clients with cluster-id argument.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER1_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${BGP_PEER1_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     ...    RR_CLIENT=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}cluster_id/ibgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER2_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}cluster_id/ibgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${BGP_PEER2_IP}
+    ...    HOLDTIME=${HOLDTIME}
+    ...    PEER_PORT=${BGP_TOOL_PORT}
+    ...    PASSIVE_MODE=true
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
     ...    RR_CLIENT=true
-    TemplatedRequests.Put_As_Xml_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Put_As_Xml_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
 
 TC4_Connect_BGP_Peers
     [Documentation]    Connect BGP peers, each set to send 3 prefixes.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
     SSHLibrary.Switch Connection    bgp_peer1_console
     BuiltIn.Set_Suite_Variable    ${peer1_cluster_id}    127.0.0.4
     BuiltIn.Set_Suite_Variable    ${default_cluster_id}    192.0.2.2
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER1_COMMAND} --cluster=${peer1_cluster_id}    ${BGP_PEER1_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
     SSHLibrary.Switch Connection    bgp_peer2_console
     BGPCliKeywords.Start_Console_Tool    ${BGP_PEER2_COMMAND} --cluster=${BGP_PEER2_IP}    ${BGP_PEER2_OPTIONS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Content    ${CONFIG_SESSION}    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Content
+    ...    ${CONFIG_SESSION}
+    ...    {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
 
 TC4_BGP_Peer1_Check_Rib_Out_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes and respective cluster-ids
     ...    on first peer which should contain default-cluster id from global config reflected
     ...    from the second peer equal to router-id.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    PEER_NUMBER=2    CLUSTER_ID=${BGP_PEER2_IP}    DEFAULT_ID=${default_cluster_id}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out    mapping=${mapping}    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${BGP_PEER1_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    PEER_NUMBER=2
+    ...    CLUSTER_ID=${BGP_PEER2_IP}
+    ...    DEFAULT_ID=${default_cluster_id}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 TC4_BGP_Peer2_Check_Rib_Out_For_Introduced_Prefixes
     [Documentation]    Check incomming updates for new routes and respective cluster-ids
     ...    in second peer which has local route-reflector-cluster-id
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER2_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}    PEER_NUMBER=1    CLUSTER_ID=${BGP_PEER1_IP}    DEFAULT_ID=${peer1_cluster_id}
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out    mapping=${mapping}    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${BGP_PEER2_IP}
+    ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+    ...    PEER_NUMBER=1
+    ...    CLUSTER_ID=${BGP_PEER1_IP}
+    ...    DEFAULT_ID=${peer1_cluster_id}
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     ...    verify=True
 
 TC4_Disconnect_BGP_Peers
     [Documentation]    Stop BGP peer & store logs
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
     SSHLibrary.Switch Connection    bgp_peer1_console
     BGPCliKeywords.Stop_Console_Tool
     BGPCliKeywords.Store_File_To_Workspace    ${BGP_PEER1_LOG_FILE}    tc4_${BGP_PEER1_LOG_FILE}
@@ -347,17 +642,33 @@ TC4_Disconnect_BGP_Peers
 
 TC4_Check_for_Empty_IPv4_Topology
     [Documentation]    Checks for empty topology after
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain    ${CONFIG_SESSION}    prefix
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
+    ...    ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
+    ...    BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain
+    ...    ${CONFIG_SESSION}
+    ...    prefix
 
 TC4_Delete_BGP_Peers_Configuration
     [Documentation]    Delete all previously configured BGP peers.
     [Tags]    critical
-    CompareStream.Run_Keyword_If_Less_Than_Fluorine    BuiltIn.Pass_Execution    Test case valid for version fluorine and above.
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine
+    ...    BuiltIn.Pass_Execution
+    ...    Test case valid for version fluorine and above.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER1_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}cluster_id/ibgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}cluster_id/ibgp_peer
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
     &{mapping}    BuiltIn.Create_Dictionary    IP=${BGP_PEER2_IP}    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Delete_Templated    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers    mapping=${mapping}    session=${CONFIG_SESSION}
+    TemplatedRequests.Delete_Templated
+    ...    ${BGP_VARIABLES_FOLDER}${/}ibgp_peers
+    ...    mapping=${mapping}
+    ...    session=${CONFIG_SESSION}
+
 
 *** Keywords ***
 Setup_Everything
@@ -375,5 +686,7 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_LOG_LEVEL}
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
-    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background
+    ...    log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
index 6e15be212506a56df06e2fcd20222272362bf9b5..4e1b6f7cf5bdeef8a31d783a67ba76c4ce9a8736 100644 (file)
@@ -1,31 +1,35 @@
 *** Settings ***
-Documentation     Basic tests for odl-bgpcep-pcep-all feature.
+Documentation       Basic tests for odl-bgpcep-pcep-all feature.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
-Suite Setup       Set_It_Up
-Suite Teardown    Tear_It_Down
-Library           OperatingSystem
-Library           SSHLibrary
-Library           RequestsLibrary
-Library           ../../../libraries/norm_json.py
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/PcepOperations.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/RemoteBash.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../variables/Variables.robot
-Variables         ../../../variables/pcepuser/${ODL_STREAM}/variables.py    ${TOOLS_SYSTEM_IP}
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Library             OperatingSystem
+Library             SSHLibrary
+Library             RequestsLibrary
+Library             ../../../libraries/norm_json.py
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/PcepOperations.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../libraries/RemoteBash.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../variables/Variables.robot
+Variables           ../../../variables/pcepuser/${ODL_STREAM}/variables.py    ${TOOLS_SYSTEM_IP}
+
+Suite Setup         Set_It_Up
+Suite Teardown      Tear_It_Down
+
 
 *** Variables ***
-${CONFIG_SESSION}    session
-${PATH_SESSION_URI}    node=pcc:%2F%2F${TOOLS_SYSTEM_IP}/network-topology-pcep:path-computation-client
+${CONFIG_SESSION}           session
+${PATH_SESSION_URI}         node=pcc:%2F%2F${TOOLS_SYSTEM_IP}/network-topology-pcep:path-computation-client
 ${PCEP_VARIABLES_FOLDER}    ${CURDIR}/../../../variables/pcepuser/${ODL_STREAM}
 
+
 *** Test Cases ***
 Topology_Precondition
     [Documentation]    Compare current pcep-topology to off_json variable.
@@ -35,7 +39,8 @@ Topology_Precondition
 
 Start_Pcc_Mock
     [Documentation]    Execute pcc-mock on Mininet, fail is Open is not sent, keep it running for next tests.
-    ${command}=    NexusKeywords.Compose_Full_Java_Command    -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_IP} 2>&1 | tee pccmock.log
+    ${command}=    NexusKeywords.Compose_Full_Java_Command
+    ...    -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_IP} 2>&1 | tee pccmock.log
     Log    ${command}
     Write    ${command}
     Read_Until    started, sent proposal Open
@@ -45,9 +50,14 @@ 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}
-    TemplatedRequests.Put_As_Xml_Templated    ${PCEP_VARIABLES_FOLDER}${/}node_speaker_entity_identifier    mapping=${mapping}    session=${CONFIG_SESSION}
+    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}
+    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.
@@ -118,6 +128,7 @@ Topology_Postcondition
     [Tags]    critical
     Wait_Until_Keyword_Succeeds    10s    1s    Compare_Topology    ${off_json}
 
+
 *** Keywords ***
 Set_It_Up
     [Documentation]    Create SSH session to Mininet machine, prepare HTTP client session to Controller.
@@ -140,13 +151,15 @@ Tear_It_Down
     Close_All_Connections
 
 Compare_Topology
-    [Arguments]    ${exp}    ${uri}=${EMPTY}
     [Documentation]    Get current pcep-topology as json, compare both expected and actual json.
     ...    Error codes and normalized jsons should match exactly.
+    [Arguments]    ${exp}    ${uri}=${EMPTY}
     # TODO: Add Node Session State Check For Oxygen, see tcpmd5user
     # TODO: Possibly remake all tests with TemplatedRequests
-    ${topology_uri}=    BuiltIn.Set_Variable_If    '${uri}'=='${EMPTY}'
-    ...    ${REST_API}/${TOPOLOGY_URL}=pcep-topology?content=nonconfig    ${REST_API}/${TOPOLOGY_URL}=pcep-topology/${uri}?content=nonconfig
+    ${topology_uri}=    BuiltIn.Set_Variable_If
+    ...    '${uri}'=='${EMPTY}'
+    ...    ${REST_API}/${TOPOLOGY_URL}=pcep-topology?content=nonconfig
+    ...    ${REST_API}/${TOPOLOGY_URL}=pcep-topology/${uri}?content=nonconfig
     ${response}=    RequestsLibrary.Get Request    ${CONFIG_SESSION}    ${topology_uri}
     BuiltIn.Should_Be_Equal_As_Strings    ${response.status_code}    200
     TemplatedRequests.Normalize_Jsons_And_Compare    ${exp}    ${response.text}
index dcfac9b07509679a761917b6db3f6a8229c0972d..b71e0a62ed3ebf9e7c6b5d133277233f7fdfc5c2 100644 (file)
@@ -1,54 +1,64 @@
 *** Settings ***
-Documentation     TCPMD5 user-facing feature system tests, using PCEP.
+Documentation       TCPMD5 user-facing feature system tests, using PCEP.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
-...               Test suite performs basic pcep md5 password authorization test cases:
-...               (Run entire basic PCEP suite without passwords.)
-...               Start pcc-mock (reconnecting mode): 1 pcc, 1 lsp, password set, check pcep-topology stays empty.
-...               Use restconf to change PCEP configuration to use a wrong password, check pcep-topology stays empty.
-...               Change ODL PCEP configuration to use the correct password, check pcep-topology shows the lsp.
-...               Stop pcc-mock, check pcep-topology stays empty.
-...               Start pcc-mock with new password, check pcep-topology stays empty.
-...               Change ODL PCEP configuration to use the correct password, check pcep-topology shows the lsp.
-...               Update the lsp, check a change in pcep-topology.
-...               Change ODL PCEP configuration to not use password, pcep-topology empties, kill pcep-pcc-mock.
+...                 Test suite performs basic pcep md5 password authorization test cases:
+...                 (Run entire basic PCEP suite without passwords.)
+...                 Start pcc-mock (reconnecting mode): 1 pcc, 1 lsp, password set, check pcep-topology stays empty.
+...                 Use restconf to change PCEP configuration to use a wrong password, check pcep-topology stays empty.
+...                 Change ODL PCEP configuration to use the correct password, check pcep-topology shows the lsp.
+...                 Stop pcc-mock, check pcep-topology stays empty.
+...                 Start pcc-mock with new password, check pcep-topology stays empty.
+...                 Change ODL PCEP configuration to use the correct password, check pcep-topology shows the lsp.
+...                 Update the lsp, check a change in pcep-topology.
+...                 Change ODL PCEP configuration to not use password, pcep-topology empties, kill pcep-pcc-mock.
 ...
-...               Test cases no longer need netconf-connector-ssh, and they include comparison of
-...               pcep-session-state.
-Suite Setup       Set_It_Up
-Suite Teardown    Tear_It_Down
-Test Setup        FailFast.Fail_This_Fast_On_Previous_Error
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           SSHLibrary    prompt=]>
-Resource          ../../../libraries/CompareStream.robot
-Resource          ../../../libraries/FailFast.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/NexusKeywords.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/RemoteBash.robot
-Resource          ../../../libraries/WaitForFailure.robot
-Resource          ../../../variables/Variables.robot
-Variables         ../../../variables/tcpmd5user/${ODL_STREAM}/variables.py    ${TOOLS_SYSTEM_IP}
+...                 Test cases no longer need netconf-connector-ssh, and they include comparison of
+...                 pcep-session-state.
+
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             SSHLibrary    prompt=]>
+Resource            ../../../libraries/CompareStream.robot
+Resource            ../../../libraries/FailFast.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/NexusKeywords.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/RemoteBash.robot
+Resource            ../../../libraries/WaitForFailure.robot
+Resource            ../../../variables/Variables.robot
+Variables           ../../../variables/tcpmd5user/${ODL_STREAM}/variables.py    ${TOOLS_SYSTEM_IP}
+
+Suite Setup         Set_It_Up
+Suite Teardown      Tear_It_Down
+Test Setup          FailFast.Fail_This_Fast_On_Previous_Error
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
-${DIR_WITH_TEMPLATES}    ${CURDIR}/../../../variables/tcpmd5user/${ODL_STREAM}
-${CONFIG_SESSION}    session
-${OLD_ERROR_ARGS}    \n"last-received-error": {},\n"last-sent-error": {},
-${NEW_ERROR_ARGS}    ${EMPTY}
+${DIR_WITH_TEMPLATES}       ${CURDIR}/../../../variables/tcpmd5user/${ODL_STREAM}
+${CONFIG_SESSION}           session
+${OLD_ERROR_ARGS}           \n"last-received-error": {},\n"last-sent-error": {},
+${NEW_ERROR_ARGS}           ${EMPTY}
+
 
 *** Test Cases ***
 Topology_Precondition
     [Documentation]    Compare current pcep-topology to empty one.
     ...    Timeout is long enough to see that pcep is ready, with no PCC connected.
     [Tags]    critical
-    BuiltIn.Wait_Until_Keyword_Succeeds    300s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_off    session=${CONFIG_SESSION}    verify=True
+    BuiltIn.Wait_Until_Keyword_Succeeds
+    ...    300s
+    ...    1s
+    ...    TemplatedRequests.Get_As_Json_Templated
+    ...    ${DIR_WITH_TEMPLATES}${/}default_off
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Start_Secure_Pcc_Mock
     [Documentation]    Execute pcc-mock on Mininet with password set, fail if pcc-mock promptly exits. Keep pcc-mock running for next test cases.
@@ -76,8 +86,19 @@ Set_Correct_Password
 
 Topology_Intercondition
     [Documentation]    Compare pcep-topology/path-computation-client to filled one, which includes a tunnel from pcc-mock.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}    ERRORS=${ERROR_ARGS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}    ${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    CODE=${pcc_name_code}
+    ...    NAME=${pcc_name}
+    ...    IP_ODL=${ODL_SYSTEM_IP}
+    ...    ERRORS=${ERROR_ARGS}
+    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
@@ -109,21 +130,47 @@ Set_Correct_Password_2
 
 Topology_Intercondition_2
     [Documentation]    Compare pcep-topology/path-computation-client to filled one, which includes a tunnel from pcc-mock.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}    ERRORS=${ERROR_ARGS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_state    ${mapping}    ${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    CODE=${pcc_name_code}
+    ...    NAME=${pcc_name}
+    ...    IP_ODL=${ODL_SYSTEM_IP}
+    ...    ERRORS=${ERROR_ARGS}
+    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.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NAME=${pcc_name}
-    ${response}=    TemplatedRequests.Post_As_Xml_Templated    ${DIR_WITH_TEMPLATES}${/}update_delegated    ${mapping}    ${CONFIG_SESSION}    verify=False
+    ${response}    TemplatedRequests.Post_As_Xml_Templated
+    ...    ${DIR_WITH_TEMPLATES}${/}update_delegated
+    ...    ${mapping}
+    ...    ${CONFIG_SESSION}
+    ...    verify=False
     Log    ${response}
 
 Topology_Updated
     [Documentation]    Compare pcep-topology/path-computation-client to default_on_updated, which includes the updated tunnel.
     [Tags]    critical
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    CODE=${pcc_name_code}    NAME=${pcc_name}    IP_ODL=${ODL_SYSTEM_IP}    ERRORS=${ERROR_ARGS}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    1s    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_on_updated_state    ${mapping}    ${CONFIG_SESSION}
+    &{mapping}    BuiltIn.Create_Dictionary
+    ...    IP=${TOOLS_SYSTEM_IP}
+    ...    CODE=${pcc_name_code}
+    ...    NAME=${pcc_name}
+    ...    IP_ODL=${ODL_SYSTEM_IP}
+    ...    ERRORS=${ERROR_ARGS}
+    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
@@ -157,6 +204,7 @@ Delete_Pcep_Client_Module
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Delete_Templated    ${DIR_WITH_TEMPLATES}${/}pcep_topology_node    ${mapping}
 
+
 *** Keywords ***
 Set_It_Up
     [Documentation]    Create SSH session to Mininet machine, prepare HTTP client session to Controller.
@@ -165,16 +213,16 @@ Set_It_Up
     KarafKeywords.Setup_Karaf_Keywords
     TemplatedRequests.Create_Default_Session
     NexusKeywords.Initialize_Artifact_Deployment_And_Usage
-    ${current_connection}=    SSHLibrary.Get_Connection
-    ${current_prompt}=    BuiltIn.Set_Variable    ${current_connection.prompt}
+    ${current_connection}    SSHLibrary.Get_Connection
+    ${current_prompt}    BuiltIn.Set_Variable    ${current_connection.prompt}
     BuiltIn.Log    ${current_prompt}
     BuiltIn.Set_Suite_Variable    ${prompt}    ${current_prompt}
     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
-    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep    pcep-pcc-mock
+    ${name}    NexusKeywords.Deploy_Test_Tool    bgpcep    pcep-pcc-mock
     BuiltIn.Set_Suite_Variable    ${filename}    ${name}
     #Setting Pcc Name and its code for mapping for templates
     FailFast.Do_Not_Fail_Fast_From_Now_On
-    ${ERROR_ARGS}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
+    ${ERROR_ARGS}    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_ERROR_ARGS}    ${OLD_ERROR_ARGS}
     BuiltIn.Set_Suite_Variable    ${ERROR_ARGS}
 
 Tear_It_Down
@@ -182,24 +230,27 @@ Tear_It_Down
     ...    Compute and Log the diff between expected and actual normalized responses.
     ...    Close both HTTP client session and SSH connection to Mininet.
     SSHLibrary.Get_File    pccmock.log
-    ${pccmocklog}=    OperatingSystem.Run    cat pccmock.log
+    ${pccmocklog}    OperatingSystem.Run    cat pccmock.log
     BuiltIn.Log    ${pccmocklog}
     RequestsLibrary.Delete_All_Sessions
     SSHLibrary.Close_All_Connections
 
 Test_Unauthorized
     [Documentation]    Try to access pcep topology with wrong password, should get empty topology
-    TemplatedRequests.Get_As_Json_Templated    ${DIR_WITH_TEMPLATES}${/}default_off    session=${CONFIG_SESSION}    verify=True
+    TemplatedRequests.Get_As_Json_Templated
+    ...    ${DIR_WITH_TEMPLATES}${/}default_off
+    ...    session=${CONFIG_SESSION}
+    ...    verify=True
 
 Read_Text_Before_Prompt
     [Documentation]    Log text gathered by SSHLibrary.Read_Until_Prompt.
     ...    This needs to be a separate keyword just because how Read_And_Fail_If_Prompt_Is_Seen is implemented.
-    ${text}    SSHLibrary.Read_Until_Prompt
+    ${text}    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${text}
 
 Replace_Password_On_Pcep_Node
-    [Arguments]    ${password}
     [Documentation]    Send restconf PUT to replace the config module specifying PCEP password element.
+    [Arguments]    ${password}
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    PASSWD=${password}
     TemplatedRequests.Put_As_Xml_Templated    ${DIR_WITH_TEMPLATES}${/}pcep_topology_node    mapping=${mapping}
 
@@ -212,12 +263,13 @@ Stop_Pcc_Mock_Tool
     [Documentation]    Send ctrl+c to pcc-mock, fails if no prompt is seen
     ...    after 3 seconds (the default for SSHLibrary)
     RemoteBash.Write_Bare_Ctrl_C
-    ${output}=    SSHLibrary.Read_Until_Prompt
+    ${output}    SSHLibrary.Read_Until_Prompt
     BuiltIn.Log    ${output}
 
 Start_Pcc_Mock_Tool_With_Password
-    [Arguments]    ${password}
     [Documentation]    Starts pcc-mock with password argument.
-    ${command}=    NexusKeywords.Compose_Full_Java_Command    -jar ${filename} --password ${password} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_IP} 2>&1 | tee pccmock.log
+    [Arguments]    ${password}
+    ${command}    NexusKeywords.Compose_Full_Java_Command
+    ...    -jar ${filename} --password ${password} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_IP} 2>&1 | tee pccmock.log
     BuiltIn.Log    ${command}
     SSHLibrary.Write    ${command}
index 0ce72d0a01a68e9332c8f9bbd2fbedaa872c4a25..4156c5f8ee70a22499d66d7bead1f3658c3e5d5b 100644 (file)
 *** Settings ***
-Documentation     PCEP performance suite, uses restconf with configurable authentication.
+Documentation       PCEP performance suite, uses restconf with configurable authentication.
 ...
-...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
 ...
-...               This program and the accompanying materials are made available under the
-...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
-...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...                 This program and the accompanying materials are made available under the
+...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...                 and is available at http://www.eclipse.org/legal/epl-v10.html
 ...
 ...
-...               General Overview:
+...                 General Overview:
 ...
-...               This is a suite which has both scale and performance aspects.
-...               Given scale target, suite reports failures if functional error
-...               is detected, or if various time limits expire.
-...               For passing test cases, their duration is the performance metric.
+...                 This is a suite which has both scale and performance aspects.
+...                 Given scale target, suite reports failures if functional error
+...                 is detected, or if various time limits expire.
+...                 For passing test cases, their duration is the performance metric.
 ...
-...               ODL acts as a translation layer between PCEP capable devices
-...               and users employing RESTCONF.
-...               Performance measurement focuses on two different workflows.
+...                 ODL acts as a translation layer between PCEP capable devices
+...                 and users employing RESTCONF.
+...                 Performance measurement focuses on two different workflows.
 ...
-...               The first workflow is initial synchronization, when ODL learns
-...               the state of PCEP topology as devices connect to it,
-...               while restconf user reads the state repeatedly.
-...               The second workflow is mass update, when restconf users issue RPCs
-...               to updale Layer Switched Paths on Path Computation Clients.
+...                 The first workflow is initial synchronization, when ODL learns
+...                 the state of PCEP topology as devices connect to it,
+...                 while restconf user reads the state repeatedly.
+...                 The second workflow is mass update, when restconf users issue RPCs
+...                 to updale Layer Switched Paths on Path Computation Clients.
 ...
-...               This suite uses pcc-mock (downloaded from Nexus) to simulate PCCs.
-...               It needs segment of bindable IP addresses,
-...               one for each simulated PCC; so running pcc-mock from remote machine
-...               is only viable when just single PCC is simulated.
-...               Testing with multiple PCCs works best when pcc-mock
-...               runs on the same VM as ODL, so 127.0.0.0/8 subnet can be used.
+...                 This suite uses pcc-mock (downloaded from Nexus) to simulate PCCs.
+...                 It needs segment of bindable IP addresses,
+...                 one for each simulated PCC; so running pcc-mock from remote machine
+...                 is only viable when just single PCC is simulated.
+...                 Testing with multiple PCCs works best when pcc-mock
+...                 runs on the same VM as ODL, so 127.0.0.0/8 subnet can be used.
 ...
-...               Library AuthStandalone is used directly for restconf reads
-...               in the first workflow. That library transparently handles several
-...               http authentication methods, based on credentials and pybot arguments.
+...                 Library AuthStandalone is used directly for restconf reads
+...                 in the first workflow. That library transparently handles several
+...                 http authentication methods, based on credentials and pybot arguments.
 ...
-...               In the second workflow, updater.py utility is used for issuing
-...               rapid restconf requests. It can use multiple worker threads,
-...               as http requests are blocking.
-...               Due to CPython interpreter itself being single threaded,
-...               amounts of threads above 8-16 are actually slightly slower
-...               (which may roughly correspond to network traffic
-...               being more limiting factor than CPU).
-...               This suite starts updater utility bound to single CPU,
-...               as this setup was the most performant in other tests.
+...                 In the second workflow, updater.py utility is used for issuing
+...                 rapid restconf requests. It can use multiple worker threads,
+...                 as http requests are blocking.
+...                 Due to CPython interpreter itself being single threaded,
+...                 amounts of threads above 8-16 are actually slightly slower
+...                 (which may roughly correspond to network traffic
+...                 being more limiting factor than CPU).
+...                 This suite starts updater utility bound to single CPU,
+...                 as this setup was the most performant in other tests.
 ...
-...               In case of failed test case, other tests are skipped (unless
-...               this is overriden by [Setup]) to finish test run sooner.
+...                 In case of failed test case, other tests are skipped (unless
+...                 this is overriden by [Setup]) to finish test run sooner.
 ...
-...               Variables and test case names refer to Controller(ODL_SYSTEM) and Mininet
-...               (TOOLS_SYSTEM), those are assumed to be separate remote VMs, one to host ODL,
-...               other to host tools.
-...               In case updater and pcc-mock are desired to run
-...               from separate machines, their parameters use Mininet(TOOLS_SYSTEM)
-...               values as default.
-...               If both updater VM and pcc-mock VM parameters are specified,
-...               Mininet(TOOLS_SYSTEM) parameters may be skipped.
-...               Variable ${USE_TOOLS_SYSTEM} decides the pcc-mock running machine.
+...                 Variables and test case names refer to Controller(ODL_SYSTEM) and Mininet
+...                 (TOOLS_SYSTEM), those are assumed to be separate remote VMs, one to host ODL,
+...                 other to host tools.
+...                 In case updater and pcc-mock are desired to run
+...                 from separate machines, their parameters use Mininet(TOOLS_SYSTEM)
+...                 values as default.
+...                 If both updater VM and pcc-mock VM parameters are specified,
+...                 Mininet(TOOLS_SYSTEM) parameters may be skipped.
+...                 Variable ${USE_TOOLS_SYSTEM} decides the pcc-mock running machine.
 ...
-...               Some launch scripts put restrictions on how pybot options
-...               can be specified, so there are utility variables to help with
-...               copying Controller related value to apply fo updater of pccmock.
-...               Having a tool co-located with ODL reduces network latency,
-...               but puts more pressure on CPU and memory on Controller VM.
+...                 Some launch scripts put restrictions on how pybot options
+...                 can be specified, so there are utility variables to help with
+...                 copying Controller related value to apply fo updater of pccmock.
+...                 Having a tool co-located with ODL reduces network latency,
+...                 but puts more pressure on CPU and memory on Controller VM.
 ...
-...               In some environments, issues with TIME-WAIT prevent high restconf rates,
-...               so TCP reuse is temporarily allowed during the suite run, if possible
-...               (and if not disabled by UPDATERVM_ENABLE_TCP_RW_REUSE option value).
-...               See http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
-...               This suite ignores possible failures when changing reuse.
+...                 In some environments, issues with TIME-WAIT prevent high restconf rates,
+...                 so TCP reuse is temporarily allowed during the suite run, if possible
+...                 (and if not disabled by UPDATERVM_ENABLE_TCP_RW_REUSE option value).
+...                 See http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
+...                 This suite ignores possible failures when changing reuse.
 ...
-...               Similarly, in some environments, handling of requests.Session object matters
-...               try changing RESTCONF_REUSE value to see if it helps.
+...                 Similarly, in some environments, handling of requests.Session object matters
+...                 try changing RESTCONF_REUSE value to see if it helps.
 ...
-...               Variables to override (only if needed) in pybot command:
-...               (Look into Variables table to see the default values.)
+...                 Variables to override (only if needed) in pybot command:
+...                 (Look into Variables table to see the default values.)
 ...
-...               FIRST_PCC_IP: Set in case bind address is different from public pcc-mock VM address.
-...               LOG_NAME: Filename (without path) to save pcc-mock output into.
-...               LOG_PATH: Override if not the same as pccmock VM workspace.
-...               LSPS: Number of LSPs per PCC to simulate and test.
-...               MOCK_FILE: Filename to use for mock-pcc executable instead of the timestamped one.
-...               ODL_SYSTEM_IP: Numeric IP address of VM where ODL runs.
-...               ODL_SYSTEM_USER: Username for ssh login to ODL VM.
-...               ODL_SYSTEM_PASSWORD: Ssh password, empty means public keys are used instead.
-...               ODL_SYSTEM_PROMPT: Substring to identify Linux prompt on ODL VM.
-...               ODL_SYSTEM_WORKSPACE: Path to where files can be written on ODL VM.
-...               PCCDOWNLOAD_HOSTHEADER: Download server may check checks this header before showing content.
-...               PCCDOWNLOAD_URLBASE: URL to pcep-pcc-mock folder in Nexus (use numberic IP if DNS has problems).
-...               PCCMOCK_COLOCATED: If True, set PCCMOCKVM* to mirror ODL_SYSTEM*
-...               PCCMOCKVM_IP: Override TOOLS_SYSTEM for pcc-mock usage.
-...               PCCMOCKVM_*: Override corresponding TOOLS_SYSTEM_* for pcc-mock usage.
-...               PCCS: Number of PCCs to simulate and test.
-...               PCEP_READY_VERIFY_TIMEOUT: Grace period for pcep-topology to appear. Lower if ODL is ready.
-...               RESTCONF_*: USER, PASSWORD and SCOPE to authenticate with, REUSE session.
-...               (Note: If SCOPE is not empty, token-based authentication is used.)
-...               TOOLS_SYSTEM_IP: Numeric IP address of VM to run pcc-mock and updater from by default.
-...               TOOLS_SYSTEM_PASSWORD: Linux password to go with the username (empty means keys).
-...               TOOLS_SYSTEM_PROMPT: Substring to identify Linux prompt on TOOLS_SYSTEM VM.
-...               TOOLS_SYSTEM_USER: Linux username to SSH to on TOOLS_SYSTEM VM.
-...               TOOLS_SYSTEM_WORKSPACE: Path to where files may be created on TOOLS_SYSTEM VM.
-...               UPDATER_COLOCATED: If True, overrides UPDATERVM_* parameters to point at ODL_SYSTEM
-...               (The purpose is to provide an option without ability to unpack ODL_SYSTEM value.)
-...               UPDATER_ODLADDRESS: Override if public ODL_SYSTEM address is not best fit.
-...               UPDATER_REFRESH: Main updater thread may sleep this long. Balance precision with overhead.
-...               UPDATER_TIMEOUT: If updater stops itself if running more than this time.
-...               (Set this limit according to your performance target.)
-...               UPDATERVM_ENABLE_TCP_RW_REUSE: Set to false if changing Linux configuration is not desired.
-...               UPDATERVM_IP: Override TOOLS_SYSTEM for updater.py usage.
-...               UPDATERVM_*: Override corresponding TOOLS_SYSTEM_* for updater.py usage.
-Suite Setup       Initial Setup
-Suite Teardown    Disconnect
-Test Setup        FailFast.Fail_This_Fast_On_Previous_Error
-Test Teardown     FailFast.Start_Failing_Fast_If_This_Failed
-Library           SSHLibrary    timeout=10s
-Library           RequestsLibrary
-Library           ${CURDIR}/../../../libraries/AuthStandalone.py
-Resource          ${CURDIR}/../../../variables/Variables.robot
-Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource          ${CURDIR}/../../../libraries/FailFast.robot
-Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot    # for Deploy_Artifact
-Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot    # for Require_* and Assure_*, Flexible_SSH_Login
+...                 FIRST_PCC_IP: Set in case bind address is different from public pcc-mock VM address.
+...                 LOG_NAME: Filename (without path) to save pcc-mock output into.
+...                 LOG_PATH: Override if not the same as pccmock VM workspace.
+...                 LSPS: Number of LSPs per PCC to simulate and test.
+...                 MOCK_FILE: Filename to use for mock-pcc executable instead of the timestamped one.
+...                 ODL_SYSTEM_IP: Numeric IP address of VM where ODL runs.
+...                 ODL_SYSTEM_USER: Username for ssh login to ODL VM.
+...                 ODL_SYSTEM_PASSWORD: Ssh password, empty means public keys are used instead.
+...                 ODL_SYSTEM_PROMPT: Substring to identify Linux prompt on ODL VM.
+...                 ODL_SYSTEM_WORKSPACE: Path to where files can be written on ODL VM.
+...                 PCCDOWNLOAD_HOSTHEADER: Download server may check checks this header before showing content.
+...                 PCCDOWNLOAD_URLBASE: URL to pcep-pcc-mock folder in Nexus (use numberic IP if DNS has problems).
+...                 PCCMOCK_COLOCATED: If True, set PCCMOCKVM* to mirror ODL_SYSTEM*
+...                 PCCMOCKVM_IP: Override TOOLS_SYSTEM for pcc-mock usage.
+...                 PCCMOCKVM_*: Override corresponding TOOLS_SYSTEM_* for pcc-mock usage.
+...                 PCCS: Number of PCCs to simulate and test.
+...                 PCEP_READY_VERIFY_TIMEOUT: Grace period for pcep-topology to appear. Lower if ODL is ready.
+...                 RESTCONF_*: USER, PASSWORD and SCOPE to authenticate with, REUSE session.
+...                 (Note: If SCOPE is not empty, token-based authentication is used.)
+...                 TOOLS_SYSTEM_IP: Numeric IP address of VM to run pcc-mock and updater from by default.
+...                 TOOLS_SYSTEM_PASSWORD: Linux password to go with the username (empty means keys).
+...                 TOOLS_SYSTEM_PROMPT: Substring to identify Linux prompt on TOOLS_SYSTEM VM.
+...                 TOOLS_SYSTEM_USER: Linux username to SSH to on TOOLS_SYSTEM VM.
+...                 TOOLS_SYSTEM_WORKSPACE: Path to where files may be created on TOOLS_SYSTEM VM.
+...                 UPDATER_COLOCATED: If True, overrides UPDATERVM_* parameters to point at ODL_SYSTEM
+...                 (The purpose is to provide an option without ability to unpack ODL_SYSTEM value.)
+...                 UPDATER_ODLADDRESS: Override if public ODL_SYSTEM address is not best fit.
+...                 UPDATER_REFRESH: Main updater thread may sleep this long. Balance precision with overhead.
+...                 UPDATER_TIMEOUT: If updater stops itself if running more than this time.
+...                 (Set this limit according to your performance target.)
+...                 UPDATERVM_ENABLE_TCP_RW_REUSE: Set to false if changing Linux configuration is not desired.
+...                 UPDATERVM_IP: Override TOOLS_SYSTEM for updater.py usage.
+...                 UPDATERVM_*: Override corresponding TOOLS_SYSTEM_* for updater.py usage.
+
+Library             SSHLibrary    timeout=10s
+Library             RequestsLibrary
+Library             ${CURDIR}/../../../libraries/AuthStandalone.py
+Resource            ${CURDIR}/../../../variables/Variables.robot
+Resource            ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource            ${CURDIR}/../../../libraries/FailFast.robot
+Resource            ${CURDIR}/../../../libraries/NexusKeywords.robot    # for Deploy_Artifact
+Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot    # for Require_* and Assure_*, Flexible_SSH_Login
+
+Suite Setup         Initial Setup
+Suite Teardown      Disconnect
+Test Setup          FailFast.Fail_This_Fast_On_Previous_Error
+Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
+
 
 *** Variables ***
 # This Variable decides the pcc mock to run in ODL system or tools system.
-${USE_TOOLS_SYSTEM}    False
+${USE_TOOLS_SYSTEM}                 False
 # This table acts as an exhaustive list of variables users can modify on pybot invocation.
 # It also contains commented-out lines for variables defined elswhere.
 # Keep this list in alphabetical order.
-${BLOCKING-THREAD}    1
-${DELAY_TIME}     10
-${FIRST_PCC_IP}    ${PCCMOCKVM_IP}
+${BLOCKING-THREAD}                  1
+${DELAY_TIME}                       10
+${FIRST_PCC_IP}                     ${PCCMOCKVM_IP}
 # ${LOG_FILE} is reserved for location of pybot-created log.html
-${INIT_PCC_DEVICE_COUNT}    ${100}
-${LOG_NAME}       throughpcep.log
-${LOG_PATH}       ${PCCMOCKVM_WORKSPACE}
-${LSPS}           65535
+${INIT_PCC_DEVICE_COUNT}            ${100}
+${LOG_NAME}                         throughpcep.log
+${LOG_PATH}                         ${PCCMOCKVM_WORKSPACE}
+${LSPS}                             65535
 #Reduced max pcc device count to 100 for BGPCEP-901
-${MAX_PCC_DEVICE_COUNT}    ${100}
-${ODL_SYSTEM_WORKSPACE}    /tmp
-${PARALLEL_ITERATION}    10
-${PCC_DEVICE_INCREMENT}    ${50}
-${PCCDOWNLOAD_HOSTHEADER}    nexus.opendaylight.org
-${PCCDOWNLOAD_URLBASE}    http://${PCCDOWNLOAD_HOSTHEADER}/content/repositories/opendaylight.snapshot/org/opendaylight/bgpcep/pcep-pcc-mock/
-${PCCMOCK_COLOCATED}    False
-${PCCMOCKVM_IP}    ${TOOLS_SYSTEM_IP}
-${PCCMOCKVM_PASSWORD}    ${TOOLS_SYSTEM_PASSWORD}
-${PCCMOCKVM_PROMPT}    ${TOOLS_SYSTEM_PROMPT}
-${PCCMOCKVM_USER}    ${TOOLS_SYSTEM_USER}
-${PCCMOCKVM_WORKSPACE}    ${TOOLS_SYSTEM_WORKSPACE}
-${PCCS}           1
-${PCEP_READY_VERIFY_TIMEOUT}    300s
+${MAX_PCC_DEVICE_COUNT}             ${100}
+${ODL_SYSTEM_WORKSPACE}             /tmp
+${PARALLEL_ITERATION}               10
+${PCC_DEVICE_INCREMENT}             ${50}
+${PCCDOWNLOAD_HOSTHEADER}           nexus.opendaylight.org
+${PCCDOWNLOAD_URLBASE}
+...                                 http://${PCCDOWNLOAD_HOSTHEADER}/content/repositories/opendaylight.snapshot/org/opendaylight/bgpcep/pcep-pcc-mock/
+${PCCMOCK_COLOCATED}                False
+${PCCMOCKVM_IP}                     ${TOOLS_SYSTEM_IP}
+${PCCMOCKVM_PASSWORD}               ${TOOLS_SYSTEM_PASSWORD}
+${PCCMOCKVM_PROMPT}                 ${TOOLS_SYSTEM_PROMPT}
+${PCCMOCKVM_USER}                   ${TOOLS_SYSTEM_USER}
+${PCCMOCKVM_WORKSPACE}              ${TOOLS_SYSTEM_WORKSPACE}
+${PCCS}                             1
+${PCEP_READY_VERIFY_TIMEOUT}        300s
 # Yes, the default timeout is 5 minutes, as this suite might be started eagerly just after ODL starts booting up.
-${RESTCONF_PASSWORD}    ${PWD}    # from Variables.robot
-${RESTCONF_REUSE}    True
-${RESTCONF_SCOPE}    ${EMPTY}
-${RESTCONF_USER}    ${USER}    # from Variables.robot
-${SEQUENTIAL_ITERATION}    15
-${TOOLS_SYSTEM_WORKSPACE}    /tmp
-${UPDATER_COLOCATED}    False
-${UPDATER_ODLADDRESS}    ${ODL_SYSTEM_IP}
-${UPDATER_REFRESH}    0.1
+${RESTCONF_PASSWORD}                ${PWD}    # from Variables.robot
+${RESTCONF_REUSE}                   True
+${RESTCONF_SCOPE}                   ${EMPTY}
+${RESTCONF_USER}                    ${USER}    # from Variables.robot
+${SEQUENTIAL_ITERATION}             15
+${TOOLS_SYSTEM_WORKSPACE}           /tmp
+${UPDATER_COLOCATED}                False
+${UPDATER_ODLADDRESS}               ${ODL_SYSTEM_IP}
+${UPDATER_REFRESH}                  0.1
 # Updater timeout is overwritten in releng/builder
-${UPDATER_TIMEOUT}    300
+${UPDATER_TIMEOUT}                  300
 ${UPDATERVM_ENABLE_TCP_RW_REUSE}    True
-${UPDATERVM_IP}    ${TOOLS_SYSTEM_IP}
-${UPDATERVM_PASSWORD}    ${TOOLS_SYSTEM_PASSWORD}
-${UPDATERVM_PROMPT}    ${TOOLS_SYSTEM_PROMPT}
-${UPDATERVM_USER}    ${TOOLS_SYSTEM_USER}
-${UPDATERVM_WORKSPACE}    ${TOOLS_SYSTEM_WORKSPACE}
+${UPDATERVM_IP}                     ${TOOLS_SYSTEM_IP}
+${UPDATERVM_PASSWORD}               ${TOOLS_SYSTEM_PASSWORD}
+${UPDATERVM_PROMPT}                 ${TOOLS_SYSTEM_PROMPT}
+${UPDATERVM_USER}                   ${TOOLS_SYSTEM_USER}
+${UPDATERVM_WORKSPACE}              ${TOOLS_SYSTEM_WORKSPACE}
+
 
 *** Test Cases ***
 Put_Updater
     [Documentation]    Open SSH session to updater VM, copy the utility there, including dependencies, also prepare direct http session.
-    BuiltIn.Run_Keyword_If    ${UPDATER_COLOCATED}    Updater_From_Controller
+    IF    ${UPDATER_COLOCATED}    Updater_From_Controller
     SSHLibrary.Open_Connection    ${UPDATERVM_IP}    alias=updater
     SSHLibrary.Set_Client_Configuration    timeout=20s
     SSHLibrary.Set_Client_Configuration    prompt=${UPDATERVM_PROMPT}
@@ -186,7 +191,11 @@ Put_Updater
     SSHKeywords.Assure_Library_Ipaddr    target_dir=${UPDATERVM_WORKSPACE}
     # Done preparation of Updater VM, now use AuthStandalone to create session from robot VM too.
     BuiltIn.Log_Many    ${RESTCONF_USER}    ${RESTCONF_PASSWORD}    ${RESTCONF_SCOPE}    ${ODL_SYSTEM_IP}
-    ${session} =    AuthStandalone.Init_Session    ${ODL_SYSTEM_IP}    ${RESTCONF_USER}    ${RESTCONF_PASSWORD}    ${RESTCONF_SCOPE}
+    ${session} =    AuthStandalone.Init_Session
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${RESTCONF_USER}
+    ...    ${RESTCONF_PASSWORD}
+    ...    ${RESTCONF_SCOPE}
     BuiltIn.Set_Suite_Variable    ${rest_session}    ${session}
     # TODO: Define http timeouts.
 
@@ -196,7 +205,9 @@ Save_And_Enable_Tcp_Rw_Reuse
     ${old_value} =    SSHLibrary.Execute_Command    cat /proc/sys/net/ipv4/tcp_tw_reuse
     # The next line may be skipped if the previous line failed.
     BuiltIn.Set_Suite_Variable    ${tcp_rw_reuse}    ${old_value}
-    ${out}    ${rc} =    SSHLibrary.Execute_Command    sudo bash -c "echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse"    return_rc=True
+    ${out}    ${rc} =    SSHLibrary.Execute_Command
+    ...    sudo bash -c "echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse"
+    ...    return_rc=True
     BuiltIn.Should_Be_Equal    ${rc}    ${0}
     # Lack of sudo access should not prevent the rest of suite from trying without TCP reuse.
     [Teardown]    Do_Not_Start_Failing_If_This_Failed
@@ -337,7 +348,12 @@ Updater_with delegate
 
 PCEP_sessions_from_multiple_machines
     [Documentation]    Download and start PCC Mock in tools vm and do updation
-    Download_Pcc_Mock    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_USER}    ${TOOLS_SYSTEM_PASSWORD}    ${TOOLS_SYSTEM_PROMPT}    pccmock_toolsvm
+    Download_Pcc_Mock
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    ${TOOLS_SYSTEM_USER}
+    ...    ${TOOLS_SYSTEM_PASSWORD}
+    ...    ${TOOLS_SYSTEM_PROMPT}
+    ...    pccmock_toolsvm
     Set_Hop    0
     Start_Pcc_Mock    pccmock_toolsvm    ${TOOLS_SYSTEM_IP}    ${PCCS}    ${LSPS}    throughpcep_tools.log
     ${total_size} =    BuiltIn.Evaluate    int(${size})+int(${LSPS})
@@ -364,7 +380,9 @@ Stop_Pcc_Mock
 
 PCEP Sessions Flapped with LSP updates
     [Documentation]    Flapping PCEP sessions and perform LSP updates within flapping
-    Run Keyword If    '${USE_TOOLS_SYSTEM}' == 'True'    BuiltIn.Pass Execution    Pcc Mock should not run in ODL System
+    IF    '${USE_TOOLS_SYSTEM}' == 'True'
+        BuiltIn.Pass Execution    Pcc Mock should not run in ODL System
+    END
     FOR    ${devices}    IN RANGE    ${INIT_PCC_DEVICE_COUNT}    ${MAX_PCC_DEVICE_COUNT+1}    ${PCC_DEVICE_INCREMENT}
         Flap Pcc Mock sessions continuously with LSP updates    127.1.0.0    ${devices}    150
     END
@@ -372,7 +390,9 @@ PCEP Sessions Flapped with LSP updates
 
 PCEP Sessions Flapped alongside LSP updates
     [Documentation]    Flapping PCEP sessions and perform LSP updates alongside flapping
-    Run Keyword If    '${USE_TOOLS_SYSTEM}' == 'True'    BuiltIn.Pass Execution    Pcc Mock should not run in ODL System
+    IF    '${USE_TOOLS_SYSTEM}' == 'True'
+        BuiltIn.Pass Execution    Pcc Mock should not run in ODL System
+    END
     FOR    ${devices}    IN RANGE    ${INIT_PCC_DEVICE_COUNT}    ${MAX_PCC_DEVICE_COUNT+1}    ${PCC_DEVICE_INCREMENT}
         Flap Pcc Mock sessions parallelly with LSP updates    127.1.0.0    ${devices}    150
         BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
@@ -398,9 +418,12 @@ Restore_Tcp_Rw_Reuse
     BuiltIn.Pass_Execution_If    not ${UPDATERVM_ENABLE_TCP_RW_REUSE}    Manipulation of tcp_rw_reuse is not requested.
     SSHLibrary.Switch_Connection    updater
     BuiltIn.Variable_Should_Exist    ${tcp_rw_reuse}
-    ${out}    ${rc} =    SSHLibrary.Execute_Command    sudo bash -c "echo ${tcp_rw_reuse} > /proc/sys/net/ipv4/tcp_tw_reuse"    return_rc=True
+    ${out}    ${rc} =    SSHLibrary.Execute_Command
+    ...    sudo bash -c "echo ${tcp_rw_reuse} > /proc/sys/net/ipv4/tcp_tw_reuse"
+    ...    return_rc=True
     BuiltIn.Should_Be_Equal    ${rc}    ${0}
 
+
 *** Keywords ***
 Initial Setup
     FailFast.Do_Not_Fail_Fast_From_Now_On
@@ -412,13 +435,16 @@ Select_mock_machine_and_Download_PCC_Mock
 
 Select_MOCK_Machine
     [Documentation]    Check the tools system variable and assigns the PCC Mock
-    Run Keyword If    '${USE_TOOLS_SYSTEM}' == 'False'    Run Keywords    Pccmock_From_Odl_System    AND    Updater_From_Odl_System
+    IF    '${USE_TOOLS_SYSTEM}' == 'False'
+        Pccmock_From_Odl_System
+        Updater_From_Odl_System
+    END
     BuiltIn.Set_Suite_Variable    ${FIRST_PCC_IP}    ${PCCMOCKVM_IP}
 
 Download_Pcc_Mock
-    [Arguments]    ${pcc_ip}=${PCCMOCKVM_IP}    ${pcc_user}=${PCCMOCKVM_USER}    ${pcc_password}=${PCCMOCKVM_PASSWORD}    ${pcc_prompt}=${PCCMOCKVM_PROMPT}    ${ssh_alias}=pccmock
     [Documentation]    SSH login to pcc-mock VM, download latest pcc-mock executable from Nexus.
-    BuiltIn.Run_Keyword_If    ${PCCMOCK_COLOCATED}    Pccmock_From_Controller
+    [Arguments]    ${pcc_ip}=${PCCMOCKVM_IP}    ${pcc_user}=${PCCMOCKVM_USER}    ${pcc_password}=${PCCMOCKVM_PASSWORD}    ${pcc_prompt}=${PCCMOCKVM_PROMPT}    ${ssh_alias}=pccmock
+    IF    ${PCCMOCK_COLOCATED}    Pccmock_From_Controller
     NexusKeywords.Initialize_Artifact_Deployment_And_Usage    tools_system_connect=False
     SSHLibrary.Open_Connection    ${pcc_ip}    alias=${ssh_alias}
     SSHLibrary.Set_Client_Configuration    timeout=10s
@@ -428,10 +454,11 @@ Download_Pcc_Mock
     BuiltIn.Set_Suite_Variable    ${mock_location}    ${file_name}
 
 Start_Pcc_Mock
-    [Arguments]    ${ssh_alias}=pccmock    ${mock-ip}=${FIRST_PCC_IP}    ${pccs}=${PCCS}    ${lsps}=${LSPS}    ${log_name}=${LOG_NAME}
     [Documentation]    Launch pcc-mock on background so simulated PCCs start connecting to controller.
+    [Arguments]    ${ssh_alias}=pccmock    ${mock-ip}=${FIRST_PCC_IP}    ${pccs}=${PCCS}    ${lsps}=${LSPS}    ${log_name}=${LOG_NAME}
     SSHLibrary.Switch_Connection    ${ssh_alias}
-    ${command} =    NexusKeywords.Compose_Full_Java_Command    -jar ${mock_location} --local-address ${mock-ip} --remote-address ${ODL_SYSTEM_IP} --pcc ${pccs} --lsp ${lsps} &> ${LOG_PATH}/${log_name}
+    ${command} =    NexusKeywords.Compose_Full_Java_Command
+    ...    -jar ${mock_location} --local-address ${mock-ip} --remote-address ${ODL_SYSTEM_IP} --pcc ${pccs} --lsp ${lsps} &> ${LOG_PATH}/${log_name}
     BuiltIn.Log    ${command}
     SSHLibrary.Write    ${command}
     # The pccmock SSH session is left alive, but no data will be exchanged for a while.
@@ -460,26 +487,30 @@ Disconnect
 
 Get_Pcep_Topology_Data
     [Documentation]    Use session object to download PCEP topology JSON. Check status and return Response object.
-    ${resp} =    AuthStandalone.Get_Using_Session    ${rest_session}    data/${TOPOLOGY_URL}\=pcep-topology?content\=nonconfig
+    ${resp} =    AuthStandalone.Get_Using_Session
+    ...    ${rest_session}
+    ...    data/${TOPOLOGY_URL}\=pcep-topology?content\=nonconfig
     # Not Logging content, as it may be huge.
     BuiltIn.Should_Be_Equal    ${resp.status_code}    ${200}
-    [Return]    ${resp}
+    RETURN    ${resp}
 
 Get_Pcep_Topology_Count
-    [Arguments]    ${pattern}
     [Documentation]    Get topology data, return number of pattern matches.
+    [Arguments]    ${pattern}
     ${resp} =    Get_Pcep_Topology_Data
     # BuiltIn.Log    ${resp.text}
     ${count} =    BuiltIn.Evaluate    len(re.findall('${pattern}', '''${resp.text}'''))    modules=re
     BuiltIn.Log    ${count}
-    [Return]    ${count}
+    RETURN    ${count}
 
 Pcep_Off
     [Documentation]    Get topology data, Log content and assert the exact JSON of empty topology.
     ${resp} =    Get_Pcep_Topology_Data
     # Used before topology had chance to grow huge. Be aware when creating a longevity suite from this.
     BuiltIn.Log    ${resp.text}
-    BuiltIn.Should_Be_Equal    ${resp.text}    {"network-topology:topology":[{"topology-id":"pcep-topology","topology-types":{"network-topology-pcep:topology-pcep":{}}}]}
+    BuiltIn.Should_Be_Equal
+    ...    ${resp.text}
+    ...    {"network-topology:topology":[{"topology-id":"pcep-topology","topology-types":{"network-topology-pcep:topology-pcep":{}}}]}
 
 Pcep_On
     [Documentation]    Get topology count of current hop, assert the number of matches.
@@ -495,16 +526,16 @@ Pcep_Off_Again
     BuiltIn.Should_Be_Equal    ${resp}    ${0}
 
 Set_Hop
-    [Arguments]    ${iteration}
     [Documentation]    Set pattern to match the currently expected hop.
+    [Arguments]    ${iteration}
     ${i} =    BuiltIn.Evaluate    str(1 + int(${iteration}))
     # Regular Expressions need a dot to be escaped to represent a dot.
     BuiltIn.Set_Suite_Variable    ${hop}    ${i}\.${i}\.${i}\.${i}/32
     BuiltIn.Log    ${hop}
 
 Updater
-    [Arguments]    ${iteration}    ${workers}    ${mock-ip}=${FIRST_PCC_IP}    ${pccs}=${PCCS}    ${lsps}=${LSPS}    ${parallel}=False    ${delegate}=true    ${pccip}=${none}    ${tunnel_no}=${none}
     [Documentation]    Compute number of workers, call updater.py, assert its response.
+    [Arguments]    ${iteration}    ${workers}    ${mock-ip}=${FIRST_PCC_IP}    ${pccs}=${PCCS}    ${lsps}=${LSPS}    ${parallel}=False    ${delegate}=true    ${pccip}=${none}    ${tunnel_no}=${none}
     SSHLibrary.Switch_Connection    pccmock
     # In some systems, inactive SSH sessions get severed.
     ${command} =    BuiltIn.Set_Variable    echo "still alive"
@@ -512,7 +543,8 @@ Updater
     # The previous line relies on a fact that Execute_Command spawns separate shels, so running pcc-mock is not affected.
     Set_Hop    ${iteration}
     SSHLibrary.Switch_Connection    updater
-    ${response} =    SSHLibrary.Execute_Command    bash -c "cd ${UPDATERVM_WORKSPACE}; taskset 0x00000001 python3 updater.py --workers '${workers}' --odladdress '${UPDATER_ODLADDRESS}' --user '${RESTCONF_USER}' --password '${RESTCONF_PASSWORD}' --scope '${RESTCONF_SCOPE}' --pccaddress '${mock-ip}' --pccs '${pccs}' --lsps '${lsps}' --hop '${hop}' --timeout '${UPDATER_TIMEOUT}' --refresh '${UPDATER_REFRESH}' --reuse '${RESTCONF_REUSE}' --delegate '${delegate}' --pccip '${pccip}' --tunnelnumber '${tunnel_no}' 2>&1"
+    ${response} =    SSHLibrary.Execute_Command
+    ...    bash -c "cd ${UPDATERVM_WORKSPACE}; taskset 0x00000001 python3 updater.py --workers '${workers}' --odladdress '${UPDATER_ODLADDRESS}' --user '${RESTCONF_USER}' --password '${RESTCONF_PASSWORD}' --scope '${RESTCONF_SCOPE}' --pccaddress '${mock-ip}' --pccs '${pccs}' --lsps '${lsps}' --hop '${hop}' --timeout '${UPDATER_TIMEOUT}' --refresh '${UPDATER_REFRESH}' --reuse '${RESTCONF_REUSE}' --delegate '${delegate}' --pccip '${pccip}' --tunnelnumber '${tunnel_no}' 2>&1"
     Check Updater response    ${response}    ${parallel}
 
 Check Updater response
@@ -521,12 +553,15 @@ Check Updater response
     ${expected_value_continuous_execution} =    BuiltIn.Set_Variable    Counter({'pass': ${size}})
     ${not_expected_value_for_parallel_execution} =    BuiltIn.Set_Variable    Counter({'pass': 0})
     BuiltIn.Log    ${expected_value_continuous_execution}
-    Run Keyword If    '${parallel}' == 'False'    BuiltIn.Should_Contain    ${response}    ${expected_value_continuous_execution}
-    ...    ELSE    BuiltIn.Should_Not_Contain    ${response}    ${not_expected_value_for_parallel_execution}
+    IF    '${parallel}' == 'False'
+        BuiltIn.Should_Contain    ${response}    ${expected_value_continuous_execution}
+    ELSE
+        BuiltIn.Should_Not_Contain    ${response}    ${not_expected_value_for_parallel_execution}
+    END
 
 Verify
-    [Arguments]    ${iteration}
     [Documentation]    Set hop and verify that within timeout, all LSPs in topology are updated.
+    [Arguments]    ${iteration}
     Set_Hop    ${iteration}
     Builtin.Wait_Until_Keyword_Succeeds    30s    1s    Pcep_On
 
@@ -555,12 +590,16 @@ Flap Pcc Mock sessions parallelly with LSP updates
     SSHLibrary.Put File    ${CURDIR}/../../../../tools/pcep_updater/mock.sh    /tmp/mock.sh
     Set_Hop    0
     Builtin.Wait_Until_Keyword_Succeeds    ${PCEP_READY_VERIFY_TIMEOUT}    5s    Pcep_Off
-    SSHLibrary.Start Command    sh /tmp/mock.sh ${mock_location} ${mock-ip} ${ODL_SYSTEM_IP} ${pccs} ${lsps} parallel_Execution ${DELAY_TIME} &>1
+    SSHLibrary.Start Command
+    ...    sh /tmp/mock.sh ${mock_location} ${mock-ip} ${ODL_SYSTEM_IP} ${pccs} ${lsps} parallel_Execution ${DELAY_TIME} &>1
     FOR    ${i}    IN RANGE    ${PARALLEL_ITERATION}
-        ${pid} =    SSHLibrary.Execute Command    ps -fu ${ODL_SYSTEM_USER} | grep "/home/${ODL_SYSTEM_USER}/${mock_location}" | grep -v "grep" | awk '{print $2}'
-        Run Keyword If    '${pid}'!= ""    Log    ${pid}
+        ${pid} =    SSHLibrary.Execute Command
+        ...    ps -fu ${ODL_SYSTEM_USER} | grep "/home/${ODL_SYSTEM_USER}/${mock_location}" | grep -v "grep" | awk '{print $2}'
+        IF    '${pid}'!= ""    Log    ${pid}
         ${i} =    Evaluate    ${i}+1
-        Run Keyword If    '${pid}'!= ""    Updater    ${i}    1    127.1.0.0    ${pccs}    ${lsps}    True
+        IF    '${pid}'!= ""
+            Updater    ${i}    1    127.1.0.0    ${pccs}    ${lsps}    True
+        END
     END
     BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
     Kill all pcc mock simulator processes
@@ -581,14 +620,15 @@ Check PCEP is stable
 Kill all pcc mock simulator processes
     [Arguments]    ${ssh_alias}=pccmock
     SSHLibrary.Switch_Connection    ${ssh_alias}
-    ${mock_pid}    Get pid    /home/${ODL_SYSTEM_USER}/${mock_location}
+    ${mock_pid}    Get pid    /home/${ODL_SYSTEM_USER}/${mock_location}
     SSHLibrary.Execute_Command    kill -9 ${mock_pid}
-    ${script_pid_1}    Get pid    bash -c sh /tmp/mock.sh
+    ${script_pid_1}    Get pid    bash -c sh /tmp/mock.sh
     SSHLibrary.Execute_Command    kill -9 ${script_pid_1}
-    ${script_pid_2}    Get pid    sh /tmp/mock.sh
+    ${script_pid_2}    Get pid    sh /tmp/mock.sh
     SSHLibrary.Execute_Command    kill -9 ${script_pid_2}
 
 Get pid
     [Arguments]    ${process_name}
-    ${pid} =    SSHLibrary.Execute Command    ps -fu ${ODL_SYSTEM_USER} | grep "${process_name}" | grep -v "grep" | awk '{print $2}'
-    [Return]    ${pid}
+    ${pid} =    SSHLibrary.Execute Command
+    ...    ps -fu ${ODL_SYSTEM_USER} | grep "${process_name}" | grep -v "grep" | awk '{print $2}'
+    RETURN    ${pid}