Update clustering tests for Continuous Integration
authorPhillip Shea <phillip.shea@hp.com>
Mon, 22 Jun 2015 22:38:55 +0000 (15:38 -0700)
committerPhillip Shea <phillip.shea@hp.com>
Thu, 9 Jul 2015 06:20:14 +0000 (23:20 -0700)
Moved clustering tests to controller directory.

Replaced ${PORT} with ${RESTCONFPORT} in call to Wait For Controller Up.

This commit is a re-try of the following commit:
https://git.opendaylight.org/gerrit/#/c/23001/

It adds KEYFILE_PASS to variables.py
and then puts KEYFILE_PASS into
Run Command On Remote System.

It also contains the following from the
previous commit attempt:
    Change global variables to match those used in CI
    All ssh sign-ins now use certificates rather than passwords
    Remove Sleeps where possible.
    Move repeated variables into variables.py.
    Move repeated keywords into libraries.

Change-Id: Iacb328c89abe35d8c57eac4b4d081ff219b2e8b5
Signed-off-by: Phillip Shea <phillip.shea@hp.com>
21 files changed:
test/csit/libraries/ClusterKeywords.txt
test/csit/libraries/Utils.txt
test/csit/suites/clustering/datastore/001_start_cluster.robot [deleted file]
test/csit/suites/clustering/datastore/999_cleanup.robot [deleted file]
test/csit/suites/clustering/routedrpc/001_start_cluster.robot [deleted file]
test/csit/suites/controller/Clustering_Datastore/001_start_cluster.robot [new file with mode: 0644]
test/csit/suites/controller/Clustering_Datastore/010_crud_on_leader.robot [moved from test/csit/suites/clustering/datastore/010_crud_on_leader.robot with 93% similarity]
test/csit/suites/controller/Clustering_Datastore/020_crud_on_any_follower.robot [moved from test/csit/suites/clustering/datastore/020_crud_on_any_follower.robot with 95% similarity]
test/csit/suites/controller/Clustering_Datastore/030_car_failover_crud_on_new_leader.robot [moved from test/csit/suites/clustering/datastore/030_car_failover_crud_on_new_leader.robot with 91% similarity]
test/csit/suites/controller/Clustering_Datastore/040_people_failover_crud_on_new_leader.robot [moved from test/csit/suites/clustering/datastore/040_people_failover_crud_on_new_leader.robot with 91% similarity]
test/csit/suites/controller/Clustering_Datastore/050_car_persistence_recovery.robot [moved from test/csit/suites/clustering/datastore/050_car_persistence_recovery.robot with 68% similarity]
test/csit/suites/controller/Clustering_Datastore/140_recovery_restart_follower.robot [moved from test/csit/suites/clustering/datastore/140_recovery_restart_follower.robot with 53% similarity]
test/csit/suites/controller/Clustering_Datastore/999_cleanup.robot [new file with mode: 0644]
test/csit/suites/controller/Clustering_Datastore/__init__.robot [moved from test/csit/suites/clustering/datastore/__init__.robot with 100% similarity]
test/csit/suites/controller/Clustering_Longevity/010__longevity.robot [moved from test/csit/suites/clustering/longevity/010__longevity.robot with 100% similarity]
test/csit/suites/controller/Clustering_Longevity/__init__.robot [moved from test/csit/suites/clustering/longevity/__init__.robot with 100% similarity]
test/csit/suites/controller/Clustering_Routedrpc/001_start_cluster.robot [new file with mode: 0644]
test/csit/suites/controller/Clustering_Routedrpc/023_routed_rpc_crud_test.robot [moved from test/csit/suites/clustering/routedrpc/023_routed_rpc_crud_test.robot with 60% similarity]
test/csit/suites/controller/Clustering_Routedrpc/024_routed_rpc_crud_test.robot [moved from test/csit/suites/clustering/routedrpc/024_routed_rpc_crud_test.robot with 55% similarity]
test/csit/testplans/controller-clustering.txt
test/csit/variables/Variables.py

index e000d8e31598e8ff3b5903f52c0f5c9913583ea1..fab6d72f79ee7f0334ea704d997b03aa47ff15b8 100644 (file)
@@ -1,46 +1,64 @@
 *** 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}
+    [Documentation]  Returns the IP addr or hostname of the leader of the specified shard.
+    [Documentation]  Controllers are specifed in the pybot command line.
+    ${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}
 
-Wait For Leader
+Wait For Leader To Be Found
     [Arguments]   ${shard_name}
+    [Documentation]  Waits until the leader of the specified shard is found.
     ${leader}   Wait Until Keyword Succeeds   60s  2s  Get Leader And Verify  ${shard_name}
     Log   ${leader}
     [Return]   ${leader}
 
 Switch Leader
     [Arguments]   ${shard_name}  ${current_leader}
-    StopController  ${current_leader}  ${USERNAME}  ${PASSWORD}  ${KARAFHOME}
+    [Documentation]  Forces a change of leadership by shutting down the current leader.
+    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}
+    [Documentation]  Returns the IP addresses or hostnames of all followers of the specified shard.
+    ${followers}  GetFollowers  ${shard_name}  ${3}  ${3}  ${1}  ${PORT}  ${CONTROLLER}  ${CONTROLLER1}  ${CONTROLLER2}
     Log  ${followers}
     Should Not Be Empty  ${followers}
     [Return]  ${followers}
 
 Add Cars And Verify
+    [Documentation]  Initializes shard and then adds the specified number of cars and performs a GET as a check.
     [Arguments]    ${controller_ip}    ${num_cars}  ${timeout}=60s
     ${resp}   InitCar   ${controller_ip}   ${PORT}
     Should Be Equal As Strings    ${resp.status_code}    204
-    ${resp}   AddCar   ${controller_ip}   ${PORT}   ${num_cars}
+    ${resp}   AddCar   ${controller_ip}   ${RESTCONFPORT}   ${num_cars}
     Should Be Equal As Strings    ${resp.status_code}    204
     Wait Until Keyword Succeeds   ${timeout}  2s  Get Cars And Verify   ${controller_ip}  ${num_cars}
 
+Add Cars And Verify Without Init
+    [Documentation]  Adds cars to an initialized cars shard then performs a GET as a check.
+    [Arguments]    ${controller_ip}    ${num_cars}  ${timeout}=60s
+    ${resp}   AddCar   ${controller_ip}   ${RESTCONFPORT}   ${num_cars}
+    Should Be Equal As Strings    ${resp.status_code}    204
+    Wait Until Keyword Succeeds   ${timeout}  2s  Get Cars And Verify   ${controller_ip}  ${num_cars}
+
+
 Get Cars And Verify
     [Arguments]    ${controller_ip}    ${num_cars}
-    ${resp}     Getcars  ${controller_ip}   ${PORT}  ${0}
+    [Documentation]  Gets cars and verifies that the manufacturer is correct.
+    # TODO: Future enhanement: verify all fields.
+    ${resp}     Getcars  ${controller_ip}   ${RESTCONFPORT}  ${0}
     Should Be Equal As Strings    ${resp.status_code}    200
     :FOR    ${i}    IN RANGE    1    ${num_cars}+1
     \    Should Contain     ${resp.content}   manufacturer${i}
@@ -50,21 +68,25 @@ Add People And Verify
     [Documentation]  Note: The first AddPerson call passed with 0 posts directly to the data store to get
     [Documentation]  the people container created so the subsequent AddPerson RPC calls that put 
     [Documentation]  to the person list will succeed.
-    ${resp}  AddPerson  ${controller_ip}  ${PORT}  ${0}
+    ${resp}  AddPerson  ${controller_ip}  ${RESTCONFPORT}  ${0}
     Should Be Equal As Strings  ${resp.status_code}  204
     Wait Until Keyword Succeeds   60s  2s  Get One Person And Verify  ${controller_ip}  ${0}
-    ${resp}  AddPerson   ${controller_ip}    ${PORT}  ${num_people}
+    ${resp}  AddPerson   ${controller_ip}    ${RESTCONFPORT}  ${num_people}
     Wait Until Keyword Succeeds   60s  2s  Get People And Verify  ${controller_ip}  ${num_people}
 
 Get One Person And Verify
     [Arguments]    ${controller_ip}    ${number}
-    ${resp}     GetPersons  ${controller_ip}    ${PORT}  ${0}
+    [Documentation]  Gets a person and verifies that the user ID is correct.
+    # TODO: Future enhanement: verify all fields.
+    ${resp}     GetPersons  ${controller_ip}    ${RESTCONFPORT}  ${0}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain   ${resp.content}   user${number}
 
 Get People And Verify
     [Arguments]    ${controller_ip}    ${num_people}
-    ${resp}     GetPersons  ${controller_ip}    ${PORT}  ${0}
+    [Documentation]  Gets multiple people and verifies that the user IDs are correct.
+    # TODO: Future enhanement: verify all fields.
+    ${resp}     GetPersons  ${controller_ip}    ${RESTCONFPORT}  ${0}
     Should Be Equal As Strings    ${resp.status_code}    200
     :FOR    ${i}    IN RANGE    1    ${num_people}+1
     \    Should Contain     ${resp.content}   user${i}
@@ -74,52 +96,53 @@ Add Car Person And Verify
     [Documentation]  Add a car-person via the data store and get the car-person from Leader.
     [Documentation]  Note: This is done to get the car-people container created so subsequent BuyCar
     [Documentation]  RPC puts to the car-person list will succeed.
-    AddCarPerson    ${controller_ip}   ${PORT}     ${0}
+    AddCarPerson    ${controller_ip}   ${RESTCONFPORT}     ${0}
     Wait Until Keyword Succeeds   60s  2s  Get One Car-Person Mapping And Verify  ${controller_ip}   ${0}
 
 Get One Car-Person Mapping And Verify
     [Arguments]    ${controller_ip}    ${number}
-    ${resp}     GetCarPersonMappings    ${controller_ip}   ${PORT}     ${0}
+    [Documentation]  Gets a car person mapping and verifies that the user ID is correct.
+    ${resp}     GetCarPersonMappings    ${controller_ip}   ${RESTCONFPORT}     ${0}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain     ${resp.content}   user${number}
 
 Get Car-Person Mappings And Verify
     [Arguments]    ${controller_ip}    ${num_entries}
-    ${resp}     GetCarPersonMappings    ${controller_ip}    ${PORT}  ${0}
+    ${resp}     GetCarPersonMappings    ${controller_ip}    ${RESTCONFPORT}  ${0}
     Should Be Equal As Strings    ${resp.status_code}    200
     :FOR    ${i}    IN RANGE    1    ${num_entries}+1
     \    Should Contain     ${resp.content}   user${i}
 
 Buy Cars And Verify
     [Arguments]    ${controller_ip}    ${num_entries}   ${start}=${0}
-    Wait Until Keyword Succeeds   60s  2s  BuyCar  ${controller_ip}   ${PORT}    ${num_entries}   ${start}
+    Wait Until Keyword Succeeds   60s  2s  BuyCar  ${controller_ip}   ${RESTCONFPORT}    ${num_entries}   ${start}
 
 Check Cars Deleted
     [Arguments]    ${controller_ip}
-    ${resp}    Getcars    ${controller_ip}    ${PORT}    ${0}
+    ${resp}    Getcars    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete All Cars And Verify
     [Arguments]    ${controller_ip}
-    DeleteAllCars    ${controller_ip}    ${PORT}    ${0}
+    DeleteAllCars    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Wait Until Keyword Succeeds   60s  2s  Check Cars Deleted  ${controller_ip}
 
 Check People Deleted
     [Arguments]    ${controller_ip}
-    ${resp}    GetPersons    ${controller_ip}    ${PORT}    ${0}
+    ${resp}    GetPersons    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete All People And Verify
     [Arguments]    ${controller_ip}
-    DeleteAllPersons    ${controller_ip}    ${PORT}    ${0}
+    DeleteAllPersons    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Wait Until Keyword Succeeds   60s  2s  Check People Deleted  ${controller_ip}
 
 Check Cars-Persons Deleted
     [Arguments]    ${controller_ip}
-    ${resp}    GetCarPersonMappings    ${controller_ip}    ${PORT}    ${0}
+    ${resp}    GetCarPersonMappings    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete All Cars-Persons And Verify
     [Arguments]    ${controller_ip}
-    DeleteAllCarsPersons    ${controller_ip}    ${PORT}    ${0}
+    DeleteAllCarsPersons    ${controller_ip}    ${RESTCONFPORT}    ${0}
     Wait Until Keyword Succeeds   60s  2s  Check Cars-Persons Deleted  ${controller_ip}
index 05950ea677ea48e515aca30b0bd9a0634a6ad743..5dff1f309df0efeb1b17aca82a56dd9e83cc05e0 100644 (file)
@@ -113,10 +113,10 @@ Extract Value From Content
     [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
@@ -124,8 +124,8 @@ Get Process ID Based On Regex On Remote System
     [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
@@ -142,9 +142,9 @@ Run Command On Remote System
     [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    ${prompt}
     SSHLibrary.Close Connection
@@ -215,3 +215,72 @@ Post Elements To URI From File
     ${body}    OperatingSystem.Get File    ${data_file}
     ${resp}    RequestsLibrary.Post    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}
+    : FOR    ${ip}    IN    @{controllers}
+    \    Wait Until Keyword Succeeds    60 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}
+    # TODO: This should throw an error if controller never comes up.
+    : FOR    ${ip}    IN    @{controllers}
+    \    UtilLibrary.Wait For Controller Up    ${ip}    ${RESTCONFPORT}
+
+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
+    log     ${cmd}
+    ${controller_pid}=    Get Process ID Based On Regex On Remote System    ${CONTROLLER}    karaf
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    : FOR    ${ip}    IN    @{controllers}
+    \    Wait Until Keyword Succeeds    60 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}
+    Log    Number of controller instances running: ${response}
+    Should Start With    ${response}    0    Controller process found or 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}
+
+Show Cluster Configuation Files
+    [Arguments]    @{controllers}
+    [Documentation]    Prints out the cluster configuration files for one or more controllers.
+    Log    controllers: @{controllers}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/akka.conf
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/modules.conf
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/module-shards.conf
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/jolokia.xml
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/etc/initial/org.apache.karaf.management.cfg
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
+    ${cmd} =    Set Variable    cat ${KARAF_HOME}/etc/org.apache.karaf.features.cfg
+    : FOR    ${ip}    IN    @{controllers}
+    \    Run Command On Remote System    ${ip}    ${cmd}
diff --git a/test/csit/suites/clustering/datastore/001_start_cluster.robot b/test/csit/suites/clustering/datastore/001_start_cluster.robot
deleted file mode 100644 (file)
index 2d0f152..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-*** 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
-
-*** Variables ***
-${REST_CONTEXT}    /restconf/config/
-
-*** Test Cases ***
-Stop All Controllers
-    [Documentation]    Stop all the controllers in the cluster
-    StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
-
-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
-
-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}
diff --git a/test/csit/suites/clustering/datastore/999_cleanup.robot b/test/csit/suites/clustering/datastore/999_cleanup.robot
deleted file mode 100644 (file)
index ec7496f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-*** Settings ***
-Documentation     Test cleanup
-Default Tags      3-node-cluster
-Library           ../../../libraries/UtilLibrary.py
-Variables         ../../../variables/Variables.py
-
-*** 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}
-
-Clean All Journals
-    CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
-    CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
-    CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
diff --git a/test/csit/suites/clustering/routedrpc/001_start_cluster.robot b/test/csit/suites/clustering/routedrpc/001_start_cluster.robot
deleted file mode 100644 (file)
index e331503..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-*** 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
-
-*** Variables ***
-${REST_CONTEXT}    /restconf/config/
-
-*** 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}
-
-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
-
-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
diff --git a/test/csit/suites/controller/Clustering_Datastore/001_start_cluster.robot b/test/csit/suites/controller/Clustering_Datastore/001_start_cluster.robot
new file mode 100644 (file)
index 0000000..ca3c618
--- /dev/null
@@ -0,0 +1,21 @@
+*** Settings ***
+Documentation     Start the controllers
+Default Tags      3-node-cluster
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+@{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
+
+*** Test Cases ***
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster.
+    Stop One Or More Controllers    @{controllers}
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    Clean One Or More Journals    @{controllers}
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Start One Or More Controllers    @{controllers}
similarity index 93%
rename from test/csit/suites/clustering/datastore/010_crud_on_leader.robot
rename to test/csit/suites/controller/Clustering_Datastore/010_crud_on_leader.robot
index 34fa8fdca9511b905c0d1742ec3b9e756041f5b8..398e5723ba5b2562b5a7eda90af130ee61b04a92 100644 (file)
@@ -2,7 +2,7 @@
 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
@@ -12,7 +12,6 @@ Resource          ../../../libraries/ClusterKeywords.txt
 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
@@ -20,7 +19,7 @@ ${NUM_ENTRIES}    ${30}
 
 *** Test Cases ***
 Get Car Leader And Followers
-    ${CURRENT_CAR_LEADER}    Wait For Leader    ${SHARD_CAR_NAME}
+    ${CURRENT_CAR_LEADER}    Wait For Leader To Be Found    ${SHARD_CAR_NAME}
     Set Suite Variable    ${CURRENT_CAR_LEADER}
     ${CAR_FOLLOWERS}    Get All Followers    ${SHARD_CAR_NAME}
     Set Suite Variable    ${CAR_FOLLOWERS}
@@ -38,7 +37,7 @@ Get added cars from Follower2
     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[1]    ${NUM_ENTRIES}
 
 Get People Leader And Followers
-    ${CURRENT_PEOPLE_LEADER}    Wait For Leader    ${SHARD_PEOPLE_NAME}
+    ${CURRENT_PEOPLE_LEADER}    Wait For Leader To Be Found    ${SHARD_PEOPLE_NAME}
     Set Suite Variable    ${CURRENT_PEOPLE_LEADER}
     ${PEOPLE_FOLLOWERS}    Get All Followers    ${SHARD_PEOPLE_NAME}
     Set Suite Variable    ${PEOPLE_FOLLOWERS}
@@ -56,7 +55,7 @@ Get added people from Follower2
     Wait Until Keyword Succeeds    60s    2s    Get People And Verify    @{PEOPLE_FOLLOWERS}[1]    ${NUM_ENTRIES}
 
 Get Car-Person Leader And Followers
-    ${CURRENT_CAR_PERSON_LEADER}    Wait For Leader    ${SHARD_CAR_PERSON_NAME}
+    ${CURRENT_CAR_PERSON_LEADER}    Wait For Leader To Be Found    ${SHARD_CAR_PERSON_NAME}
     Set Suite Variable    ${CURRENT_CAR_PERSON_LEADER}
     ${CAR_PERSON_FOLLOWERS}    Get All Followers    ${SHARD_CAR_PERSON_NAME}
     Set Suite Variable    ${CAR_PERSON_FOLLOWERS}
similarity index 95%
rename from test/csit/suites/clustering/datastore/020_crud_on_any_follower.robot
rename to test/csit/suites/controller/Clustering_Datastore/020_crud_on_any_follower.robot
index e71dfcd36c0157261a2271269f3fc16ab9306429..e2ccc456a5ad1d1729a0681521ac722364a8d6d8 100644 (file)
@@ -2,7 +2,6 @@
 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
@@ -12,7 +11,6 @@ Resource          ../../../libraries/ClusterKeywords.txt
 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
@@ -69,7 +67,7 @@ Get car-person mappings from Follower1
 
 Get car-person mappings from Leader
     [Documentation]    Get car-person mappings from the Leader to see all entries
-    ${CURRENT_CAR_LEADER}    Wait For Leader    ${SHARD_CAR_PERSON_NAME}
+    ${CURRENT_CAR_LEADER}    Wait For Leader To Be Found    ${SHARD_CAR_PERSON_NAME}
     Wait Until Keyword Succeeds    60s    2s    Get Car-Person Mappings And Verify    ${CURRENT_CAR_LEADER}    ${NUM_ENTRIES}
 
 Get car-person mappings from Follower2
similarity index 91%
rename from test/csit/suites/clustering/datastore/030_car_failover_crud_on_new_leader.robot
rename to test/csit/suites/controller/Clustering_Datastore/030_car_failover_crud_on_new_leader.robot
index 98aff4efc681a36ae5690583b09dd0766d43d9dd..a1cff0ba2f1ef2f5fdc331ec64321b927a99abc7 100644 (file)
@@ -5,15 +5,17 @@ Library           ../../../libraries/CrudLibrary.py
 Library           ../../../libraries/UtilLibrary.py
 Library           ../../../libraries/ClusterStateLibrary.py
 Resource          ../../../libraries/ClusterKeywords.txt
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${CAR_SHARD}      shard-car-config
 ${NUM_CARS}       ${50}
 ${NUM_ORIG_CARS}    ${10}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
 
 *** Test Cases ***
 Get old car leader
-    ${OLD_CAR_LEADER}    Wait For Leader    ${CAR_SHARD}
+    ${OLD_CAR_LEADER}    Wait For Leader To Be Found    ${CAR_SHARD}
     Set Suite Variable    ${OLD_CAR_LEADER}
 
 Delete cars on old leader
@@ -57,7 +59,7 @@ Get added cars from new leader
     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
similarity index 91%
rename from test/csit/suites/clustering/datastore/040_people_failover_crud_on_new_leader.robot
rename to test/csit/suites/controller/Clustering_Datastore/040_people_failover_crud_on_new_leader.robot
index c75128d60d3c25f2cb321adceb335bf87c659d8e..e08a3866775c105e961a8d7bc84baddca70fc3dc 100644 (file)
@@ -9,11 +9,12 @@ Resource          ../../../libraries/ClusterKeywords.txt
 *** Variables ***
 ${PEOPLE_SHARD}    shard-people-config
 ${NUM_ENTRIES}    ${50}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
 
 *** Test Cases ***
 Switch People Leader
     [Documentation]    Stop the leader to cause a new leader to be elected
-    ${OLD_PEOPLE_LEADER}    Wait For Leader    ${PEOPLE_SHARD}
+    ${OLD_PEOPLE_LEADER}    Wait For Leader To Be Found    ${PEOPLE_SHARD}
     ${NEW_PEOPLE_LEADER}    Switch Leader    ${PEOPLE_SHARD}    ${OLD_PEOPLE_LEADER}
     Set Suite Variable    ${OLD_PEOPLE_LEADER}
     Set Suite Variable    ${NEW_PEOPLE_LEADER}
@@ -43,7 +44,7 @@ Get added people from new 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}
similarity index 68%
rename from test/csit/suites/clustering/datastore/050_car_persistence_recovery.robot
rename to test/csit/suites/controller/Clustering_Datastore/050_car_persistence_recovery.robot
index 3d8a40c3aa608d5f7fcc051425e59e84631a492e..1aebf87a2f80779db8b970ebed8f0486e2c82adc 100644 (file)
@@ -10,37 +10,35 @@ Variables         ../../../variables/Variables.py
 *** Variables ***
 ${CAR_SHARD}      shard-car-config
 ${NUM_CARS}       ${50}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
+@{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
 
 *** Test Cases ***
 Get car leader
-    ${CAR_LEADER}    Wait For Leader    ${CAR_SHARD}
+    ${CAR_LEADER}    Wait For Leader To Be Found    ${CAR_SHARD}
     Set Suite Variable    ${CAR_LEADER}
 
 Delete cars from leader
     Delete All Cars And Verify    ${CAR_LEADER}
 
 Stop all controllers after delete
-    StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
+    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}
+    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}
+    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}
+    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}
similarity index 53%
rename from test/csit/suites/clustering/datastore/140_recovery_restart_follower.robot
rename to test/csit/suites/controller/Clustering_Datastore/140_recovery_restart_follower.robot
index 3ae9680a857734573f74b9f6f6774f50a967e806..b717abdd8de25bd3c9c5bebd25c87c47bae4f2ee 100644 (file)
@@ -12,59 +12,56 @@ Resource          ../../../libraries/ClusterKeywords.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/config/
 ${CAR_SHARD}      shard-car-config
 ${NUM_CARS}       ${60}
+@{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
 
 *** 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}
+    ${CURRENT_CAR_LEADER}    Wait For Leader To Be Found    ${CAR_SHARD}
     Set Suite Variable    ${CURRENT_CAR_LEADER}
     ${CAR_FOLLOWERS}    Get All Followers    ${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
+    Log    Adding ${NUM_CARS} cars to @{CAR_FOLLOWERS}[0]
+    Add Cars And Verify Without Init    @{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
diff --git a/test/csit/suites/controller/Clustering_Datastore/999_cleanup.robot b/test/csit/suites/controller/Clustering_Datastore/999_cleanup.robot
new file mode 100644 (file)
index 0000000..9fb9d4b
--- /dev/null
@@ -0,0 +1,19 @@
+*** 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}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
+
+*** Test Cases ***
+Kill All Controllers
+    [Documentation]    Kill all the karaf processes in the cluster
+    Kill One Or More Controllers    @{controllers}
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    Clean One Or More Journals    @{controllers}
diff --git a/test/csit/suites/controller/Clustering_Routedrpc/001_start_cluster.robot b/test/csit/suites/controller/Clustering_Routedrpc/001_start_cluster.robot
new file mode 100644 (file)
index 0000000..fbb9c55
--- /dev/null
@@ -0,0 +1,21 @@
+*** Settings ***
+Documentation     Start the controllers
+Default Tags      3-node-cluster
+Resource          ../../../libraries/Utils.txt
+
+*** Variables ***
+@{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
+${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
+
+*** Test Cases ***
+Stop All Controllers
+    [Documentation]    Stop all the controllers in the cluster
+    Stop One Or More Controllers    @{controllers}
+
+Clean All Journals
+    [Documentation]    Clean the journals of all the controllers in the cluster
+    Clean One Or More Journals    @{controllers}
+
+Start All Controllers
+    [Documentation]    Start all the controllers in the cluster
+    Start One Or More Controllers    @{controllers}
similarity index 60%
rename from test/csit/suites/clustering/routedrpc/023_routed_rpc_crud_test.robot
rename to test/csit/suites/controller/Clustering_Routedrpc/023_routed_rpc_crud_test.robot
index bfa3d8e4f121d20994a6ef633e5822f8baab43db..c7eb7815bb84793ebb5fd3a0bfcb705d1d196e38 100644 (file)
@@ -1,7 +1,7 @@
 *** 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
@@ -9,54 +9,52 @@ Library           ../../../libraries/UtilLibrary.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
similarity index 55%
rename from test/csit/suites/clustering/routedrpc/024_routed_rpc_crud_test.robot
rename to test/csit/suites/controller/Clustering_Routedrpc/024_routed_rpc_crud_test.robot
index b4344cdf242fe3d4a45948f28dcbe524b8f8c97e..88477c14b5729a9356392c77eb46f5edf774a9ed 100644 (file)
@@ -1,7 +1,8 @@
 *** 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
@@ -9,107 +10,99 @@ Library           ../../../libraries/UtilLibrary.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}
index 43e857c2075ca43e40d6e4d6b5f51944396879ad..1af805b0e7892a96af45a27e10ddceffc396adfc 100644 (file)
@@ -1,3 +1,3 @@
 # Place the suites in run order:
-integration/test/csit/suites/clustering/datastore
+integration/test/csit/suites/controller/Clustering_Datastore
 
index adeb71bdf04a2bb6d34b8505859177d842d93f85..6bfb25b299bd32b2aa1229f7de94de7b622a20e2 100644 (file)
@@ -14,6 +14,7 @@ PROMPT = '>'
 CONTAINER = 'default'
 USER = 'admin'
 PWD = 'admin'
+PASSWORD = 'EMPTY'
 AUTH = [u'admin', u'admin']
 SCOPE = 'sdn'
 HEADERS = {'Content-Type': 'application/json'}
@@ -23,8 +24,10 @@ ODL_CONTROLLER_SESSION = None
 TOPO_TREE_LEVEL = 2
 TOPO_TREE_DEPTH = 3
 TOPO_TREE_FANOUT = 2
+CONTROLLERS = ['CONTROLLER', 'CONTROLLER1', 'CONTROLLER2']
+KEYFILE_PASS = 'any'
 
-# KARAF Varaiable
+# KARAF Variaable
 KARAF_SHELL_PORT = '8101'
 KARAF_PROMPT = 'opendaylight-user'
 KARAF_USER = 'karaf'
@@ -78,6 +81,8 @@ CONTROLLER_CONFIG_MOUNT = ('/restconf/config/network-topology:'
                            'network-topology/topology'
                            '/topology-netconf/node/'
                            'controller-config/yang-ext:mount')
+CONFIG_API = '/restconf/config/'
+OPERATIONAL_API = '/restconf/operational/'
 
 # TOKEN
 AUTH_TOKEN_API = '/oauth2/token'