Remove usage of removed RPC update-entry 12/73912/7
authorIvan Hrasko <ihrasko@cisco.com>
Wed, 11 Jul 2018 08:03:34 +0000 (10:03 +0200)
committerIvan Hrasko <ihrasko@cisco.com>
Mon, 16 Jul 2018 11:59:45 +0000 (13:59 +0200)
- update-entry RPC was deprecated since Boron
and removed for Fluorine release
- now user can use combination of delete-bindings
and add-bindings to have the same behavior as
removed update-entry RPC
- add-bindings RPC can be used also to update
bindings with new values for the same ip prefix

Change-Id: I21dcf51ea5e0d0780383beb8dc69df8e9c6d8e49
Signed-off-by: Ivan Hrasko <ihrasko@cisco.com>
csit/libraries/Sxp.py
csit/libraries/SxpLib.robot
csit/suites/sxp/basic/020_Restconf_CRUD.robot

index 1df82e816b87a85da9d6fd65bca3caf5b6f689fa..c7a85e3697259f9f29240e5332307ef379fce71a 100644 (file)
@@ -608,42 +608,6 @@ def delete_connections_xml(address, port, node, domain_name):
     return data
 
 
-def update_binding_xml(sgt0, prefix0, sgt1, prefix1, ip, domain_name):
-    """Generate xml for Update Binding request
-
-    :param sgt0: Original Source Group Tag
-    :type sgt0: str
-    :param prefix0: Original Ipv4/6 prefix
-    :type prefix0: str
-    :param sgt1: New Source Group Tag
-    :type sgt1: str
-    :param prefix1: New Ipv4/6 prefix
-    :type prefix1: str
-    :param ip: Ipv4 address of node
-    :type ip: str
-    :param domain_name: Name of Domain
-    :type domain_name: str
-    :returns: String containing xml data for request
-
-    """
-    templ = Template('''<input>
-  <requested-node xmlns="urn:opendaylight:sxp:controller">$ip</requested-node>
-  $domain
-  <original-binding xmlns="urn:opendaylight:sxp:controller">
-    <sgt>$sgt0</sgt>
-    <ip-prefix>$prefix0</ip-prefix>
-  </original-binding>
-  <new-binding xmlns="urn:opendaylight:sxp:controller">
-    <sgt>$sgt1</sgt>
-    <ip-prefix>$prefix1</ip-prefix>
-  </new-binding>
-</input>''')
-    data = templ.substitute(
-        {'sgt0': sgt0, 'sgt1': sgt1, 'prefix0': prefix0, 'prefix1': prefix1, 'ip': ip,
-         'domain': get_domain_name(domain_name)})
-    return data
-
-
 def delete_binding_xml(sgt, prefix, ip, domain_name):
     """Generate xml for Delete Binding request
 
index 24be60cee07217e6bac671ada4dd11c316ea4f5f..090ae67552d98b354aeb2c85611ee884d42eb853 100644 (file)
@@ -82,7 +82,7 @@ Verify Connection
 
 Add Bindings
     [Arguments]    ${sgt}    ${prefixes}    ${node}=127.0.0.1    ${session}=session    ${domain}=global
-    [Documentation]    Add one or more bindings via RPC to Master DB of the node
+    [Documentation]    Add/Update one or more bindings via RPC to Master DB of the node
     ${DATA}    Add Bindings Xml    ${node}    ${domain}    ${sgt}    ${prefixes}
     Post To Controller    ${session}    add-bindings    ${DATA}
 
@@ -117,14 +117,6 @@ Clean Binding
     : FOR    ${prefix}    IN    @{prefixes}
     \    Delete Binding Default    ${sgt}    ${prefix}    ${node}    ${domain}    ${session}
 
-Update Binding
-    [Arguments]    ${sgtOld}    ${prefixOld}    ${sgtNew}    ${prefixNew}    ${node}=127.0.0.1    ${session}=session
-    ...    ${domain}=global
-    [Documentation]    Updates value of binding via RPC in Master DB of node
-    ${DATA}    Update Binding Xml    ${sgtOld}    ${prefixOld}    ${sgtNew}    ${prefixNew}    ${node}
-    ...    ${domain}
-    Post To Controller    ${session}    update-entry    ${DATA}
-
 Delete Binding Default
     [Arguments]    ${sgt}    ${prefix}    ${node}    ${domain}    ${session}
     [Documentation]    Delete binding via RPC
index af518e67b2ea52cb2cc13fd030bd39ba75a9b296..a747f67d54ee2bdaf49e89dbda6855df10a9f190 100644 (file)
@@ -19,6 +19,16 @@ Test Add Bindings
     Add Bindings    30    2001:0:0:0:0:0:0:0/128
     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    30    2001:0:0:0:0:0:0:0/128
 
+Test Update Bindings
+    [Documentation]    Test if bindings can be updated to different SGT values by new incoming bindings for the same IP prefix
+    [Tags]    Restconf CRUD    SXP
+    Add Bindings    30    1.1.1.10/32
+    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    30    1.1.1.10/32
+    Sleep    1s    New binding must be at least 1s newer
+    Add Bindings    40    1.1.1.10/32
+    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Not Contain    30    1.1.1.10/32
+    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    40    1.1.1.10/32
+
 Test Add Connection
     [Documentation]    Test if connections are added to Node
     [Tags]    Restconf CRUD    SXP
@@ -52,15 +62,6 @@ Test Delete Connection
     Wait Until Keyword Succeeds    3x    250ms    Connections Should Not Contain    127.1.0.30    60000    speaker
     ...    version4
 
-Test Update Binding
-    [Documentation]    Test if bindings can be updated to different values
-    [Tags]    Restconf CRUD    SXP
-    Add Bindings    3230    1.1.1.10/32
-    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    3230    1.1.1.10/32
-    Update Binding    3230    1.1.1.10/32    623    10.10.10.10/32
-    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Not Contain    3230    1.1.1.10/32
-    Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    623    10.10.10.10/32
-
 *** Keywords ***
 Clean Node
     Clean Bindings    127.0.0.1