X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FSxpLib.robot;h=51ee1b45da9c140a7da3950ca0c8c50bfd7432bf;hb=93e84bcbc3fb72540051be9b4b82425a2fcbe307;hp=314cb55c659852f11bcf94506c7ec59e34e99340;hpb=ee1c58a97ac986bc380c8f904fcbdd502ef9928b;p=integration%2Ftest.git diff --git a/csit/libraries/SxpLib.robot b/csit/libraries/SxpLib.robot index 314cb55c65..51ee1b45da 100644 --- a/csit/libraries/SxpLib.robot +++ b/csit/libraries/SxpLib.robot @@ -31,10 +31,10 @@ Post To Controller Add Node [Arguments] ${node} ${password}=${EMPTY} ${version}=version4 ${port}=64999 ${session}=session ${ip}=${EMPTY} - ... ${ssl_stores}=${EMPTY} + ... ${ssl_stores}=${EMPTY} ${retry_open_timer}=1 [Documentation] Add node via RPC to ODL ${DATA} Add Node Xml ${node} ${port} ${password} ${version} ${ip} - ... keystores=${ssl_stores} + ... keystores=${ssl_stores} retry_open_timer=${retry_open_timer} Post To Controller ${session} add-node ${DATA} Delete Node @@ -80,31 +80,26 @@ Verify Connection ${resp} Get Connections ${node} ${session} ${domain} Should Contain Connection ${resp} ${ip} ${port} ${mode} ${version} ${state} -Add Binding - [Arguments] ${sgt} ${prefix} ${node}=127.0.0.1 ${domain}=global ${session}=session - [Documentation] Add binding via RPC to Master DB of node - ${DATA} Add Entry Xml ${sgt} ${prefix} ${node} ${domain} - Post To Controller ${session} add-entry ${DATA} +Add Bindings + [Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${session}=session ${domain}=global + [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} Get Bindings [Arguments] ${node}=127.0.0.1 ${session}=session ${domain}=global ${scope}=all [Documentation] Gets all binding via RPC from Master DB of node ${DATA} Get Bindings From Node Xml ${node} ${scope} ${domain} - ${resp1} CompareStream.Run_Keyword_If_At_Least_Boron TemplatedRequests.Post_To_Uri ${REST_CONTEXT}:get-node-bindings data=${DATA} accept=${ACCEPT_JSON} content_type=${HEADERS_XML} - ... session=${session} - ${resp2} CompareStream.Run_Keyword_If_Less_Than_Boron TemplatedRequests.Get_As_Json_From_Uri /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/master-database/ session=${session} - ${resp} CompareStream.Set_Variable_If_At_Least_Boron ${resp1} ${resp2} + ${resp} TemplatedRequests.Post_To_Uri ${REST_CONTEXT}:get-node-bindings data=${DATA} accept=${ACCEPT_JSON} content_type=${HEADERS_XML} session=${session} [Return] ${resp} Clean Bindings [Arguments] ${node}=127.0.0.1 ${session}=session ${domain}=global [Documentation] Delete all bindings via RPC from Master DB of node ${resp} Get Bindings ${node} ${session} ${domain} local - @{bindings} CompareStream.Run_Keyword_If_At_Least_Else boron Parse Bindings ${resp} - ... ELSE Parse Prefix Groups ${resp} local + @{bindings} Parse Bindings ${resp} : FOR ${binding} IN @{bindings} - \ CompareStream.Run_Keyword_If_At_Least_Boron Clean Binding Default ${binding} ${node} ${session} ${domain} - \ CompareStream.Run_Keyword_If_At_Most_Beryllium Clean Binding At Most Be ${binding} ${node} ${session} ${domain} + \ Clean Binding Default ${binding} ${node} ${session} ${domain} Clean Binding Default [Arguments] ${binding} ${node} ${session} ${domain} @@ -120,34 +115,13 @@ Clean Binding [Arguments] ${sgt} ${prefixes} ${node} ${session} ${domain}=global [Documentation] Used for nester FOR loop : FOR ${prefix} IN @{prefixes} - \ CompareStream.Run_Keyword_If_At_Least_Boron Delete Binding Default ${sgt} ${prefix} ${node} ${domain} - \ ... ${session} - \ CompareStream.Run_Keyword_If_At_Most_Beryllium Delete Binding Be ${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 - Delete Binding ${sgt} ${prefix} ${node} ${domain} ${session} - -Delete Binding Be - [Arguments] ${sgt} ${prefix} ${node} ${domain} ${session} - [Documentation] Delete binding via RPC - Delete Binding ${sgt['sgt']} ${prefix['ip-prefix']} ${node} ${domain} ${session} - -Delete Binding - [Arguments] ${sgt} ${prefix} ${node}=127.0.0.1 ${domain}=global ${session}=session - [Documentation] Delete binding via RPC from Master DB of node - ${DATA} Delete Binding Xml ${sgt} ${prefix} ${node} ${domain} - Post To Controller ${session} delete-entry ${DATA} + \ Delete Bindings ${sgt} ${prefix} ${node} ${domain} ${session} + +Delete Bindings + [Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${domain}=global ${session}=session + [Documentation] Delete one or more bindings via RPC from Master DB of node + ${DATA} Delete Bindings Xml ${node} ${domain} ${sgt} ${prefixes} + Post To Controller ${session} delete-bindings ${DATA} Add PeerGroup [Arguments] ${name} ${peers}= ${node}=127.0.0.1 ${session}=session @@ -206,17 +180,13 @@ Delete Domain Filter Should Contain Binding [Arguments] ${resp} ${sgt} ${prefix} ${db_source}=any [Documentation] Tests if data contains specified binding - ${out} CompareStream.Run_Keyword_If_At_Least_Else boron Find Binding ${resp} ${sgt} ${prefix} - ... ELSE Find Binding Legacy ${resp} ${sgt} ${prefix} ${db_source} - ... add + ${out} Find Binding ${resp} ${sgt} ${prefix} Should Be True ${out} Doesn't have ${sgt} ${prefix} Should Not Contain Binding [Arguments] ${resp} ${sgt} ${prefix} ${db_source}=any [Documentation] Tests if data doesn't contains specified binding - ${out} CompareStream.Run_Keyword_If_At_Least_Else boron Find Binding ${resp} ${sgt} ${prefix} - ... ELSE Find Binding Legacy ${resp} ${sgt} ${prefix} ${db_source} - ... add + ${out} Find Binding ${resp} ${sgt} ${prefix} Should Not Be True ${out} Should't have ${sgt} ${prefix} Should Contain Connection @@ -266,14 +236,14 @@ Setup Topology Complex \ ... ${PASSWORD} \ 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} - \ Add Binding ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ Add Binding ${node}0 ${node}0.0.0.0/8 127.0.0.${node} - Add Binding 10 10.10.10.10/32 127.0.0.1 - Add Binding 10 10.10.10.0/24 127.0.0.1 - Add Binding 10 10.10.0.0/16 127.0.0.1 - Add Binding 10 10.0.0.0/8 127.0.0.1 + \ Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + \ Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + \ Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + \ Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + Add Bindings 10 10.10.10.10/32 127.0.0.1 + Add Bindings 10 10.10.10.0/24 127.0.0.1 + Add Bindings 10 10.10.0.0/16 127.0.0.1 + Add Bindings 10 10.0.0.0/8 127.0.0.1 Verify Snapshot Was Pushed [Arguments] ${snapshot_string}=22-sxp-controller-one-node.xml @@ -313,18 +283,6 @@ Delete Domain ${DATA} Delete Domain Xml ${node} ${domain_name} Post To Controller ${session} delete-domain ${DATA} -Add Bindings - [Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${session}=session ${domain}=global - [Documentation] Add bindings via RPC to Master DB of node - ${DATA} Add Bindings Xml ${node} ${domain} ${sgt} ${prefixes} - Post To Controller ${session} add-bindings ${DATA} - -Delete Bindings - [Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${session}=session ${domain}=global - [Documentation] Delete bindings via RPC from Master DB of node - ${DATA} Delete Bindings Xml ${node} ${domain} ${sgt} ${prefixes} - Post To Controller ${session} delete-bindings ${DATA} - Add Bindings Range [Arguments] ${sgt} ${start} ${size} ${node}=127.0.0.1 [Documentation] Add Bindings to Node specified by range @@ -359,8 +317,9 @@ Setup SXP Environment Setup SXP Session : FOR ${num} IN RANGE 1 ${node_range} \ ${ip} Get Ip From Number ${num} - \ CompareStream.Run_Keyword_If_At_Least_Boron Add Node ${ip} - \ CompareStream.Run_Keyword_If_At_Least_Boron Wait Until Keyword Succeeds 20 1 Check Node Started ${ip} + \ ${rnd_retry_time} = Evaluate random.randint(1, 10) modules=random + \ Add Node ${ip} retry_open_timer=${rnd_retry_time} + \ Wait Until Keyword Succeeds 20 1 Check Node Started ${ip} Check Node Started [Arguments] ${node} ${port}=64999 ${system}=${ODL_SYSTEM_IP} ${session}=session ${ip}=${node} @@ -375,7 +334,7 @@ Clean SXP Environment [Documentation] Destroy created sessions : FOR ${num} IN RANGE 1 ${node_range} \ ${ip} Get Ip From Number ${num} - \ CompareStream.Run_Keyword_If_At_Least_Boron Delete Node ${ip} + \ Delete Node ${ip} Clean SXP Session Get Routing Configuration From Controller