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
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}
: 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
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
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