Added BGP_PORT and BGP_TOOL_PORT 54/27154/5
authorJozef Behran <jbehran@cisco.com>
Fri, 18 Sep 2015 10:25:03 +0000 (12:25 +0200)
committerVratko Polák <vrpolak@cisco.com>
Thu, 24 Sep 2015 15:24:43 +0000 (15:24 +0000)
There are now multiple suites with hardwired ports for 1790 and
17900 for the ODL BGP port and BGP tool port respectively so now
it makes sense to put this into the Variables.py file.

Change-Id: Ib04c5aa07fe144799418545c5384cd6b48bb4276
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/suites/bgpcep/bgpuser/cases.robot
csit/variables/Variables.py
csit/variables/bgpuser/bgp_peer/data.xml

index 4cd26d8a9e10d49442dda58af5760d781fff1ee1..eba29808ecda370c578a915fc3d77f1820289ece 100644 (file)
@@ -42,14 +42,13 @@ Check_For_Empty_Topology_Before_Talking
 
 Reconfigure_ODL_To_Accept_Connection
     [Documentation]    Configure BGP peer module with initiate-connection set to false.
-    ${template_as_string}=    BuiltIn.Set_Variable    {'IP': '${MININET}', 'HOLDTIME': '${HOLDTIME}', 'INITIATE': 'false'}
+    ${template_as_string}=    BuiltIn.Set_Variable    {'IP': '${MININET}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'false'}
     ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf    ${directory_with_template_folders}${/}bgp_peer    ${template_as_string}
 
 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.
-    # TODO: Do we want to define ${BGP_PORT} in Variables.py?
-    BGPSpeaker.Start_BGP_Speaker    --amount 2 --myip=${MININET} --myport=17900 --peerip=${CONTROLLER} --peerport=1790
+    BGPSpeaker.Start_BGP_Speaker    --amount 2 --myip=${MININET} --myport=${BGP_TOOL_PORT} --peerip=${CONTROLLER} --peerport=${ODL_BGP_PORT}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Talking_Connection_Is_Established
@@ -77,8 +76,7 @@ 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.
-    # TODO: ${BGP_TOOL_PORT} is probably not worth the trouble.
-    BGPSpeaker.Start_BGP_Speaker    --amount 2 --listen --myip=${MININET} --myport=17900 --peerip=${CONTROLLER}
+    BGPSpeaker.Start_BGP_Speaker    --amount 2 --listen --myip=${MININET} --myport=${BGP_TOOL_PORT} --peerip=${CONTROLLER}
     Read_And_Fail_If_Prompt_Is_Seen
 
 Check_Listening_Connection_Is_Not_Established_Yet
@@ -92,7 +90,7 @@ Check_For_Empty_Topology_Before_Listening
 
 Reconfigure_ODL_To_Initiate_Connection
     [Documentation]    Replace BGP peer config module, now with initiate-connection set to true.
-    ${template_as_string}=    BuiltIn.Set_Variable    {'IP': '${MININET}', 'HOLDTIME': '${HOLDTIME}', 'INITIATE': 'true'}
+    ${template_as_string}=    BuiltIn.Set_Variable    {'IP': '${MININET}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'true'}
     ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf    ${directory_with_template_folders}${/}bgp_peer    ${template_as_string}
 
 Check_Listening_Connection_Is_Established
index a646240efeb80f48a27ec5c1104c656e3ee64f3c..6c136016cb76a7eb9734019201bc04aaa95f8dfb 100644 (file)
@@ -38,6 +38,10 @@ KARAF_PROMPT = 'opendaylight-user'
 KARAF_USER = 'karaf'
 KARAF_PASSWORD = 'karaf'
 
+# BGP variables
+ODL_BGP_PORT = '1790'
+BGP_TOOL_PORT = '17900'
+
 # VM Environment Variables
 DEFAULT_LINUX_PROMPT = '>'
 
index 1bf8c6ef220ee3ce6acc0111d93519c082846d58..843a6e633d11f52b40b388fad23fe0498e710db2 100644 (file)
@@ -2,7 +2,7 @@
     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
     <name>example-bgp-peer</name>
     <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
-    <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">17900</port>
+    <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
     <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
     <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
     <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">