*** Settings ***
+Resource Utils.txt
*** Variables ***
*** Keywords ***
Get Leader And Verify
[Arguments] ${shard_name} ${old_leader}=${EMPTY}
- ${leader} GetLeader ${shard_name} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ ${leader} GetLeader ${shard_name} ${3} ${3} ${1} ${PORT} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
Should Not Be Equal As Strings ${leader} None
Run Keyword If '${old_leader}'!='${EMPTY}' Should Not Be Equal ${old_leader} ${leader}
[Return] ${leader}
Switch Leader
[Arguments] ${shard_name} ${current_leader}
- StopController ${current_leader} ${USERNAME} ${PASSWORD} ${KARAFHOME}
+ Stop One Or More Controllers ${current_leader}
${new_leader} Wait Until Keyword Succeeds 60s 2s Get Leader And Verify ${shard_name} ${current_leader}
+ # TODO: Future enhanement: make sure the other controller is a follower and not a master or candidate.
Log ${new_leader}
[Return] ${new_leader}
Get All Followers
[Arguments] ${shard_name}
- ${followers} GetFollowers ${shard_name} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ ${followers} GetFollowers ${shard_name} ${3} ${3} ${1} ${PORT} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
Log ${followers}
Should Not Be Empty ${followers}
[Return] ${followers}
\ Should Not Contain ${resp.content} ${i}
Clean Mininet System
- [Arguments] ${mininet_system}=${MININET}
- Run Command On Remote System ${mininet_system} sudo mn -c
- Run Command On Remote System ${mininet_system} sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh
+ [Arguments] ${mininet_system}=${MININET}
+ Run Command On Remote System ${mininet_system} sudo mn -c
+ Run Command On Remote System ${mininet_system} sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh
Extract Value From Content
[Arguments] ${content} ${index} ${strip}=nostrip
[Return] ${value}
Get Process ID Based On Regex On Remote System
- [Documentation] Uses ps to find a process that matches the supplied regex. Returns the PID of that process
+ [Arguments] ${remote_system} ${regex_string_to_match_on}
+ [Documentation] Uses ps to find a process that matches the supplied regex. Returns the PID of that process
... The ${regex_string_to_match_on} should produce a unique process otherwise the PID returned may not be
... the expected PID
- [Arguments] ${remote_system} ${regex_string_to_match_on}
# doing the extra -v grep in this command to exclude the grep process itself from the output
${output}= Run Command On Remote System ${remote_system} ps -elf | grep -v grep | grep ${regex_string_to_match_on} | awk '{print $4}'
# ${output} contains the system prompt and all we want is the value of the number
[Return] ${pid}
Get Process Thread Count On Remote System
+ [Arguments] ${remote_system} ${pid}
[Documentation] Executes the ps command to retrieve the lightweight process (aka thread) count.
- [Arguments] ${remote_system} ${pid}
${output}= Run Command On Remote System ${remote_system} ps --no-headers -o nlwp ${pid}
# ${output} contains the system prompt and all we want is the value of the number
${thread_count}= Fetch From Left ${output} \r
[Return] ${string_to_return}
Run Command On Remote System
- [Arguments] ${remote_system} ${cmd} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=30s
+ [Arguments] ${remote_system} ${cmd} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=30s ${keyfile_pass}=all
[Documentation] Reduces the common work of running a command on a remote system to a single higher level robot keyword,
... taking care to log in with a public key and. The command given is written and the output returned. No test conditions
... are checked.
- Log Attempting to execute ${cmd} on ${remote_system}
+ Log Attempting to execute ${cmd} on ${remote_system} by ${user} with ${keyfile_pass} and ${prompt}
${conn_id}= SSHLibrary.Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
- Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa any
+ Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa ${keyfile_pass}
SSHLibrary.Write ${cmd}
- ${output}= SSHLibrary.Read Until ${LINUX_PROMPT}
+ ${output}= SSHLibrary.Read Until ${prompt}
SSHLibrary.Close Connection
Log ${output}
[Return] ${output}
${body} OperatingSystem.Get File ${data_file}
${resp} RequestsLibrary.Put session ${dest_uri} data=${body} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
+
+Stop One Or More Controllers
+ [Arguments] @{controllers}
+ [Documentation] Give this keyword a scalar or list of controllers to be stopped.
+ ${cmd} = Set Variable ${KARAF_HOME}/bin/stop
+ : FOR ${ip} IN @{controllers}
+ \ Run Command On Remote System ${ip} ${cmd} ${USER} ${LINUX_PROMPT} 30s
+ \ ... ${keyfile_pass}
+ : FOR ${ip} IN @{controllers}
+ \ Wait Until Keyword Succeeds 20 s 3 s Controller Down Check ${ip}
+
+Start One Or More Controllers
+ [Arguments] @{controllers}
+ [Documentation] Give this keyword a scalar or list of controllers to be started.
+ ${cmd} = Set Variable ${KARAF_HOME}/bin/start
+ : FOR ${ip} IN @{controllers}
+ \ Run Command On Remote System ${ip} ${cmd} ${USER} ${LINUX_PROMPT} 30s
+ \ ... ${keyfile_pass}
+ : FOR ${ip} IN @{controllers}
+ \ UtilLibrary.Wait For Controller Up ${ip} ${PORT}
+
+Kill One Or More Controllers
+ [Arguments] @{controllers}
+ [Documentation] Give this keyword a scalar or list of controllers to be stopped.
+ ${cmd} = Set Variable ps axf | grep karaf | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
+ : FOR ${ip} IN @{controllers}
+ \ Run Command On Remote System ${ip} ${cmd} ${USER} ${LINUX_PROMPT} 30s
+ \ ... ${keyfile_pass}
+ : FOR ${ip} IN @{controllers}
+ \ Wait Until Keyword Succeeds 20 s 3 s Controller Down Check ${ip}
+
+Controller Down Check
+ [Arguments] ${ip}
+ [Documentation] Checks to see if a controller is down by verifying that the karaf process isn't present.
+ ${cmd} = Set Variable ps axf | grep karaf | grep -v grep | wc -l
+ ${response} Run Command On Remote System ${ip} ${cmd} ${USER} ${LINUX_PROMPT} 30s
+ ... ${keyfile_pass}
+ Log Number of controller instances running: ${response}
+ Should Start With ${response} 0 There may be extra instances of karaf running on the host machine.
+
+Clean One Or More Journals
+ [Arguments] @{controllers}
+ [Documentation] Give this keyword a scalar or list of controllers on which to clean journals.
+ ${del_cmd} = Set Variable rm -rf ${KARAF_HOME}/journal
+ : FOR ${ip} IN @{controllers}
+ \ Run Command On Remote System ${ip} ${del_cmd} ${USER} ${LINUX_PROMPT} 30s
+ \ ... ${keyfile_pass}
*** Settings ***
Documentation Start the controllers
Default Tags 3-node-cluster
-Library Collections
-Library ../../../libraries/RequestsLibrary.py
-Library ../../../libraries/Common.py
-Library ../../../libraries/CrudLibrary.py
-Library ../../../libraries/SettingsLibrary.py
-Library ../../../libraries/UtilLibrary.py
-Variables ../../../variables/Variables.py
+Resource ../../../libraries/Utils.txt
*** Variables ***
-${REST_CONTEXT} /restconf/config/
+@{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
*** Test Cases ***
Stop All Controllers
[Documentation] Stop all the controllers in the cluster
- StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ Stop One Or More Controllers @{controllers}
Clean All Journals
[Documentation] Clean the journals of all the controllers in the cluster
- CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Sleep 5
+ Clean One Or More Journals @{controllers}
Start All Controllers
[Documentation] Start all the controllers in the cluster
- ${rc} StartAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${RESTCONFPORT} ${MEMBER1}
- ... ${MEMBER2} ${MEMBER3}
- Should Be True ${rc}
+ Start One Or More Controllers @{controllers}
Documentation This test finds the leader for shards in a 3-Node cluster and executes CRUD operations on them
Default Tags 3-node-cluster
Library Collections
-Library ../../../libraries/RequestsLibrary.py
+Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/CrudLibrary.py
Library ../../../libraries/SettingsLibrary.py
Variables ../../../variables/Variables.py
*** Variables ***
-${REST_CONTEXT} /restconf/config/
${SHARD_CAR_NAME} shard-car-config
${SHARD_PEOPLE_NAME} shard-people-config
${SHARD_CAR_PERSON_NAME} shard-car-people-config
Documentation This test finds the followers of certain shards in a 3-Node cluster and executes CRUD operations on any one follower
Default Tags 3-node-cluster
Library Collections
-Library ../../../libraries/RequestsLibrary.py
Library ../../../libraries/Common.py
Library ../../../libraries/CrudLibrary.py
Library ../../../libraries/SettingsLibrary.py
Variables ../../../variables/Variables.py
*** Variables ***
-${REST_CONTEXT} /restconf/config/
${SHARD_CAR_NAME} shard-car-config
${SHARD_PEOPLE_NAME} shard-people-config
${SHARD_CAR_PERSON_NAME} shard-car-people-config
Library ../../../libraries/UtilLibrary.py
Library ../../../libraries/ClusterStateLibrary.py
Resource ../../../libraries/ClusterKeywords.txt
+Resource ../../../libraries/Utils.txt
*** Variables ***
${CAR_SHARD} shard-car-config
Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${NEW_CAR_LEADER} ${NUM_CARS}
Restart old Car leader
- StartController ${OLD_CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
+ Start One Or More Controllers ${OLD_CAR_LEADER}
Get added cars from old leader
[Documentation] Get the added cars from the old leader
Wait Until Keyword Succeeds 60s 2s Get People And Verify ${NEW_PEOPLE_LEADER} ${NUM_ENTRIES}
Restart old People leader
- StartController ${OLD_PEOPLE_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
+ Start One Or More Controllers ${OLD_PEOPLE_LEADER}
Get added people from old leader
Wait Until Keyword Succeeds 60s 2s Get People And Verify ${OLD_PEOPLE_LEADER} ${NUM_ENTRIES}
Delete All Cars And Verify ${CAR_LEADER}
Stop all controllers after delete
- StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ @{controllers} = Create List ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
+ Stop One Or More Controllers @{controllers}
Start all controllers after delete
- ${rc} StartAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${RESTCONFPORT} ${MEMBER1}
- ... ${MEMBER2} ${MEMBER3}
- Should Be True ${rc}
+ @{controllers} = Create List ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
+ Start One Or More Controllers @{controllers}
Verify no cars on leader after restart
- ${resp} Getcars ${CAR_LEADER} ${PORT} ${0}
+ ${resp} Getcars ${CAR_LEADER} ${RESTCONFPORT} ${0}
Should Be Equal As Strings ${resp.status_code} 404
Add cars on leader
Add Cars And Verify ${CAR_LEADER} ${NUM_CARS}
Stop all controllers after add
- StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ @{controllers} = Create List ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
+ Stop One Or More Controllers @{controllers}
Start all controllers after add
- ${rc} StartAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${RESTCONFPORT} ${MEMBER1}
- ... ${MEMBER2} ${MEMBER3}
- Should Be True ${rc}
+ @{controllers} = Create List ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
+ Start One Or More Controllers @{controllers}
Get cars from leader after restart
Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${CAR_LEADER} ${NUM_CARS}
Variables ../../../variables/Variables.py
*** Variables ***
-${REST_CONTEXT} /restconf/config/
${CAR_SHARD} shard-car-config
${NUM_CARS} ${60}
+@{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
*** Test Cases ***
Stop All Controllers
[Documentation] Stop all the controllers in the cluster
- StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
+ Stop One Or More Controllers @{controllers}
Clean All Journals
[Documentation] Clean the journals of all the controllers in the cluster
- CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
+ Clean One Or More Journals @{controllers}
Start All Controllers
[Documentation] Start all the controllers in the cluster
- ${rc} StartAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${RESTCONFPORT} ${MEMBER1}
- ... ${MEMBER2} ${MEMBER3}
- Should Be True ${rc}
+ Start One Or More Controllers @{controllers}
Get car leader and followers
${CURRENT_CAR_LEADER} Wait For Leader ${CAR_SHARD}
Set Suite Variable ${CAR_FOLLOWERS}
Stop both of the followers
- StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
- Wait Until Keyword Succeeds 30s 2s Expect No Leader
+ @{followers} = Create List @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
+ Stop One Or More Controllers @{followers}
-Attempt to add a car from the leader
+Attempt to add a car to the leader
[Documentation] Should fail as both followers are down
- AddCar ${CURRENT_CAR_LEADER} ${PORT} ${1}
+ AddCar ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1}
Sleep 2
- ${resp} Getcars ${CURRENT_CAR_LEADER} ${PORT} ${1}
+ ${resp} Getcars ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1}
Should Not Be Equal As Strings ${resp.status_code} 200
Restart the first follower
- StartController @{CAR_FOLLOWERS}[0] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
- Sleep 1
+ Start One Or More Controllers @{CAR_FOLLOWERS}[0]
-Add cars from the first follower
- Wait Until Keyword Succeeds 60s 2s Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS} 4s
+Add cars to the first follower
+ Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS} 4s
Restart the second follower
- StartController @{CAR_FOLLOWERS}[1] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
+ Start One Or More Controllers @{CAR_FOLLOWERS}[1]
Get all the cars from the second follower
- Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
+ Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
*** Keywords ***
Expect No Leader
- ${leader} GetLeader ${CAR_SHARD} ${3} ${1} ${1} ${PORT}
+ ${leader} GetLeader ${CAR_SHARD} ${3} ${1} ${1} ${RESTCONFPORT}
... ${CURRENT_CAR_LEADER}
Should Be Equal As Strings ${leader} None
*** Settings ***
Documentation Test cleanup
Default Tags 3-node-cluster
+Resource ../../../libraries/Utils.txt
Library ../../../libraries/UtilLibrary.py
Variables ../../../variables/Variables.py
+*** Variables ***
+@{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
+
*** Test Cases ***
Kill All Controllers
- KillController ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- KillController ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- KillController ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
+ [Documentation] Kill all the karaf processes in the cluster
+ Kill One Or More Controllers @{controllers}
Clean All Journals
- CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
+ [Documentation] Clean the journals of all the controllers in the cluster
+ Clean One Or More Journals @{controllers}
*** Settings ***
Documentation Start the controllers
-Library Collections
-Library ../../../libraries/RequestsLibrary.py
-Library ../../../libraries/Common.py
-Library ../../../libraries/CrudLibrary.py
-Library ../../../libraries/SettingsLibrary.py
-Library ../../../libraries/UtilLibrary.py
-Variables ../../../variables/Variables.py
+Default Tags 3-node-cluster
+Resource ../../../libraries/Utils.txt
*** Variables ***
-${REST_CONTEXT} /restconf/config/
+@{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
*** Test Cases ***
Stop All Controllers
[Documentation] Stop all the controllers in the cluster
- Stopcontroller ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Stopcontroller ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Stopcontroller ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Sleep 30
- KillController ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- KillController ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- KillController ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
+ Stop One Or More Controllers @{controllers}
Clean All Journals
[Documentation] Clean the journals of all the controllers in the cluster
- CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- CleanJournal ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Sleep 5
+ Clean One Or More Journals @{controllers}
Start All Controllers
[Documentation] Start all the controllers in the cluster
- Startcontroller ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Startcontroller ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Startcontroller ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
- Sleep 120
+ Start One Or More Controllers @{controllers}
*** Settings ***
Documentation Test suite for Routed RPC.
Library Collections
-Library ../../../libraries/RequestsLibrary.py
+Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/CrudLibrary.py
Library ../../../libraries/SettingsLibrary.py
Variables ../../../variables/Variables.py
*** Variables ***
-${REST_CONTEXT} /restconf/config/
+@{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
*** Test Cases ***
Add cars and get cars from Leader
[Documentation] Add 100 cars and get added cars from Leader
- ${resp} InitCar ${MEMBER1} ${PORT}
- ${resp} AddCar ${MEMBER1} ${PORT} ${100}
- ${resp} Getcars ${MEMBER1} ${PORT} ${0}
+ ${resp} InitCar ${CONTROLLER} ${PORT}
+ ${resp} AddCar ${CONTROLLER} ${PORT} ${100}
+ ${resp} Getcars ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} manufacturer1
+ Should Contain ${resp.content} manufacturer1 cars not added!
Add persons and get persons from Leader
[Documentation] Add 100 persons and get persons Note: There should be one person added first to enable rpc
- ${resp} AddPerson ${MEMBER1} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER1} ${PORT} ${100}
- ${resp} GetPersons ${MEMBER1} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER} ${PORT} ${100}
+ ${resp} GetPersons ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user5
- SLEEP 10
+ Should Contain ${resp.content} user5 people not added!
Add car-person mapping and get car-person mapping from Follower1
[Documentation] Add car-person and get car-person from Leader Note: This is done to enable working of rpc
- ${resp} AddCarPerson ${MEMBER2} ${PORT} ${0}
- ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
+ ${resp} AddCarPerson ${CONTROLLER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user0
- SLEEP 5
+ Should Contain ${resp.content} user0 car-person not initialized!
Purchase 100 cars using Follower1
[Documentation] Purchase 100 cars using Follower1
- ${resp} BuyCar ${MEMBER2} ${PORT} ${100}
- ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
+ ${resp} BuyCar ${CONTROLLER1} ${PORT} ${100}
+ ${resp} GetCarPersonMappings ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Get Cars from Leader
[Documentation] Get 100 using Leader
- ${resp} Getcars ${MEMBER1} ${PORT} ${0}
+ ${resp} Getcars ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} manufacturer99
Get persons from Leader
[Documentation] Get 101 Persons from Leader
- ${resp} GetPersons ${MEMBER1} ${PORT} ${0}
+ ${resp} GetPersons ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} user100
Get car-person mappings using Leader
[Documentation] Get 101 car-person mappings using Leader to see 100 entry
- ${resp} GetCarPersonMappings ${MEMBER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} user100
*** Settings ***
Documentation Test suite for Routed RPC.
+Resource ../../../libraries/Utils.txt
Library Collections
-Library ../../../libraries/RequestsLibrary.py
+Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/CrudLibrary.py
Library ../../../libraries/SettingsLibrary.py
Library ../../../libraries/ClusterStateLibrary.py
Variables ../../../variables/Variables.py
-*** Variables ***
-${REST_CONTEXT} /restconf/config/
-
*** Test Cases ***
Add cars and get cars from Leader
[Documentation] Add 100 cars and get added cars from Leader
- ${resp} InitCar ${MEMBER1} ${PORT}
- ${resp} AddCar ${MEMBER1} ${PORT} ${100}
- ${resp} Getcars ${MEMBER1} ${PORT} ${0}
+ ${resp} InitCar ${CONTROLLER} ${PORT}
+ ${resp} AddCar ${CONTROLLER} ${PORT} ${100}
+ ${resp} Getcars ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} manufacturer1
Add persons and get persons from Leader
[Documentation] Add 100 persons and get persons Note: There should be one person added first to enable rpc
- ${resp} AddPerson ${MEMBER1} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER1} ${PORT} ${100}
- ${resp} GetPersons ${MEMBER1} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER} ${PORT} ${100}
+ ${resp} GetPersons ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} user5
Add car-person mapping and get car-person mapping from Follower1
[Documentation] Add car-person and get car-person from Follower1 Note: This is done to enable working of rpc
- ${resp} AddCarPerson ${MEMBER2} ${PORT} ${0}
- ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
+ ${resp} AddCarPerson ${CONTROLLER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} user0
Purchase 100 cars using Follower
[Documentation] Purchase 100 cars using Follower
- SLEEP 10
- ${resp} BuyCar ${MEMBER2} ${PORT} ${100}
- ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
+ ${resp} BuyCar ${CONTROLLER1} ${PORT} ${100}
+ ${resp} GetCarPersonMappings ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Get Cars from Leader
[Documentation] Get 100 using Leader
- ${resp} Getcars ${MEMBER1} ${PORT} ${0}
+ ${resp} Getcars ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} manufacturer9
+ Should Contain ${resp.content} manufacturer9 cars not returned!
Get persons from Leader
[Documentation] Get 11 Persons from Leader
- ${resp} GetPersons ${MEMBER1} ${PORT} ${0}
+ ${resp} GetPersons ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user100
+ Should Contain ${resp.content} user100 people not returned!
Get car-person mappings using Leader
[Documentation] Get car-person mappings using Leader to see 100 entry
- ${resp} GetCarPersonMappings ${MEMBER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${CONTROLLER} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user100
+ Should Contain ${resp.content} user100 car-people not returned!
Stop Leader
[Documentation] Stop Leader controller
- ${resp} Stopcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME}
- SLEEP 30
- ${resp} Killcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME}
+ Stop One Or More Controllers ${CONTROLLER}
+ Kill One Or More Controllers ${CONTROLLER}
Add cars and get cars from Follower1
[Documentation] Add 100 cars and get added cars from Follower
- ${resp InitCar ${MEMBER2} ${PORT}
- ${resp} AddCar ${MEMBER2} ${PORT} ${100}
- ${resp} Getcars ${MEMBER2} ${PORT} ${0}
+ ${resp} InitCar ${CONTROLLER1} ${PORT}
+ ${resp} AddCar ${CONTROLLER1} ${PORT} ${100}
+ ${resp} Getcars ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} manufacturer1
+ Should Contain ${resp.content} manufacturer1 cars not added!
Add persons and get persons from Follower1
[Documentation] Add 100 persons and get persons Note: There should be one person added first to enable rpc
- ${resp} AddPerson ${MEMBER2} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER2} ${PORT} ${100}
- ${resp} GetPersons ${MEMBER2} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER1} ${PORT} ${0}
+ ${resp} AddPerson ${CONTROLLER1} ${PORT} ${100}
+ ${resp} GetPersons ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user5
- SLEEP 10
+ Should Contain ${resp.content} user5 car-people not initialized!
Purchase 100 cars using Follower2
[Documentation] Purchase 100 cars using Follower2
- ${resp} BuyCar ${MEMBER3} ${PORT} ${100}
- SLEEP 10
- ${resp} GetCarPersonMappings ${MEMBER3} ${PORT} ${0}
+ ${resp} BuyCar ${CONTROLLER2} ${PORT} ${100}
+ ${resp} GetCarPersonMappings ${CONTROLLER2} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
Get Cars from Follower1
[Documentation] Get 100 using Follower1
- ${resp} Getcars ${MEMBER2} ${PORT} ${0}
+ ${resp} Getcars ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} manufacturer9
+ Should Contain ${resp.content} manufacturer9 cars not returned!
Get persons from Follower1
[Documentation] Get 11 Persons from Follower1
- ${resp} GetPersons ${MEMBER2} ${PORT} ${0}
+ ${resp} GetPersons ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user100
+ Should Contain ${resp.content} user100 people not returned!
Get car-person mappings using Follower1
[Documentation] Get car-person mappings using Follower1 to see 100 entry
- ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${CONTROLLER1} ${PORT} ${0}
Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} user100
+ Should Contain ${resp.content} user100 car-people not returned!
Start Leader
[Documentation] Start Leader controller
- ${resp} Startcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME}
- SLEEP 20
+ Start One Or More Controllers ${CONTROLLER}
CONTAINER = 'default'
USER = 'admin'
PWD = 'admin'
+PASSWORD = 'EMPTY'
AUTH = [u'admin', u'admin']
SCOPE = 'sdn'
HEADERS = {'Content-Type': 'application/json'}
TOPO_TREE_LEVEL = 2
TOPO_TREE_DEPTH = 3
TOPO_TREE_FANOUT = 2
+CONTROLLERS = ['CONTROLLER', 'CONTROLLER1', 'CONTROLLER2']
# KARAF Varaiable
KARAF_SHELL_PORT = '8101'
KARAF_PROMPT = 'opendaylight-user'
KARAF_USER = 'karaf'
KARAF_PASSWORD = 'karaf'
+KARAF_HOME = '/tmp/${BUNDLEFOLDER}'
# VM Environment Variables
LINUX_PROMPT = '>'
'network-topology/topology'
'/topology-netconf/node/'
'controller-config/yang-ext:mount')
+CONFIG_API = '/restconf/config/'
# TOKEN
AUTH_TOKEN_API = '/oauth2/token'