From d7023501bce8bd8287a93cc1e7044740765199c5 Mon Sep 17 00:00:00 2001 From: Jozef Behran Date: Fri, 18 Sep 2015 12:25:03 +0200 Subject: [PATCH] Added BGP_PORT and BGP_TOOL_PORT 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 --- csit/suites/bgpcep/bgpuser/cases.robot | 10 ++++------ csit/variables/Variables.py | 4 ++++ csit/variables/bgpuser/bgp_peer/data.xml | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/csit/suites/bgpcep/bgpuser/cases.robot b/csit/suites/bgpcep/bgpuser/cases.robot index 4cd26d8a9e..eba29808ec 100644 --- a/csit/suites/bgpcep/bgpuser/cases.robot +++ b/csit/suites/bgpcep/bgpuser/cases.robot @@ -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 diff --git a/csit/variables/Variables.py b/csit/variables/Variables.py index a646240efe..6c136016cb 100644 --- a/csit/variables/Variables.py +++ b/csit/variables/Variables.py @@ -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 = '>' diff --git a/csit/variables/bgpuser/bgp_peer/data.xml b/csit/variables/bgpuser/bgp_peer/data.xml index 1bf8c6ef22..843a6e633d 100644 --- a/csit/variables/bgpuser/bgp_peer/data.xml +++ b/csit/variables/bgpuser/bgp_peer/data.xml @@ -2,7 +2,7 @@ prefix:bgp-peer example-bgp-peer $IP - 17900 + $PEER_PORT $HOLDTIME $INITIATE -- 2.36.6