Boron Update of SXP CSIT. 50/34350/11
authorMartin Mihálek <mamihale@cisco.com>
Mon, 21 Mar 2016 15:08:31 +0000 (16:08 +0100)
committerVratko Polák <vrpolak@cisco.com>
Wed, 30 Mar 2016 11:41:34 +0000 (11:41 +0000)
Change-Id: I900b2aad077133d0284200228de19711ba985dcf
Signed-off-by: Martin Mihálek <mamihale@cisco.com>
csit/libraries/Sxp.py
csit/libraries/SxpLib.robot
csit/suites/sxp/basic/020_Restconf_CRUD.robot
csit/suites/sxp/basic/030_Connectivity.robot
csit/suites/sxp/filtering/010_Inbound_Filtering.robot
csit/suites/sxp/filtering/020_Outbound_Filtering.robot
csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot
csit/suites/sxp/topology/010_Topology_Features.robot
csit/suites/sxp/topology/020_Scalability.robot

index 93a51b85f408c1256cf86767f5321a9745678233..e5048b93dd654cd101819b40fc95ff5abe1a7c05 100644 (file)
@@ -328,6 +328,42 @@ def find_connection(connections_json, version, mode, ip, port, state):
     return False
 
 
+def parse_bindings(bindings_json):
+    """Parse JSON string into Array of Bindings
+
+    :param bindings_json: JSON containing Bindings
+    :type bindings_json: string
+    :returns: Array containing Bindings.
+
+    """
+    data = json.loads(bindings_json)
+    output = []
+    for bindings_json in data['output'].values():
+        for binding in bindings_json:
+            output.append(binding)
+    return output
+
+
+def find_binding(bindings, sgt, prefix):
+    """Test if Binding with specified values is contained in JSON
+
+    :param bindings: JSON containing Bindings
+    :type bindings: string
+    :param sgt: Source Group Tag
+    :type sgt: string
+    :param prefix: Ipv4/6 prefix
+    :type prefix: string
+    :returns: True if Binding with specified params was found, otherwise False.
+
+    """
+    for binding in parse_bindings(bindings):
+        if binding['sgt'] == int(sgt):
+            for ip_prefix in binding['ip-prefix']:
+                if ip_prefix == prefix:
+                    return True
+    return False
+
+
 def parse_prefix_groups(prefix_groups_json, source_):
     """Parse JSON string into Array of PrefixGroups
 
@@ -343,13 +379,13 @@ def parse_prefix_groups(prefix_groups_json, source_):
     output = []
     for binding in bindings.values():
         for binding_source in binding:
-            if binding_source['binding-source'] == source_:
+            if source_ == "any" or binding_source['binding-source'] == source_:
                 for prefix_group in binding_source['prefix-group']:
                     output.append(prefix_group)
     return output
 
 
-def find_binding(prefix_groups_json, sgt, prefix, source_, action):
+def find_binding_legacy(prefix_groups_json, sgt, prefix, source_, action):
     """Test if Binding with specified values is contained in JSON
 
     :param prefix_groups_json: JSON containing Bindings and PrefixGroups
@@ -374,41 +410,6 @@ def find_binding(prefix_groups_json, sgt, prefix, source_, action):
     return found
 
 
-def find_binding_with_peer_sequence(prefix_groups_json, sgt, prefix, source_, action, node_id, peer_seq):
-    """Test if Binding with specified values is contained in JSON
-
-    :param prefix_groups_json: JSON containing Bindings and PrefixGroups
-    :type prefix_groups_json: string
-    :param sgt: Source Group Tag
-    :type sgt: string
-    :param prefix: Ipv4/6 prefix
-    :type prefix: string
-    :param source_: Source of binding (local/sxp)
-    :type source_: string
-    :param action: Action for binding (add/delete)
-    :type action: string
-    :param node_id: NodeId of from where Binding came from
-    :type node_id: string
-    :param peer_seq: Hop of specified NodeId from where Binding came from
-    :type peer_seq: string
-    :returns: True if Binding with specified params was found, otherwise False.
-
-    """
-    correct_sequence = False
-    found_source = False
-    for prefixgroup in parse_prefix_groups(prefix_groups_json, source_):
-        if prefixgroup['sgt'] == int(sgt):
-            for binding in prefixgroup['binding']:
-                if binding['ip-prefix'] == prefix and binding['action'] == action:
-                    for peer in binding['peer-sequence']['peer']:
-                        if peer['seq'] == int(peer_seq) and peer['node-id'] == node_id:
-                            correct_sequence = True
-                    for peer_source in binding['sources']['source']:
-                        if peer_source == node_id:
-                            found_source = True
-    return found_source and correct_sequence
-
-
 def add_entry_xml(sgt, prefix, ip):
     """Generate xml for Add Bindings request
 
@@ -666,9 +667,11 @@ def get_connections_from_node_xml(ip):
     return data
 
 
-def get_bindings_from_node_xml(ip):
+def get_bindings_from_node_xml(ip, range):
     """Generate xml for Get Bindings request
 
+    :param range: All or only Local bindings
+    :type ip: string
     :param ip: Ipv4 address of node
     :type ip: string
     :returns: String containing xml data for request
@@ -676,6 +679,7 @@ def get_bindings_from_node_xml(ip):
     """
     templ = Template('''<input>
   <requested-node xmlns="urn:opendaylight:sxp:controller">$ip</requested-node>
+  <bindings-range xmlns="urn:opendaylight:sxp:controller">$range</bindings-range>
 </input>''')
-    data = templ.substitute({'ip': ip})
+    data = templ.substitute({'ip': ip, 'range': range})
     return data
index 4806a8592b6da09b3f00e0639588625c337e00d7..16e72326f1ba09e05d250923f07028688f11d1fe 100644 (file)
@@ -62,31 +62,33 @@ Add Binding
 Get Bindings
     [Arguments]    ${node}=127.0.0.1    ${session}=session
     [Documentation]    Gets all binding via RPC from Master DB of node
-    ${DATA}    Get Bindings From Node Xml    ${node}
-    ${resp}    Post Request    ${session}    ${REST_CONTEXT}:get-node-bindings    data=${DATA}    headers=${HEADERS_XML}
+    ${DATA}    Get Bindings From Node Xml    ${node}    all
+    ${resp}    Run Keyword If    '${ODL_STREAM}' == 'boron'    Post Request    ${session}    ${REST_CONTEXT}:get-node-bindings    data=${DATA}
+    ...    headers=${HEADERS_XML}
+    ...    ELSE    Get Request    ${session}    /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/master-database/    headers=${HEADERS_XML}
     Should be Equal As Strings    ${resp.status_code}    200
     [Return]    ${resp.content}
 
 Clean Bindings
     [Arguments]    ${node}=127.0.0.1    ${session}=session
     [Documentation]    Delete all bindings via RPC from Master DB of node
-    ${resp}    Get Bindings Master Database    ${node}    ${session}
-    @{prefixes}    Parse Prefix Groups    ${resp}    local
-    : FOR    ${prefix}    IN    @{prefixes}
-    \    Clean Binding    ${prefix}    ${prefix['binding']}    ${node}    ${session}
+    ${resp}    Get Bindings    ${node}    ${session}
+    @{bindings}    Run Keyword If    '${ODL_STREAM}' == 'boron'    Parse Bindings    ${resp}
+    ...    ELSE    Parse Prefix Groups    ${resp}    local
+    : FOR    ${binding}    IN    @{bindings}
+    \    Run Keyword If    '${ODL_STREAM}' == 'boron'    Clean Binding    ${binding['sgt']}    ${binding['ip-prefix']}    ${node}
+    \    ...    ${session}
+    \    ...    ELSE    Clean Binding    ${binding}    ${binding['binding']}    ${node}
+    \    ...    ${session}
 
 Clean Binding
-    [Arguments]    ${prefix}    ${bindings}    ${node}    ${session}
+    [Arguments]    ${sgt}    ${prefixes}    ${node}    ${session}
     [Documentation]    Used for nester FOR loop
-    : FOR    ${binding}    IN    @{bindings}
-    \    Delete Binding    ${prefix['sgt']}    ${binding['ip-prefix']}    ${node}    ${session}
-
-Get Bindings Master Database
-    [Arguments]    ${node}=127.0.0.1    ${session}=session
-    [Documentation]    Gets content of Master DB from node
-    ${resp}    Get Request    ${session}    /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/master-database/    headers=${HEADERS_XML}
-    Should be Equal As Strings    ${resp.status_code}    200
-    [Return]    ${resp.content}
+    : FOR    ${prefix}    IN    @{prefixes}
+    \    Run Keyword If    '${ODL_STREAM}' == 'boron'    Delete Binding    ${sgt}    ${prefix}    ${node}
+    \    ...    ${session}
+    \    ...    ELSE    Delete Binding    ${sgt['sgt']}    ${prefix['ip-prefix']}    ${node}
+    \    ...    ${session}
 
 Update Binding
     [Arguments]    ${sgtOld}    ${prefixOld}    ${sgtNew}    ${prefixNew}    ${node}=127.0.0.1    ${session}=session
@@ -148,33 +150,21 @@ Delete Filter
     Should be Equal As Strings    ${resp.status_code}    200
 
 Should Contain Binding
-    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${db_source}=local
+    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${db_source}=any
     [Documentation]    Tests if data contains specified binding
-    ${out}    Find Binding    ${resp}    ${sgt}    ${prefix}    ${db_source}    add
+    ${out}    Run Keyword If    '${ODL_STREAM}' == 'boron'    Find Binding    ${resp}    ${sgt}    ${prefix}
+    ...    ELSE    Find Binding Legacy    ${resp}    ${sgt}    ${prefix}    ${db_source}
+    ...    add
     Should Be True    ${out}    Doesn't have ${sgt} ${prefix}
-    ${out}    Find Binding    ${resp}    ${sgt}    ${prefix}    ${db_source}    delete
-    Should Not Be True    ${out}    Should't have ${sgt} ${prefix}
 
 Should Not Contain Binding
-    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${db_source}=local
+    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${db_source}=any
     [Documentation]    Tests if data doesn't contains specified binding
-    ${out}    Find Binding    ${resp}    ${sgt}    ${prefix}    ${db_source}    add
+    ${out}    Run Keyword If    '${ODL_STREAM}' == 'boron'    Find Binding    ${resp}    ${sgt}    ${prefix}
+    ...    ELSE    Find Binding Legacy    ${resp}    ${sgt}    ${prefix}    ${db_source}
+    ...    add
     Should Not Be True    ${out}    Should't have ${sgt} ${prefix}
 
-Should Contain Binding With Peer Sequence
-    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${source}    ${seq}=0    ${db_source}=local
-    [Documentation]    Tests if data contains specified binding with peer sequence
-    ${out}    Find Binding With Peer Sequence    ${resp}    ${sgt}    ${prefix}    ${db_source}    add
-    ...    ${source}    ${seq}
-    Should Be True    ${out}    Doesn't have ${sgt} ${prefix} ${source} ${seq} ${db_source}
-
-Should Not Contain Binding With Peer Sequence
-    [Arguments]    ${resp}    ${sgt}    ${prefix}    ${source}    ${seq}=0    ${db_source}=local
-    [Documentation]    Tests if data doesn't contains specified binding with peer sequence
-    ${out}    Find Binding With Peer Sequence    ${resp}    ${sgt}    ${prefix}    ${db_source}    add
-    ...    ${source}    ${seq}
-    Should Not Be True    ${out}    Should't have ${sgt} ${prefix} ${source} ${seq} ${db_source}
-
 Should Contain Connection
     [Arguments]    ${resp}    ${ip}    ${port}    ${mode}    ${version}    ${state}=none
     [Documentation]    Test if data contains specified connection
@@ -196,7 +186,7 @@ Setup Topology Complex
     \    ...    ${PASSWORD}
     \    Add Connection    ${version}    both    127.0.0.${node}    64999    127.0.0.1
     \    ...    ${PASSWORD}
-    \    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    both
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both
     \    ...    127.0.0.${node}
     \    Add Binding    ${node}0    10.10.10.${node}0/32    127.0.0.${node}
     \    Add Binding    ${node}0    10.10.${node}0.0/24    127.0.0.${node}
@@ -211,7 +201,7 @@ Setup SXP Environment
     [Documentation]    Create session to Controller
     Verify Feature Is Installed    odl-sxp-all
     Create Session    session    url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
-    Wait Until Keyword Succeeds    15    3    Get Bindings Master Database
+    Wait Until Keyword Succeeds    15    1    Get Bindings
 
 Clean SXP Environment
     [Documentation]    Destroy created sessions
index 52bcbdeb2f30eb29bf063afa9544fbd1fcd64bb5..2a57a70903516e360f5ab4d83602ea4b47179443 100644 (file)
@@ -14,12 +14,12 @@ Resource          ../../../variables/Variables.py
 *** Test Cases ***
 Test Add Binding
     [Documentation]    Test if bindings are added to Master DB
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Add Binding    5230    1.1.1.1/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Contain Binding    ${resp}    5230    1.1.1.1/32
     Add Binding    30    2001:0:0:0:0:0:0:0/128
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Contain Binding    ${resp}    30    2001:0:0:0:0:0:0:0/128
 
 Test Add Connection
@@ -34,13 +34,13 @@ Test Add Connection
 Test Delete Binding
     [Documentation]    Test if bindings are deleted from Master DB
     Add Binding    52301    12.1.1.1/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Contain Binding    ${resp}    52301    12.1.1.1/32
     Delete Binding    2631    12.1.1.1/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Contain Binding    ${resp}    52301    12.1.1.1/32
     Delete Binding    52301    12.1.1.1/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Not Contain Binding    ${resp}    52301    12.1.1.1/32
 
 Test Delete Connection
@@ -58,10 +58,10 @@ Test Delete Connection
 Test Update Binding
     [Documentation]    Test if bindings can be updated to different values
     Add Binding    3230    1.1.1.10/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Contain Binding    ${resp}    3230    1.1.1.10/32
     Update Binding    3230    1.1.1.10/32    623    10.10.10.10/32
-    ${resp}    Get Bindings Master Database
+    ${resp}    Get Bindings
     Should Not Contain Binding    ${resp}    3230    1.1.1.10/32
     Should Contain Binding    ${resp}    623    10.10.10.10/32
 
index a4074f71de51438880dacb0b5519e61bb3acbb2e..1481963d96736934f7dcc4c8176bc686e54a80ef 100644 (file)
@@ -69,18 +69,18 @@ Test Nodes
     \    ...    ${PASSWORD}
     \    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
     \    ...    ${PASSWORD}
-    \    Wait Until Keyword Succeeds    15    4    Verify Connection    ${cmp_version}    listener
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    listener
     \    ...    127.0.0.2    64999    127.0.0.1
-    \    Wait Until Keyword Succeeds    15    4    Verify connection    ${cmp_version}    speaker
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    speaker
     \    ...    127.0.0.1    64999    127.0.0.2
     \    Log    OK ${r_version}:listener ${version}:speaker
     \    Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.3
     \    ...    ${PASSWORD}
     \    Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.2
     \    ...    ${PASSWORD}
-    \    Wait Until Keyword Succeeds    15    4    Verify Connection    ${cmp_version}    listener
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    listener
     \    ...    127.0.0.2    64999    127.0.0.3
-    \    Wait Until Keyword Succeeds    15    4    Verify connection    ${cmp_version}    speaker
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    speaker
     \    ...    127.0.0.3    64999    127.0.0.2
     \    Log    OK ${version}:listener ${r_version}:speaker
     \    Run Keyword If    '${version}' == 'version4' and '${r_version}' == 'version4'    Test Both    ${version}    ${r_version}    ${PASSWORD}
@@ -92,9 +92,9 @@ Test Both
     ${cmp_version}    Lower Version    ${r_version}    ${version}
     Add Connection    ${r_version}    both    127.0.0.3    64999    127.0.0.1    ${PASSWORD}
     Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.3    ${PASSWORD}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${cmp_version}    both    127.0.0.3
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    both    127.0.0.3
     ...    64999    127.0.0.1
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${cmp_version}    both    127.0.0.1
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${cmp_version}    both    127.0.0.1
     ...    64999    127.0.0.3
     Log    OK ${r_version}:both ${version}:both
 
index 692b71b4c802cdea72a125a70f8ce768c5850307..eae9726cdc6ce12daa7a167da5b9fac0ed5ceb36 100644 (file)
@@ -87,7 +87,7 @@ Check One Group 4-2
     ...    permit ACL 10.10.10.0 0.0.0.255
     ...    permit ACL 10.0.0.0 0.254.0.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.5
+    ${resp}    Get Bindings    127.0.0.5
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -104,7 +104,7 @@ Check One Group 4-2
     Should Not Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
     Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.3
+    ${resp}    Get Bindings    127.0.0.3
     Should Contain Binding    ${resp}    50    10.10.10.50/32    sxp
     Should Contain Binding    ${resp}    50    10.10.50.0/24    sxp
     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
@@ -115,7 +115,7 @@ Check Two Group 4-2
     ...    Database should contains only Bindings regarding to these matches:
     ...    permit ACL 10.0.0.0 0.255.255.255
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.5
+    ${resp}    Get Bindings    127.0.0.5
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -132,7 +132,7 @@ Check Two Group 4-2
     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
     Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.3
+    ${resp}    Get Bindings    127.0.0.3
     Should Contain Binding    ${resp}    50    10.10.10.50/32    sxp
     Should Contain Binding    ${resp}    50    10.10.50.0/24    sxp
     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
@@ -143,7 +143,7 @@ Check Three Group 4-2
     ...    Database should contains only Bindings regarding to these matches:
     ...    deny ACL 10.0.0.0 0.255.255.255
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.5
+    ${resp}    Get Bindings    127.0.0.5
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -167,7 +167,7 @@ Check One Group 5-3
     ...    permit SGT 30 ACL 10.10.10.0 0.0.0.255
     ...    permit SGT 50 ACL 10.0.0.0 0.254.0.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.4
+    ${resp}    Get Bindings    127.0.0.4
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -184,7 +184,7 @@ Check One Group 5-3
     Should Not Contain Binding    ${resp}    50    10.10.50.0/24    sxp
     Should Contain Binding    ${resp}    50    10.50.0.0/16    sxp
     Should Not Contain Binding    ${resp}    50    50.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.2
+    ${resp}    Get Bindings    127.0.0.2
     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
@@ -195,7 +195,7 @@ Check Two Group 5-3
     ...    Database should contains only Bindings regarding to these matches:
     ...    permit ESGT 20,40 ACL 10.0.0.0 0.255.255.255
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.4
+    ${resp}    Get Bindings    127.0.0.4
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -212,7 +212,7 @@ Check Two Group 5-3
     Should Not Contain Binding    ${resp}    50    10.10.50.0/24    sxp
     Should Not Contain Binding    ${resp}    50    10.50.0.0/16    sxp
     Should Not Contain Binding    ${resp}    50    50.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.2
+    ${resp}    Get Bindings    127.0.0.2
     Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
     Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
index 1677d42a7b76c7d9cb7f422c82c8b7b7afd6d8fd..151762cce2c90e4c1c464aec9a7e9822e85dae99 100644 (file)
@@ -90,16 +90,16 @@ Setup Nodes
     \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
     Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.2    ${password}
     Add Connection    ${version}    both    127.0.0.2    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    both    127.0.0.2
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.2
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    ${password}
     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    listener    127.0.0.3
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
     Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.4    ${password}
     Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    both    127.0.0.4
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.4
     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.5    ${password}
     Add Connection    ${version}    speaker    127.0.0.5    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    speaker    127.0.0.5
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.5
 
 Check One Group 4-5
     [Documentation]    Check if only bindings matching filter nodes 4 and 5
@@ -109,7 +109,7 @@ Check One Group 4-5
     ...    permit ACL 10.0.0.0 0.255.255.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
     : FOR    ${node}    IN RANGE    4    6
-    \    ${resp}    Get Bindings Master Database    127.0.0.${node}
+    \    ${resp}    Get Bindings    127.0.0.${node}
     \    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     \    Should Not Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -122,7 +122,7 @@ Check One Group 4-5
     \    Should Not Contain Binding    ${resp}    30    10.10.30.0/24    sxp
     \    Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.2
+    ${resp}    Get Bindings    127.0.0.2
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -143,7 +143,7 @@ Check Two Group 4-5
     ...    permit ACL 10.10.0.0 0.0.255.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
     : FOR    ${node}    IN RANGE    4    6
-    \    ${resp}    Get Bindings Master Database    127.0.0.${node}
+    \    ${resp}    Get Bindings    127.0.0.${node}
     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     \    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -156,7 +156,7 @@ Check Two Group 4-5
     \    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
     \    Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
     \    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.2
+    ${resp}    Get Bindings    127.0.0.2
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -179,7 +179,7 @@ Check One Group 2-5
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
     @{list}    Create List    127.0.0.2    127.0.0.5
     : FOR    ${node}    IN    @{list}
-    \    ${resp}    Get Bindings Master Database    ${node}
+    \    ${resp}    Get Bindings    ${node}
     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     \    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     \    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -192,7 +192,7 @@ Check One Group 2-5
     \    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     \    Should Not Contain Binding    ${resp}    40    10.40.0.0/16    sxp
     \    Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.4
+    ${resp}    Get Bindings    127.0.0.4
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -213,7 +213,7 @@ Check Two Group 2-5
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
     @{list}    Create List    127.0.0.2    127.0.0.5
     : FOR    ${node}    IN    @{list}
-    \    ${resp}    Get Bindings Master Database    ${node}
+    \    ${resp}    Get Bindings    ${node}
     \    Should Not Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     \    Should Not Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     \    Should Not Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -226,7 +226,7 @@ Check Two Group 2-5
     \    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
     \    Should Not Contain Binding    ${resp}    40    10.40.0.0/16    sxp
     \    Should Not Contain Binding    ${resp}    40    40.0.0.0/8    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.4
+    ${resp}    Get Bindings    127.0.0.4
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
index e6bfe9a78e6042125f44cd8d61ae3b353abb9462..6a1e4c72df14618ec43486241e550f9f107e29db 100644 (file)
@@ -127,7 +127,7 @@ Setup Nodes
     \    ...    ${password}
     \    Add Connection    ${version}    both    127.0.0.${node}    64999    127.0.0.1
     \    ...    ${password}
-    \    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    both
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both
     \    ...    127.0.0.${node}
     \    Add Binding    ${node}0    10.10.10.${node}0/32    127.0.0.${node}
     \    Add Binding    ${node}0    10.10.${node}0.0/24    127.0.0.${node}
@@ -135,6 +135,8 @@ Setup Nodes
     \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
     Add Connection    ${version}    both    127.0.0.5    64999    127.0.0.3    ${password}
     Add Connection    ${version}    both    127.0.0.3    64999    127.0.0.5    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.5
+    ...    64999    127.0.0.3
     Add Binding    50    10.10.10.50/32    127.0.0.5
     Add Binding    50    10.10.50.0/24    127.0.0.5
     Add Binding    50    10.50.0.0/16    127.0.0.5
@@ -153,16 +155,16 @@ Setup Nodes Legacy Par One
     \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.2    ${password}
     Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    speaker    127.0.0.2
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4    ${password}
     Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    speaker    127.0.0.4
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.4
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    ${password}
     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    listener    127.0.0.3
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
     Add Connection    ${version}    listener    127.0.0.5    64999    127.0.0.3    ${password}
     Add Connection    ${version}    speaker    127.0.0.3    64999    127.0.0.5    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    listener    127.0.0.5
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.5
     ...    64999    127.0.0.3
 
 Setup Nodes Legacy Par Two
@@ -174,16 +176,16 @@ Setup Nodes Legacy Par Two
     \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2    ${password}
     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    listener    127.0.0.2
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.4    ${password}
     Add Connection    ${version}    listener    127.0.0.4    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    listener    127.0.0.4
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.4
     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.3    ${password}
     Add Connection    ${version}    speaker    127.0.0.3    64999    127.0.0.1    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    speaker    127.0.0.3
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.3
     Add Connection    ${version}    speaker    127.0.0.5    64999    127.0.0.3    ${password}
     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.5    ${password}
-    Wait Until Keyword Succeeds    15    4    Verify Connection    ${version}    speaker    127.0.0.5
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.5
     ...    64999    127.0.0.3
 
 Check One Group 4-2
@@ -192,7 +194,7 @@ Check One Group 4-2
     ...    permit ACL 10.10.10.0 0.0.0.255
     ...    permit ACL 10.0.0.0 0.254.0.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.5
+    ${resp}    Get Bindings    127.0.0.5
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
@@ -216,7 +218,7 @@ Check One Group 5-3
     ...    permit SGT 30 ACL 10.10.10.0 0.0.0.255
     ...    permit SGT 50 ACL 10.0.0.0 0.254.0.0
     ...    Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide
-    ${resp}    Get Bindings Master Database    127.0.0.4
+    ${resp}    Get Bindings    127.0.0.4
     Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
     Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
     Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
index ac52b4080c5261a219de5204917d61626413cc66..d6331fc53cd447a87afb7011514fa7082eb2ffd6 100644 (file)
@@ -2,7 +2,7 @@
 Documentation     Test suite to verify Behaviour in different topologies
 Suite Setup       Setup SXP Environment
 Suite Teardown    Clean SXP Environment
-Test Setup        Clean Nodes
+Test Teardown     Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
 Library           ../../../libraries/Sxp.py
@@ -17,143 +17,92 @@ Resource          ../../../variables/Variables.py
 Export Test
     [Documentation]    Test behaviour after shutting down connections in Version4
     Setup Topology Triangel    version4
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    0    sxp
+    Wait Until Keyword Succeeds    4    1    Check Export Part One
     Delete Connections    127.0.0.1    64999    127.0.0.3
-    Sleep    2s
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    1    sxp
+    Delete Connections    127.0.0.3    64999    127.0.0.1
+    Wait Until Keyword Succeeds    4    1    Check Export Part Two
     Delete Connections    127.0.0.1    64999    127.0.0.2
-    Sleep    2s
-    ${resp}    Get Bindings Master Database
-    Should Not Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
-    Should Not Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    1    sxp
+    Delete Connections    127.0.0.2    64999    127.0.0.1
+    Wait Until Keyword Succeeds    4    1    Check Export Part Three
 
 Export Test Legacy
     [Documentation]    Test behaviour after shutting down connections in Legacy versions
     @{list} =    Create List    version1
     : FOR    ${version}    IN    @{list}
     \    Setup Topology Triangel    ${version}
-    \    ${resp}    Get Bindings Master Database
-    \    Should Contain Binding    ${resp}    542    5.5.5.5/32    sxp
-    \    Should Contain Binding    ${resp}    99    15.15.15.15/32    sxp
+    \    Wait Until Keyword Succeeds    4    1    Check Export Part One
     \    Delete Connections    127.0.0.1    64999    127.0.0.3
-    \    Sleep    2s
-    \    ${resp}    Get Bindings Master Database
-    \    Should Contain Binding    ${resp}    542    5.5.5.5/32    sxp
-    \    Should Contain Binding    ${resp}    99    15.15.15.15/32    sxp
+    \    Delete Connections    127.0.0.3    64999    127.0.0.1
+    \    Wait Until Keyword Succeeds    4    1    Check Export Part Two
     \    Delete Connections    127.0.0.1    64999    127.0.0.2
-    \    Sleep    2s
-    \    ${resp}    Get Bindings Master Database
-    \    Should Not Contain Binding    ${resp}    542    5.5.5.5/32    sxp
-    \    Should Not Contain Binding    ${resp}    99    15.15.15.15/32    sxp
-    \    Log    ${version} OK
+    \    Delete Connections    127.0.0.2    64999    127.0.0.1
+    \    Wait Until Keyword Succeeds    4    1    Check Export Part Three
     \    Clean Nodes
 
 Forwarding Test V2=>V1
     [Documentation]    Version 2 => 1 functionality
     Setup Topology Linear    version2    version1
-    ${resp}    Get Bindings Master Database
-    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
-    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
-    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
-    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
-    Log    Init OK
-    ${resp}    Get Bindings Master Database    127.0.0.3
-    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
-    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
-    Should Not Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
-    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
-    Log    Forward OK
+    Wait Until Keyword Succeeds    4    1    Check Forwarding V2=>V1
 
 Forwarding Test V3=>V2
     [Documentation]    Version 3 => 2 functionality
     Setup Topology Linear    version3    version2
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
-    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
-    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
-    Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
-    Log    Init OK
-    ${resp}    Get Bindings Master Database    127.0.0.3
-    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
-    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
-    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
-    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
-    Log    Forward OK
+    Wait Until Keyword Succeeds    4    1    Check Forwarding V3=>V2
 
 Forwarding Test V4=>V3
     [Documentation]    Version 4 => 3 functionality
     Setup Topology Linear    version4    version3
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding With Peer Sequence    ${resp}    6    56.56.56.0/24    127.0.0.2    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    66    9.9.9.9/32    127.0.0.2    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2    0    sxp
-    Log    Init OK
-    ${resp}    Get Bindings Master Database    127.0.0.3
-    Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
-    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
-    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
-    Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
-    Log    Forward OK
+    Wait Until Keyword Succeeds    4    1    Check Forwarding V4=>V3
 
 Most Recent Rule Test
     [Documentation]    Most Recent Rule
     Setup Topology Fork    version4
     Add Binding    542    5.5.5.5/32    127.0.0.2
     Sleep    2s
-    Add Binding    542    5.5.5.5/32    127.0.0.3
-    Add Binding    99    15.15.15.15/32    127.0.0.3
+    Add Binding    543    5.5.5.5/32    127.0.0.3
+    Add Binding    100    15.15.15.15/32    127.0.0.3
     Sleep    2s
     Add Binding    99    15.15.15.15/32    127.0.0.2
     Sleep    1s
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    0    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.4
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    1    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    1    sxp
+    ${resp}    Get Bindings
+    Should Contain Binding    ${resp}    543    5.5.5.5/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
+    ${resp}    Get Bindings    127.0.0.4
+    Should Contain Binding    ${resp}    543    5.5.5.5/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
 
 Shorthest Path Test
     [Documentation]    Shorthes Path over Most Recent
     Add Connection    version4    listener    127.0.0.5    64999    127.0.0.3
     Add Connection    version4    speaker    127.0.0.3    64999    127.0.0.5
+    Wait Until Keyword Succeeds    15    1    Verify Connection    version4    listener    127.0.0.5
+    ...    64999    127.0.0.3
     Setup Topology Fork    version4
     Add Binding    542    5.5.5.5/32    127.0.0.2
-    Sleep    2s
-    Add Binding    542    5.5.5.5/32    127.0.0.5
+    Add Binding    545    5.5.5.5/32    127.0.0.5
     Add Binding    99    15.15.15.15/32    127.0.0.2
     Add Binding    9954    105.15.125.15/32    127.0.0.5
-    Sleep    2s
-    Add Binding    99    15.15.15.15/32    127.0.0.5
-    ${resp}    Get Bindings Master Database
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    9954    105.15.125.15/32    127.0.0.5    1    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    0    sxp
-    ${resp}    Get Bindings Master Database    127.0.0.4
-    Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    1    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    9954    105.15.125.15/32    127.0.0.5    2    sxp
-    Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    1    sxp
+    Add Binding    95    15.15.15.15/32    127.0.0.5
+    Wait Until Keyword Succeeds    4    1    Check Shorthest Path
 
 *** Keywords ***
 Setup Topology Triangel
     [Arguments]    ${version}
     [Documentation]    Setup 3 nodes connected to each other
     Add Binding    542    5.5.5.5/32    127.0.0.2
-    Add Binding    542    5.5.5.5/32    127.0.0.3
+    Add Binding    543    5.5.5.5/32    127.0.0.3
     Add Binding    99    15.15.15.15/32    127.0.0.3
     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
-    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
-    Sleep    1s
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
-    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.2
-    Sleep    2s
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
+    Sleep    1s
+    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
+    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.2
     Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.3
-    Sleep    3s
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
+    ...    64999    127.0.0.3
 
 Setup Topology Linear
     [Arguments]    ${version}    ${r_version}
@@ -163,23 +112,103 @@ Setup Topology Linear
     Add Binding    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2
     Add Binding    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2
     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
-    Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.1
-    Sleep    1s
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
+    Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.1
     Add Connection    ${r_version}    listener    127.0.0.1    64999    127.0.0.3
-    Sleep    2s
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${r_version}    speaker    127.0.0.3
 
 Setup Topology Fork
     [Arguments]    ${version}
     [Documentation]    Setup 4 nodes in to T topology
-    Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
-    Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1
-    Sleep    2s
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
-    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
+    Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
+    Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1
     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4
-    Sleep    3s
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.4
+
+Check Export Part One
+    [Documentation]    Checks if Bindings 542 5.5.5.5/32 is replaced by 543 5.5.5.5/32
+    ${resp}    Get Bindings
+    log    ${resp}
+    Should Contain Binding    ${resp}    543    5.5.5.5/32
+    Should Not Contain Binding    ${resp}    542    5.5.5.5/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
+
+Check Export Part Two
+    [Documentation]    Checks if Bindings 542 5.5.5.5/32 was updated after peer shutdown
+    ${resp}    Get Bindings
+    log    ${resp}
+    Should Not Contain Binding    ${resp}    543    5.5.5.5/32
+    Should Contain Binding    ${resp}    542    5.5.5.5/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
+
+Check Export Part Three
+    [Documentation]    Checks if database is empty after peers shutdown
+    ${resp}    Get Bindings
+    log    ${resp}
+    Should Not Contain Binding    ${resp}    542    5.5.5.5/32
+    Should Not Contain Binding    ${resp}    99    15.15.15.15/32
+
+Check Forwarding V2=>V1
+    [Documentation]    Check if appropriate bindings are exported per version
+    ${resp}    Get Bindings
+    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
+    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
+    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
+    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
+    Log    Init OK
+    ${resp}    Get Bindings    127.0.0.3
+    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
+    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
+    Should Not Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
+    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
+    Log    Forward OK
+
+Check Forwarding V3=>V2
+    [Documentation]    Check if appropriate bindings are exported per version
+    ${resp}    Get Bindings
+    Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
+    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
+    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
+    Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
+    Log    Init OK
+    ${resp}    Get Bindings    127.0.0.3
+    Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
+    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
+    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
+    Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
+    Log    Forward OK
+
+Check Forwarding V4=>V3
+    [Documentation]    Check if appropriate bindings are exported per version
+    ${resp}    Get Bindings
+    Should Contain Binding    ${resp}    6    56.56.56.0/24
+    Should Contain Binding    ${resp}    66    9.9.9.9/32
+    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
+    Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
+    Log    Init OK
+    ${resp}    Get Bindings    127.0.0.3
+    Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
+    Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
+    Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
+    Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
+    Log    Forward OK
+
+Check Shorthest Path
+    [Documentation]    Checks if Shorthest path rule is applied onto bindings
+    ${resp}    Get Bindings
+    Should Contain Binding    ${resp}    542    5.5.5.5/32
+    Should Contain Binding    ${resp}    9954    105.15.125.15/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
+    ${resp}    Get Bindings    127.0.0.4
+    Should Contain Binding    ${resp}    542    5.5.5.5/32
+    Should Contain Binding    ${resp}    9954    105.15.125.15/32
+    Should Contain Binding    ${resp}    99    15.15.15.15/32
 
 Clean Nodes
     Clean Connections    127.0.0.1
@@ -187,10 +216,8 @@ Clean Nodes
     Clean Connections    127.0.0.3
     Clean Connections    127.0.0.4
     Clean Connections    127.0.0.5
-    Sleep    5s
     Clean Bindings    127.0.0.1
     Clean Bindings    127.0.0.2
     Clean Bindings    127.0.0.3
     Clean Bindings    127.0.0.4
     Clean Bindings    127.0.0.5
-    Sleep    5s
index 1bbeda0803f5983491dc937fe4893c2fccf25f56..a4acf25d1ba9753a3c84b4565aee486444fb2719 100644 (file)
@@ -18,7 +18,7 @@ Test Mega Topology
     [Documentation]    Stress test that contains of connecting 20 Nodes and exporting their bindings
     Setup Mega Topology
     Sleep    5s
-    ${resp}    Get Bindings Master Database    127.0.0.1
+    ${resp}    Get Bindings    127.0.0.1
     : FOR    ${num}    IN RANGE    2    22
     \    ${ip}    Get Ip From Number    ${num}
     \    Should Contain Binding    ${resp}    ${num}    ${ip}/32    sxp
@@ -27,7 +27,7 @@ Test Complex Mega Topology
     [Documentation]    Stress test that contains of connecting 30 Nodes and exporting their bindings
     Setup Complex Mega Topology
     Sleep    5s
-    ${resp}    Get Bindings Master Database    127.0.0.1
+    ${resp}    Get Bindings    127.0.0.1
     : FOR    ${num}    IN RANGE    22    32
     \    ${ip}    Get Ip From Number    ${num}
     \    Should Contain Binding    ${resp}    ${num}    ${ip}/32    sxp
@@ -40,7 +40,7 @@ Text Bindings export
     Add Connection    version4    listener    127.0.0.2    64999    127.0.0.1
     Add Connection    version4    speaker    127.0.0.1    64999    127.0.0.2
     Sleep    5s
-    ${resp}    Get Bindings Master Database    127.0.0.1
+    ${resp}    Get Bindings    127.0.0.1
     : FOR    ${num}    IN RANGE    2    102
     \    ${ip}    Get Ip From Number    ${num}
     \    Should Contain Binding    ${resp}    ${num}    ${ip}/32    sxp
@@ -53,6 +53,8 @@ Setup Mega Topology
     \    Add Binding    ${num}    ${ip}/32    ${ip}
     \    Add Connection    ${version}    listener    ${ip}    64999    127.0.0.1
     \    Add Connection    ${version}    speaker    127.0.0.1    64999    ${ip}
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
+    \    ...    ${ip}
 
 Setup Complex Mega Topology
     [Arguments]    ${version}=version4
@@ -64,10 +66,14 @@ Setup Complex Mega Topology
     \    Add Binding    ${num}    ${ip}/32    ${ip}
     \    Add Connection    ${version}    listener    ${ip}    64999    ${second_ip}
     \    Add Connection    ${version}    speaker    ${second_ip}    64999    ${ip}
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
+    \    ...    ${ip}    64999    ${second_ip}
     \    ${second_num}    Set Variable    ${second_num + 1}
     \    ${second_ip}    Get Ip From Number    ${second_num}
     \    Add Connection    ${version}    listener    ${ip}    64999    ${second_ip}
     \    Add Connection    ${version}    speaker    ${second_ip}    64999    ${ip}
+    \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
+    \    ...    ${ip}    64999    ${second_ip}
 
 Clean Nodes
     : FOR    ${num}    IN RANGE    1    32