*** Settings ***
-Documentation PCEP performance suite, uses restconf with configurable authentication.
+Documentation PCEP performance suite, uses restconf with configurable authentication.
...
-... Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+... Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
...
-... This program and the accompanying materials are made available under the
-... terms of the Eclipse Public License v1.0 which accompanies this distribution,
-... and is available at http://www.eclipse.org/legal/epl-v10.html
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
...
...
-... General Overview:
+... General Overview:
...
-... This is a suite which has both scale and performance aspects.
-... Given scale target, suite reports failures if functional error
-... is detected, or if various time limits expire.
-... For passing test cases, their duration is the performance metric.
+... This is a suite which has both scale and performance aspects.
+... Given scale target, suite reports failures if functional error
+... is detected, or if various time limits expire.
+... For passing test cases, their duration is the performance metric.
...
-... ODL acts as a translation layer between PCEP capable devices
-... and users employing RESTCONF.
-... Performance measurement focuses on two different workflows.
+... ODL acts as a translation layer between PCEP capable devices
+... and users employing RESTCONF.
+... Performance measurement focuses on two different workflows.
...
-... The first workflow is initial synchronization, when ODL learns
-... the state of PCEP topology as devices connect to it,
-... while restconf user reads the state repeatedly.
-... The second workflow is mass update, when restconf users issue RPCs
-... to updale Layer Switched Paths on Path Computation Clients.
+... The first workflow is initial synchronization, when ODL learns
+... the state of PCEP topology as devices connect to it,
+... while restconf user reads the state repeatedly.
+... The second workflow is mass update, when restconf users issue RPCs
+... to updale Layer Switched Paths on Path Computation Clients.
...
-... This suite uses pcc-mock (downloaded from Nexus) to simulate PCCs.
-... It needs segment of bindable IP addresses,
-... one for each simulated PCC; so running pcc-mock from remote machine
-... is only viable when just single PCC is simulated.
-... Testing with multiple PCCs works best when pcc-mock
-... runs on the same VM as ODL, so 127.0.0.0/8 subnet can be used.
+... This suite uses pcc-mock (downloaded from Nexus) to simulate PCCs.
+... It needs segment of bindable IP addresses,
+... one for each simulated PCC; so running pcc-mock from remote machine
+... is only viable when just single PCC is simulated.
+... Testing with multiple PCCs works best when pcc-mock
+... runs on the same VM as ODL, so 127.0.0.0/8 subnet can be used.
...
-... Library AuthStandalone is used directly for restconf reads
-... in the first workflow. That library transparently handles several
-... http authentication methods, based on credentials and pybot arguments.
+... Library AuthStandalone is used directly for restconf reads
+... in the first workflow. That library transparently handles several
+... http authentication methods, based on credentials and pybot arguments.
...
-... In the second workflow, updater.py utility is used for issuing
-... rapid restconf requests. It can use multiple worker threads,
-... as http requests are blocking.
-... Due to CPython interpreter itself being single threaded,
-... amounts of threads above 8-16 are actually slightly slower
-... (which may roughly correspond to network traffic
-... being more limiting factor than CPU).
-... This suite starts updater utility bound to single CPU,
-... as this setup was the most performant in other tests.
+... In the second workflow, updater.py utility is used for issuing
+... rapid restconf requests. It can use multiple worker threads,
+... as http requests are blocking.
+... Due to CPython interpreter itself being single threaded,
+... amounts of threads above 8-16 are actually slightly slower
+... (which may roughly correspond to network traffic
+... being more limiting factor than CPU).
+... This suite starts updater utility bound to single CPU,
+... as this setup was the most performant in other tests.
...
-... In case of failed test case, other tests are skipped (unless
-... this is overriden by [Setup]) to finish test run sooner.
+... In case of failed test case, other tests are skipped (unless
+... this is overriden by [Setup]) to finish test run sooner.
...
-... Variables and test case names refer to Controller(ODL_SYSTEM) and Mininet
-... (TOOLS_SYSTEM), those are assumed to be separate remote VMs, one to host ODL,
-... other to host tools.
-... In case updater and pcc-mock are desired to run
-... from separate machines, their parameters use Mininet(TOOLS_SYSTEM)
-... values as default.
-... If both updater VM and pcc-mock VM parameters are specified,
-... Mininet(TOOLS_SYSTEM) parameters may be skipped.
-... Variable ${USE_TOOLS_SYSTEM} decides the pcc-mock running machine.
+... Variables and test case names refer to Controller(ODL_SYSTEM) and Mininet
+... (TOOLS_SYSTEM), those are assumed to be separate remote VMs, one to host ODL,
+... other to host tools.
+... In case updater and pcc-mock are desired to run
+... from separate machines, their parameters use Mininet(TOOLS_SYSTEM)
+... values as default.
+... If both updater VM and pcc-mock VM parameters are specified,
+... Mininet(TOOLS_SYSTEM) parameters may be skipped.
+... Variable ${USE_TOOLS_SYSTEM} decides the pcc-mock running machine.
...
-... Some launch scripts put restrictions on how pybot options
-... can be specified, so there are utility variables to help with
-... copying Controller related value to apply fo updater of pccmock.
-... Having a tool co-located with ODL reduces network latency,
-... but puts more pressure on CPU and memory on Controller VM.
+... Some launch scripts put restrictions on how pybot options
+... can be specified, so there are utility variables to help with
+... copying Controller related value to apply fo updater of pccmock.
+... Having a tool co-located with ODL reduces network latency,
+... but puts more pressure on CPU and memory on Controller VM.
...
-... In some environments, issues with TIME-WAIT prevent high restconf rates,
-... so TCP reuse is temporarily allowed during the suite run, if possible
-... (and if not disabled by UPDATERVM_ENABLE_TCP_RW_REUSE option value).
-... See http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
-... This suite ignores possible failures when changing reuse.
+... In some environments, issues with TIME-WAIT prevent high restconf rates,
+... so TCP reuse is temporarily allowed during the suite run, if possible
+... (and if not disabled by UPDATERVM_ENABLE_TCP_RW_REUSE option value).
+... See http://vincent.bernat.im/en/blog/2014-tcp-time-wait-state-linux.html
+... This suite ignores possible failures when changing reuse.
...
-... Similarly, in some environments, handling of requests.Session object matters
-... try changing RESTCONF_REUSE value to see if it helps.
+... Similarly, in some environments, handling of requests.Session object matters
+... try changing RESTCONF_REUSE value to see if it helps.
...
-... Variables to override (only if needed) in pybot command:
-... (Look into Variables table to see the default values.)
+... Variables to override (only if needed) in pybot command:
+... (Look into Variables table to see the default values.)
...
-... FIRST_PCC_IP: Set in case bind address is different from public pcc-mock VM address.
-... LOG_NAME: Filename (without path) to save pcc-mock output into.
-... LOG_PATH: Override if not the same as pccmock VM workspace.
-... LSPS: Number of LSPs per PCC to simulate and test.
-... MOCK_FILE: Filename to use for mock-pcc executable instead of the timestamped one.
-... ODL_SYSTEM_IP: Numeric IP address of VM where ODL runs.
-... ODL_SYSTEM_USER: Username for ssh login to ODL VM.
-... ODL_SYSTEM_PASSWORD: Ssh password, empty means public keys are used instead.
-... ODL_SYSTEM_PROMPT: Substring to identify Linux prompt on ODL VM.
-... ODL_SYSTEM_WORKSPACE: Path to where files can be written on ODL VM.
-... PCCDOWNLOAD_HOSTHEADER: Download server may check checks this header before showing content.
-... PCCDOWNLOAD_URLBASE: URL to pcep-pcc-mock folder in Nexus (use numberic IP if DNS has problems).
-... PCCMOCK_COLOCATED: If True, set PCCMOCKVM* to mirror ODL_SYSTEM*
-... PCCMOCKVM_IP: Override TOOLS_SYSTEM for pcc-mock usage.
-... PCCMOCKVM_*: Override corresponding TOOLS_SYSTEM_* for pcc-mock usage.
-... PCCS: Number of PCCs to simulate and test.
-... PCEP_READY_VERIFY_TIMEOUT: Grace period for pcep-topology to appear. Lower if ODL is ready.
-... RESTCONF_*: USER, PASSWORD and SCOPE to authenticate with, REUSE session.
-... (Note: If SCOPE is not empty, token-based authentication is used.)
-... TOOLS_SYSTEM_IP: Numeric IP address of VM to run pcc-mock and updater from by default.
-... TOOLS_SYSTEM_PASSWORD: Linux password to go with the username (empty means keys).
-... TOOLS_SYSTEM_PROMPT: Substring to identify Linux prompt on TOOLS_SYSTEM VM.
-... TOOLS_SYSTEM_USER: Linux username to SSH to on TOOLS_SYSTEM VM.
-... TOOLS_SYSTEM_WORKSPACE: Path to where files may be created on TOOLS_SYSTEM VM.
-... UPDATER_COLOCATED: If True, overrides UPDATERVM_* parameters to point at ODL_SYSTEM
-... (The purpose is to provide an option without ability to unpack ODL_SYSTEM value.)
-... UPDATER_ODLADDRESS: Override if public ODL_SYSTEM address is not best fit.
-... UPDATER_REFRESH: Main updater thread may sleep this long. Balance precision with overhead.
-... UPDATER_TIMEOUT: If updater stops itself if running more than this time.
-... (Set this limit according to your performance target.)
-... UPDATERVM_ENABLE_TCP_RW_REUSE: Set to false if changing Linux configuration is not desired.
-... UPDATERVM_IP: Override TOOLS_SYSTEM for updater.py usage.
-... UPDATERVM_*: Override corresponding TOOLS_SYSTEM_* for updater.py usage.
-Suite Setup Initial Setup
-Suite Teardown Disconnect
-Test Setup FailFast.Fail_This_Fast_On_Previous_Error
-Test Teardown FailFast.Start_Failing_Fast_If_This_Failed
-Library SSHLibrary timeout=10s
-Library RequestsLibrary
-Library ${CURDIR}/../../../libraries/AuthStandalone.py
-Resource ${CURDIR}/../../../variables/Variables.robot
-Resource ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource ${CURDIR}/../../../libraries/FailFast.robot
-Resource ${CURDIR}/../../../libraries/NexusKeywords.robot # for Deploy_Artifact
-Resource ${CURDIR}/../../../libraries/SSHKeywords.robot # for Require_* and Assure_*, Flexible_SSH_Login
+... FIRST_PCC_IP: Set in case bind address is different from public pcc-mock VM address.
+... LOG_NAME: Filename (without path) to save pcc-mock output into.
+... LOG_PATH: Override if not the same as pccmock VM workspace.
+... LSPS: Number of LSPs per PCC to simulate and test.
+... MOCK_FILE: Filename to use for mock-pcc executable instead of the timestamped one.
+... ODL_SYSTEM_IP: Numeric IP address of VM where ODL runs.
+... ODL_SYSTEM_USER: Username for ssh login to ODL VM.
+... ODL_SYSTEM_PASSWORD: Ssh password, empty means public keys are used instead.
+... ODL_SYSTEM_PROMPT: Substring to identify Linux prompt on ODL VM.
+... ODL_SYSTEM_WORKSPACE: Path to where files can be written on ODL VM.
+... PCCDOWNLOAD_HOSTHEADER: Download server may check checks this header before showing content.
+... PCCDOWNLOAD_URLBASE: URL to pcep-pcc-mock folder in Nexus (use numberic IP if DNS has problems).
+... PCCMOCK_COLOCATED: If True, set PCCMOCKVM* to mirror ODL_SYSTEM*
+... PCCMOCKVM_IP: Override TOOLS_SYSTEM for pcc-mock usage.
+... PCCMOCKVM_*: Override corresponding TOOLS_SYSTEM_* for pcc-mock usage.
+... PCCS: Number of PCCs to simulate and test.
+... PCEP_READY_VERIFY_TIMEOUT: Grace period for pcep-topology to appear. Lower if ODL is ready.
+... RESTCONF_*: USER, PASSWORD and SCOPE to authenticate with, REUSE session.
+... (Note: If SCOPE is not empty, token-based authentication is used.)
+... TOOLS_SYSTEM_IP: Numeric IP address of VM to run pcc-mock and updater from by default.
+... TOOLS_SYSTEM_PASSWORD: Linux password to go with the username (empty means keys).
+... TOOLS_SYSTEM_PROMPT: Substring to identify Linux prompt on TOOLS_SYSTEM VM.
+... TOOLS_SYSTEM_USER: Linux username to SSH to on TOOLS_SYSTEM VM.
+... TOOLS_SYSTEM_WORKSPACE: Path to where files may be created on TOOLS_SYSTEM VM.
+... UPDATER_COLOCATED: If True, overrides UPDATERVM_* parameters to point at ODL_SYSTEM
+... (The purpose is to provide an option without ability to unpack ODL_SYSTEM value.)
+... UPDATER_ODLADDRESS: Override if public ODL_SYSTEM address is not best fit.
+... UPDATER_REFRESH: Main updater thread may sleep this long. Balance precision with overhead.
+... UPDATER_TIMEOUT: If updater stops itself if running more than this time.
+... (Set this limit according to your performance target.)
+... UPDATERVM_ENABLE_TCP_RW_REUSE: Set to false if changing Linux configuration is not desired.
+... UPDATERVM_IP: Override TOOLS_SYSTEM for updater.py usage.
+... UPDATERVM_*: Override corresponding TOOLS_SYSTEM_* for updater.py usage.
+
+Library SSHLibrary timeout=10s
+Library RequestsLibrary
+Library ${CURDIR}/../../../libraries/AuthStandalone.py
+Resource ${CURDIR}/../../../variables/Variables.robot
+Resource ${CURDIR}/../../../libraries/BGPcliKeywords.robot
+Resource ${CURDIR}/../../../libraries/FailFast.robot
+Resource ${CURDIR}/../../../libraries/NexusKeywords.robot # for Deploy_Artifact
+Resource ${CURDIR}/../../../libraries/SSHKeywords.robot # for Require_* and Assure_*, Flexible_SSH_Login
+
+Suite Setup Initial Setup
+Suite Teardown Disconnect
+Test Setup FailFast.Fail_This_Fast_On_Previous_Error
+Test Teardown FailFast.Start_Failing_Fast_If_This_Failed
+
*** Variables ***
# This Variable decides the pcc mock to run in ODL system or tools system.
-${USE_TOOLS_SYSTEM} False
+${USE_TOOLS_SYSTEM} False
# This table acts as an exhaustive list of variables users can modify on pybot invocation.
# It also contains commented-out lines for variables defined elswhere.
# Keep this list in alphabetical order.
-${BLOCKING-THREAD} 1
-${DELAY_TIME} 10
-${FIRST_PCC_IP} ${PCCMOCKVM_IP}
+${BLOCKING-THREAD} 1
+${DELAY_TIME} 10
+${FIRST_PCC_IP} ${PCCMOCKVM_IP}
# ${LOG_FILE} is reserved for location of pybot-created log.html
-${INIT_PCC_DEVICE_COUNT} ${100}
-${LOG_NAME} throughpcep.log
-${LOG_PATH} ${PCCMOCKVM_WORKSPACE}
-${LSPS} 65535
+${INIT_PCC_DEVICE_COUNT} ${100}
+${LOG_NAME} throughpcep.log
+${LOG_PATH} ${PCCMOCKVM_WORKSPACE}
+${LSPS} 65535
#Reduced max pcc device count to 100 for BGPCEP-901
-${MAX_PCC_DEVICE_COUNT} ${100}
-${ODL_SYSTEM_WORKSPACE} /tmp
-${PARALLEL_ITERATION} 10
-${PCC_DEVICE_INCREMENT} ${50}
-${PCCDOWNLOAD_HOSTHEADER} nexus.opendaylight.org
-${PCCDOWNLOAD_URLBASE} http://${PCCDOWNLOAD_HOSTHEADER}/content/repositories/opendaylight.snapshot/org/opendaylight/bgpcep/pcep-pcc-mock/
-${PCCMOCK_COLOCATED} False
-${PCCMOCKVM_IP} ${TOOLS_SYSTEM_IP}
-${PCCMOCKVM_PASSWORD} ${TOOLS_SYSTEM_PASSWORD}
-${PCCMOCKVM_PROMPT} ${TOOLS_SYSTEM_PROMPT}
-${PCCMOCKVM_USER} ${TOOLS_SYSTEM_USER}
-${PCCMOCKVM_WORKSPACE} ${TOOLS_SYSTEM_WORKSPACE}
-${PCCS} 1
-${PCEP_READY_VERIFY_TIMEOUT} 300s
+${MAX_PCC_DEVICE_COUNT} ${100}
+${ODL_SYSTEM_WORKSPACE} /tmp
+${PARALLEL_ITERATION} 10
+${PCC_DEVICE_INCREMENT} ${50}
+${PCCDOWNLOAD_HOSTHEADER} nexus.opendaylight.org
+${PCCDOWNLOAD_URLBASE}
+... http://${PCCDOWNLOAD_HOSTHEADER}/content/repositories/opendaylight.snapshot/org/opendaylight/bgpcep/pcep-pcc-mock/
+${PCCMOCK_COLOCATED} False
+${PCCMOCKVM_IP} ${TOOLS_SYSTEM_IP}
+${PCCMOCKVM_PASSWORD} ${TOOLS_SYSTEM_PASSWORD}
+${PCCMOCKVM_PROMPT} ${TOOLS_SYSTEM_PROMPT}
+${PCCMOCKVM_USER} ${TOOLS_SYSTEM_USER}
+${PCCMOCKVM_WORKSPACE} ${TOOLS_SYSTEM_WORKSPACE}
+${PCCS} 1
+${PCEP_READY_VERIFY_TIMEOUT} 300s
# Yes, the default timeout is 5 minutes, as this suite might be started eagerly just after ODL starts booting up.
-${RESTCONF_PASSWORD} ${PWD} # from Variables.robot
-${RESTCONF_REUSE} True
-${RESTCONF_SCOPE} ${EMPTY}
-${RESTCONF_USER} ${USER} # from Variables.robot
-${SEQUENTIAL_ITERATION} 15
-${TOOLS_SYSTEM_WORKSPACE} /tmp
-${UPDATER_COLOCATED} False
-${UPDATER_ODLADDRESS} ${ODL_SYSTEM_IP}
-${UPDATER_REFRESH} 0.1
+${RESTCONF_PASSWORD} ${PWD} # from Variables.robot
+${RESTCONF_REUSE} True
+${RESTCONF_SCOPE} ${EMPTY}
+${RESTCONF_USER} ${USER} # from Variables.robot
+${SEQUENTIAL_ITERATION} 15
+${TOOLS_SYSTEM_WORKSPACE} /tmp
+${UPDATER_COLOCATED} False
+${UPDATER_ODLADDRESS} ${ODL_SYSTEM_IP}
+${UPDATER_REFRESH} 0.1
# Updater timeout is overwritten in releng/builder
-${UPDATER_TIMEOUT} 300
+${UPDATER_TIMEOUT} 300
${UPDATERVM_ENABLE_TCP_RW_REUSE} True
-${UPDATERVM_IP} ${TOOLS_SYSTEM_IP}
-${UPDATERVM_PASSWORD} ${TOOLS_SYSTEM_PASSWORD}
-${UPDATERVM_PROMPT} ${TOOLS_SYSTEM_PROMPT}
-${UPDATERVM_USER} ${TOOLS_SYSTEM_USER}
-${UPDATERVM_WORKSPACE} ${TOOLS_SYSTEM_WORKSPACE}
+${UPDATERVM_IP} ${TOOLS_SYSTEM_IP}
+${UPDATERVM_PASSWORD} ${TOOLS_SYSTEM_PASSWORD}
+${UPDATERVM_PROMPT} ${TOOLS_SYSTEM_PROMPT}
+${UPDATERVM_USER} ${TOOLS_SYSTEM_USER}
+${UPDATERVM_WORKSPACE} ${TOOLS_SYSTEM_WORKSPACE}
+
*** Test Cases ***
Put_Updater
[Documentation] Open SSH session to updater VM, copy the utility there, including dependencies, also prepare direct http session.
- BuiltIn.Run_Keyword_If ${UPDATER_COLOCATED} Updater_From_Controller
+ IF ${UPDATER_COLOCATED} Updater_From_Controller
SSHLibrary.Open_Connection ${UPDATERVM_IP} alias=updater
SSHLibrary.Set_Client_Configuration timeout=20s
SSHLibrary.Set_Client_Configuration prompt=${UPDATERVM_PROMPT}
SSHKeywords.Assure_Library_Ipaddr target_dir=${UPDATERVM_WORKSPACE}
# Done preparation of Updater VM, now use AuthStandalone to create session from robot VM too.
BuiltIn.Log_Many ${RESTCONF_USER} ${RESTCONF_PASSWORD} ${RESTCONF_SCOPE} ${ODL_SYSTEM_IP}
- ${session} = AuthStandalone.Init_Session ${ODL_SYSTEM_IP} ${RESTCONF_USER} ${RESTCONF_PASSWORD} ${RESTCONF_SCOPE}
+ ${session} = AuthStandalone.Init_Session
+ ... ${ODL_SYSTEM_IP}
+ ... ${RESTCONF_USER}
+ ... ${RESTCONF_PASSWORD}
+ ... ${RESTCONF_SCOPE}
BuiltIn.Set_Suite_Variable ${rest_session} ${session}
# TODO: Define http timeouts.
${old_value} = SSHLibrary.Execute_Command cat /proc/sys/net/ipv4/tcp_tw_reuse
# The next line may be skipped if the previous line failed.
BuiltIn.Set_Suite_Variable ${tcp_rw_reuse} ${old_value}
- ${out} ${rc} = SSHLibrary.Execute_Command sudo bash -c "echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse" return_rc=True
+ ${out} ${rc} = SSHLibrary.Execute_Command
+ ... sudo bash -c "echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse"
+ ... return_rc=True
BuiltIn.Should_Be_Equal ${rc} ${0}
# Lack of sudo access should not prevent the rest of suite from trying without TCP reuse.
[Teardown] Do_Not_Start_Failing_If_This_Failed
PCEP_sessions_from_multiple_machines
[Documentation] Download and start PCC Mock in tools vm and do updation
- Download_Pcc_Mock ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_USER} ${TOOLS_SYSTEM_PASSWORD} ${TOOLS_SYSTEM_PROMPT} pccmock_toolsvm
+ Download_Pcc_Mock
+ ... ${TOOLS_SYSTEM_IP}
+ ... ${TOOLS_SYSTEM_USER}
+ ... ${TOOLS_SYSTEM_PASSWORD}
+ ... ${TOOLS_SYSTEM_PROMPT}
+ ... pccmock_toolsvm
Set_Hop 0
Start_Pcc_Mock pccmock_toolsvm ${TOOLS_SYSTEM_IP} ${PCCS} ${LSPS} throughpcep_tools.log
${total_size} = BuiltIn.Evaluate int(${size})+int(${LSPS})
PCEP Sessions Flapped with LSP updates
[Documentation] Flapping PCEP sessions and perform LSP updates within flapping
- Run Keyword If '${USE_TOOLS_SYSTEM}' == 'True' BuiltIn.Pass Execution Pcc Mock should not run in ODL System
+ IF '${USE_TOOLS_SYSTEM}' == 'True'
+ BuiltIn.Pass Execution Pcc Mock should not run in ODL System
+ END
FOR ${devices} IN RANGE ${INIT_PCC_DEVICE_COUNT} ${MAX_PCC_DEVICE_COUNT+1} ${PCC_DEVICE_INCREMENT}
Flap Pcc Mock sessions continuously with LSP updates 127.1.0.0 ${devices} 150
END
PCEP Sessions Flapped alongside LSP updates
[Documentation] Flapping PCEP sessions and perform LSP updates alongside flapping
- Run Keyword If '${USE_TOOLS_SYSTEM}' == 'True' BuiltIn.Pass Execution Pcc Mock should not run in ODL System
+ IF '${USE_TOOLS_SYSTEM}' == 'True'
+ BuiltIn.Pass Execution Pcc Mock should not run in ODL System
+ END
FOR ${devices} IN RANGE ${INIT_PCC_DEVICE_COUNT} ${MAX_PCC_DEVICE_COUNT+1} ${PCC_DEVICE_INCREMENT}
Flap Pcc Mock sessions parallelly with LSP updates 127.1.0.0 ${devices} 150
BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
BuiltIn.Pass_Execution_If not ${UPDATERVM_ENABLE_TCP_RW_REUSE} Manipulation of tcp_rw_reuse is not requested.
SSHLibrary.Switch_Connection updater
BuiltIn.Variable_Should_Exist ${tcp_rw_reuse}
- ${out} ${rc} = SSHLibrary.Execute_Command sudo bash -c "echo ${tcp_rw_reuse} > /proc/sys/net/ipv4/tcp_tw_reuse" return_rc=True
+ ${out} ${rc} = SSHLibrary.Execute_Command
+ ... sudo bash -c "echo ${tcp_rw_reuse} > /proc/sys/net/ipv4/tcp_tw_reuse"
+ ... return_rc=True
BuiltIn.Should_Be_Equal ${rc} ${0}
+
*** Keywords ***
Initial Setup
FailFast.Do_Not_Fail_Fast_From_Now_On
Select_MOCK_Machine
[Documentation] Check the tools system variable and assigns the PCC Mock
- Run Keyword If '${USE_TOOLS_SYSTEM}' == 'False' Run Keywords Pccmock_From_Odl_System AND Updater_From_Odl_System
+ IF '${USE_TOOLS_SYSTEM}' == 'False'
+ Pccmock_From_Odl_System
+ Updater_From_Odl_System
+ END
BuiltIn.Set_Suite_Variable ${FIRST_PCC_IP} ${PCCMOCKVM_IP}
Download_Pcc_Mock
- [Arguments] ${pcc_ip}=${PCCMOCKVM_IP} ${pcc_user}=${PCCMOCKVM_USER} ${pcc_password}=${PCCMOCKVM_PASSWORD} ${pcc_prompt}=${PCCMOCKVM_PROMPT} ${ssh_alias}=pccmock
[Documentation] SSH login to pcc-mock VM, download latest pcc-mock executable from Nexus.
- BuiltIn.Run_Keyword_If ${PCCMOCK_COLOCATED} Pccmock_From_Controller
+ [Arguments] ${pcc_ip}=${PCCMOCKVM_IP} ${pcc_user}=${PCCMOCKVM_USER} ${pcc_password}=${PCCMOCKVM_PASSWORD} ${pcc_prompt}=${PCCMOCKVM_PROMPT} ${ssh_alias}=pccmock
+ IF ${PCCMOCK_COLOCATED} Pccmock_From_Controller
NexusKeywords.Initialize_Artifact_Deployment_And_Usage tools_system_connect=False
SSHLibrary.Open_Connection ${pcc_ip} alias=${ssh_alias}
SSHLibrary.Set_Client_Configuration timeout=10s
BuiltIn.Set_Suite_Variable ${mock_location} ${file_name}
Start_Pcc_Mock
- [Arguments] ${ssh_alias}=pccmock ${mock-ip}=${FIRST_PCC_IP} ${pccs}=${PCCS} ${lsps}=${LSPS} ${log_name}=${LOG_NAME}
[Documentation] Launch pcc-mock on background so simulated PCCs start connecting to controller.
+ [Arguments] ${ssh_alias}=pccmock ${mock-ip}=${FIRST_PCC_IP} ${pccs}=${PCCS} ${lsps}=${LSPS} ${log_name}=${LOG_NAME}
SSHLibrary.Switch_Connection ${ssh_alias}
- ${command} = NexusKeywords.Compose_Full_Java_Command -jar ${mock_location} --local-address ${mock-ip} --remote-address ${ODL_SYSTEM_IP} --pcc ${pccs} --lsp ${lsps} &> ${LOG_PATH}/${log_name}
+ ${command} = NexusKeywords.Compose_Full_Java_Command
+ ... -jar ${mock_location} --local-address ${mock-ip} --remote-address ${ODL_SYSTEM_IP} --pcc ${pccs} --lsp ${lsps} &> ${LOG_PATH}/${log_name}
BuiltIn.Log ${command}
SSHLibrary.Write ${command}
# The pccmock SSH session is left alive, but no data will be exchanged for a while.
Get_Pcep_Topology_Data
[Documentation] Use session object to download PCEP topology JSON. Check status and return Response object.
- ${resp} = AuthStandalone.Get_Using_Session ${rest_session} data/${TOPOLOGY_URL}\=pcep-topology?content\=nonconfig
+ ${resp} = AuthStandalone.Get_Using_Session
+ ... ${rest_session}
+ ... data/${TOPOLOGY_URL}\=pcep-topology?content\=nonconfig
# Not Logging content, as it may be huge.
BuiltIn.Should_Be_Equal ${resp.status_code} ${200}
- [Return] ${resp}
+ RETURN ${resp}
Get_Pcep_Topology_Count
- [Arguments] ${pattern}
[Documentation] Get topology data, return number of pattern matches.
+ [Arguments] ${pattern}
${resp} = Get_Pcep_Topology_Data
# BuiltIn.Log ${resp.text}
${count} = BuiltIn.Evaluate len(re.findall('${pattern}', '''${resp.text}''')) modules=re
BuiltIn.Log ${count}
- [Return] ${count}
+ RETURN ${count}
Pcep_Off
[Documentation] Get topology data, Log content and assert the exact JSON of empty topology.
${resp} = Get_Pcep_Topology_Data
# Used before topology had chance to grow huge. Be aware when creating a longevity suite from this.
BuiltIn.Log ${resp.text}
- BuiltIn.Should_Be_Equal ${resp.text} {"network-topology:topology":[{"topology-id":"pcep-topology","topology-types":{"network-topology-pcep:topology-pcep":{}}}]}
+ BuiltIn.Should_Be_Equal
+ ... ${resp.text}
+ ... {"network-topology:topology":[{"topology-id":"pcep-topology","topology-types":{"network-topology-pcep:topology-pcep":{}}}]}
Pcep_On
[Documentation] Get topology count of current hop, assert the number of matches.
BuiltIn.Should_Be_Equal ${resp} ${0}
Set_Hop
- [Arguments] ${iteration}
[Documentation] Set pattern to match the currently expected hop.
+ [Arguments] ${iteration}
${i} = BuiltIn.Evaluate str(1 + int(${iteration}))
# Regular Expressions need a dot to be escaped to represent a dot.
BuiltIn.Set_Suite_Variable ${hop} ${i}\.${i}\.${i}\.${i}/32
BuiltIn.Log ${hop}
Updater
- [Arguments] ${iteration} ${workers} ${mock-ip}=${FIRST_PCC_IP} ${pccs}=${PCCS} ${lsps}=${LSPS} ${parallel}=False ${delegate}=true ${pccip}=${none} ${tunnel_no}=${none}
[Documentation] Compute number of workers, call updater.py, assert its response.
+ [Arguments] ${iteration} ${workers} ${mock-ip}=${FIRST_PCC_IP} ${pccs}=${PCCS} ${lsps}=${LSPS} ${parallel}=False ${delegate}=true ${pccip}=${none} ${tunnel_no}=${none}
SSHLibrary.Switch_Connection pccmock
# In some systems, inactive SSH sessions get severed.
${command} = BuiltIn.Set_Variable echo "still alive"
# The previous line relies on a fact that Execute_Command spawns separate shels, so running pcc-mock is not affected.
Set_Hop ${iteration}
SSHLibrary.Switch_Connection updater
- ${response} = SSHLibrary.Execute_Command bash -c "cd ${UPDATERVM_WORKSPACE}; taskset 0x00000001 python3 updater.py --workers '${workers}' --odladdress '${UPDATER_ODLADDRESS}' --user '${RESTCONF_USER}' --password '${RESTCONF_PASSWORD}' --scope '${RESTCONF_SCOPE}' --pccaddress '${mock-ip}' --pccs '${pccs}' --lsps '${lsps}' --hop '${hop}' --timeout '${UPDATER_TIMEOUT}' --refresh '${UPDATER_REFRESH}' --reuse '${RESTCONF_REUSE}' --delegate '${delegate}' --pccip '${pccip}' --tunnelnumber '${tunnel_no}' 2>&1"
+ ${response} = SSHLibrary.Execute_Command
+ ... bash -c "cd ${UPDATERVM_WORKSPACE}; taskset 0x00000001 python3 updater.py --workers '${workers}' --odladdress '${UPDATER_ODLADDRESS}' --user '${RESTCONF_USER}' --password '${RESTCONF_PASSWORD}' --scope '${RESTCONF_SCOPE}' --pccaddress '${mock-ip}' --pccs '${pccs}' --lsps '${lsps}' --hop '${hop}' --timeout '${UPDATER_TIMEOUT}' --refresh '${UPDATER_REFRESH}' --reuse '${RESTCONF_REUSE}' --delegate '${delegate}' --pccip '${pccip}' --tunnelnumber '${tunnel_no}' 2>&1"
Check Updater response ${response} ${parallel}
Check Updater response
${expected_value_continuous_execution} = BuiltIn.Set_Variable Counter({'pass': ${size}})
${not_expected_value_for_parallel_execution} = BuiltIn.Set_Variable Counter({'pass': 0})
BuiltIn.Log ${expected_value_continuous_execution}
- Run Keyword If '${parallel}' == 'False' BuiltIn.Should_Contain ${response} ${expected_value_continuous_execution}
- ... ELSE BuiltIn.Should_Not_Contain ${response} ${not_expected_value_for_parallel_execution}
+ IF '${parallel}' == 'False'
+ BuiltIn.Should_Contain ${response} ${expected_value_continuous_execution}
+ ELSE
+ BuiltIn.Should_Not_Contain ${response} ${not_expected_value_for_parallel_execution}
+ END
Verify
- [Arguments] ${iteration}
[Documentation] Set hop and verify that within timeout, all LSPs in topology are updated.
+ [Arguments] ${iteration}
Set_Hop ${iteration}
Builtin.Wait_Until_Keyword_Succeeds 30s 1s Pcep_On
SSHLibrary.Put File ${CURDIR}/../../../../tools/pcep_updater/mock.sh /tmp/mock.sh
Set_Hop 0
Builtin.Wait_Until_Keyword_Succeeds ${PCEP_READY_VERIFY_TIMEOUT} 5s Pcep_Off
- SSHLibrary.Start Command sh /tmp/mock.sh ${mock_location} ${mock-ip} ${ODL_SYSTEM_IP} ${pccs} ${lsps} parallel_Execution ${DELAY_TIME} &>1
+ SSHLibrary.Start Command
+ ... sh /tmp/mock.sh ${mock_location} ${mock-ip} ${ODL_SYSTEM_IP} ${pccs} ${lsps} parallel_Execution ${DELAY_TIME} &>1
FOR ${i} IN RANGE ${PARALLEL_ITERATION}
- ${pid} = SSHLibrary.Execute Command ps -fu ${ODL_SYSTEM_USER} | grep "/home/${ODL_SYSTEM_USER}/${mock_location}" | grep -v "grep" | awk '{print $2}'
- Run Keyword If '${pid}'!= "" Log ${pid}
+ ${pid} = SSHLibrary.Execute Command
+ ... ps -fu ${ODL_SYSTEM_USER} | grep "/home/${ODL_SYSTEM_USER}/${mock_location}" | grep -v "grep" | awk '{print $2}'
+ IF '${pid}'!= "" Log ${pid}
${i} = Evaluate ${i}+1
- Run Keyword If '${pid}'!= "" Updater ${i} 1 127.1.0.0 ${pccs} ${lsps} True
+ IF '${pid}'!= ""
+ Updater ${i} 1 127.1.0.0 ${pccs} ${lsps} True
+ END
END
BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
Kill all pcc mock simulator processes
Kill all pcc mock simulator processes
[Arguments] ${ssh_alias}=pccmock
SSHLibrary.Switch_Connection ${ssh_alias}
- ${mock_pid} Get pid /home/${ODL_SYSTEM_USER}/${mock_location}
+ ${mock_pid} = Get pid /home/${ODL_SYSTEM_USER}/${mock_location}
SSHLibrary.Execute_Command kill -9 ${mock_pid}
- ${script_pid_1} Get pid bash -c sh /tmp/mock.sh
+ ${script_pid_1} = Get pid bash -c sh /tmp/mock.sh
SSHLibrary.Execute_Command kill -9 ${script_pid_1}
- ${script_pid_2} Get pid sh /tmp/mock.sh
+ ${script_pid_2} = Get pid sh /tmp/mock.sh
SSHLibrary.Execute_Command kill -9 ${script_pid_2}
Get pid
[Arguments] ${process_name}
- ${pid} = SSHLibrary.Execute Command ps -fu ${ODL_SYSTEM_USER} | grep "${process_name}" | grep -v "grep" | awk '{print $2}'
- [Return] ${pid}
+ ${pid} = SSHLibrary.Execute Command
+ ... ps -fu ${ODL_SYSTEM_USER} | grep "${process_name}" | grep -v "grep" | awk '{print $2}'
+ RETURN ${pid}