From: Luis Gomez Date: Sun, 30 Nov 2014 01:26:44 +0000 (+0000) Subject: Merge "adding missing example flows" X-Git-Tag: release/helium-sr1.1~10 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=ce9158350986225466ef352f7817602b8c991640;hp=e6134e450543b36eaa48a7515ac6617b723189fd;p=integration%2Ftest.git Merge "adding missing example flows" --- diff --git a/test/csit/suites/clustering/datastore/001_start_cluster.txt b/test/csit/suites/clustering/datastore/001_start_cluster.txt new file mode 100644 index 0000000000..da9264a2f4 --- /dev/null +++ b/test/csit/suites/clustering/datastore/001_start_cluster.txt @@ -0,0 +1,38 @@ +*** 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 \ No newline at end of file diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_01_execute_on_leader.txt b/test/csit/suites/clustering/datastore/010_crud_on_leader.txt similarity index 80% rename from test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_01_execute_on_leader.txt rename to test/csit/suites/clustering/datastore/010_crud_on_leader.txt index 3bf86cba99..f09db2f15f 100644 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_01_execute_on_leader.txt +++ b/test/csit/suites/clustering/datastore/010_crud_on_leader.txt @@ -1,14 +1,14 @@ *** Settings *** -Documentation Test suite for testing Distributed Datastore main operations performed from leader +Documentation This test finds the leader for shards in a 3-Node cluster and executes CRUD operations on them Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py -Variables ../../../../variables/Variables.py +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/SettingsLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py +Variables ../../../variables/Variables.py *** Variables *** @@ -21,7 +21,7 @@ ${SHARD_CAR_PERSON_NAME} shard-car-people-config *** Test Cases *** Add cars and get cars from Leader [Documentation] Add 100 cars and get added cars from Leader - ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log CURRENT_CAR_SHARD_LEADER ${CURRENT_CAR_LEADER} Set Suite Variable ${CURRENT_CAR_LEADER} ${resp} AddCar ${CURRENT_CAR_LEADER} ${PORT} ${100} @@ -32,7 +32,7 @@ Add cars and get cars from Leader Add persons and get persons from Leader [Documentation] Add 100 persons and get persons [Documentation] Note: There should be one person added first to enable rpc - ${CURRENT_PEOPLE_LEADER} GetLeader ${SHARD_PEOPLE_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${CURRENT_PEOPLE_LEADER} GetLeader ${SHARD_PEOPLE_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Set Suite Variable ${CURRENT_PEOPLE_LEADER} ${resp} AddPerson ${CURRENT_PEOPLE_LEADER} ${PORT} ${0} ${resp} AddPerson ${CURRENT_PEOPLE_LEADER} ${PORT} ${100} @@ -43,7 +43,7 @@ Add persons and get persons from Leader Add car-person mapping and get car-person mapping from Leader [Documentation] Add car-person and get car-person from Leader [Documentation] Note: This is done to enable working of rpc - ${CURRENT_CAR_PERSON_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${CURRENT_CAR_PERSON_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Set Suite Variable ${CURRENT_CAR_PERSON_LEADER} ${resp} AddCarPerson ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} Sleep 2 @@ -53,7 +53,6 @@ Add car-person mapping and get car-person mapping from Leader Purchase 100 cars using Leader [Documentation] Purchase 100 cars using Leader - ${resp} BuyCar ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${100} Sleep 2 ${resp} GetCarPersonMappings ${CURRENT_CAR_PERSON_LEADER} ${PORT} ${0} @@ -67,7 +66,7 @@ Get car-person mappings using Leader Get car-person mappings using Follower1 [Documentation] Get car-person mappings using Follower1 to see 100 entry - ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${FOLLOWERS} SET SUITE VARIABLE ${FOLLOWERS} ${resp} GetCarPersonMappings ${FOLLOWERS[0]} ${PORT} ${0} diff --git a/test/csit/suites/clustering/datastore/basic/020_restconf_rpc_crud_test_02_execute_on_follower1.txt b/test/csit/suites/clustering/datastore/020_crud_on_any_follower.txt similarity index 81% rename from test/csit/suites/clustering/datastore/basic/020_restconf_rpc_crud_test_02_execute_on_follower1.txt rename to test/csit/suites/clustering/datastore/020_crud_on_any_follower.txt index 8b54e98351..baaa24e44e 100644 --- a/test/csit/suites/clustering/datastore/basic/020_restconf_rpc_crud_test_02_execute_on_follower1.txt +++ b/test/csit/suites/clustering/datastore/020_crud_on_any_follower.txt @@ -1,14 +1,14 @@ *** Settings *** -Documentation Test suite for testing Distributed Datastore main operations performed from follower1 +Documentation This test finds the followers of certain shards in a 3-Node cluster and executes CRUD operations on any one follower Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py -Variables ../../../../variables/Variables.py +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/SettingsLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py +Variables ../../../variables/Variables.py *** Variables *** ${REST_CONTEXT} /restconf/config/ @@ -20,7 +20,7 @@ ${SHARD_CAR_PERSON_NAME} shard-car-people-config *** Test Cases *** Add cars and get cars from Follower1 [Documentation] Add 100 cars and get added cars from Follower1 - ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${FOLLOWERS} SET SUITE VARIABLE ${FOLLOWERS} @@ -66,7 +66,7 @@ Get car-person mappings using Follower1 Get car-person mappings using Leader [Documentation] Get car-person mappings using Leader to see 100 entry - ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${CURRENT_CAR_LEADER} Sleep 1 ${resp} GetCarPersonMappings ${CURRENT_CAR_LEADER} ${PORT} ${0} diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_05_execute_on_new_leader.txt b/test/csit/suites/clustering/datastore/030_failover_crud_on_new_leader.txt similarity index 86% rename from test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_05_execute_on_new_leader.txt rename to test/csit/suites/clustering/datastore/030_failover_crud_on_new_leader.txt index 08573e8420..e40888d365 100644 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_05_execute_on_new_leader.txt +++ b/test/csit/suites/clustering/datastore/030_failover_crud_on_new_leader.txt @@ -1,8 +1,8 @@ *** Settings *** -Documentation Run this test after running test no 03 -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py +Documentation This test brings down the current leader of the "car" shard and then executes CRUD operations on the new leader +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py *** Variables *** ${SHARD} shard-car-config @@ -10,10 +10,10 @@ ${SHARD} shard-car-config *** Test Cases *** Switch Leader [Documentation] stop leader and elect new leader - ${OLD_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${OLD_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Stopcontroller ${OLD_LEADER} ${USERNAME} ${PASSWORD} ${KARAFHOME} Sleep 30 - ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${NEW_LEADER} Set Suite Variable ${NEW_LEADER} diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_06_execute_on_remaining_follower.txt b/test/csit/suites/clustering/datastore/040_failover_read_from_follower.txt similarity index 80% rename from test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_06_execute_on_remaining_follower.txt rename to test/csit/suites/clustering/datastore/040_failover_read_from_follower.txt index 7b70f71357..9cfd3588d9 100644 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_06_execute_on_remaining_follower.txt +++ b/test/csit/suites/clustering/datastore/040_failover_read_from_follower.txt @@ -1,7 +1,7 @@ *** Settings *** -Documentation Run this test after running test no 05 -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py +Documentation This test tries to read the data that was written by the previous test from any one follower +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/ClusterStateLibrary.py *** Variables *** ${SHARD} shard-car-config @@ -9,7 +9,7 @@ ${SHARD} shard-car-config *** Test Cases *** Find follower [Documentation] find follower - ${FOLLOWERS} GetFollowers ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${FOLLOWERS} GetFollowers ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${FOLLOWERS} ${LAST_FOLLOWER} Set Variable ${FOLLOWERS[0]} Set Suite Variable ${LAST_FOLLOWER} diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_07_execute_on_remaining_follower.txt b/test/csit/suites/clustering/datastore/050_failover_crud_on_any_follower.txt similarity index 89% rename from test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_07_execute_on_remaining_follower.txt rename to test/csit/suites/clustering/datastore/050_failover_crud_on_any_follower.txt index 62be8a9987..89bb931b70 100644 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_07_execute_on_remaining_follower.txt +++ b/test/csit/suites/clustering/datastore/050_failover_crud_on_any_follower.txt @@ -1,7 +1,7 @@ *** Settings *** -Documentation Run this test after running test no 06 -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py +Documentation This test executes CRUD operations on any one follower after the old leader has been brought down +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/ClusterStateLibrary.py *** Variables *** ${SHARD} shard-car-config @@ -9,7 +9,7 @@ ${SHARD} shard-car-config *** Test Cases *** Find follower [Documentation] find follower - ${FOLLOWERS} GetFollowers ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${FOLLOWERS} GetFollowers ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${FOLLOWERS} ${LAST_FOLLOWER} Set Variable ${FOLLOWERS[0]} Set Suite Variable ${LAST_FOLLOWER} diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_08_execute_on_new_leader.txt b/test/csit/suites/clustering/datastore/060_failover_read_from_new_leader.txt similarity index 79% rename from test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_08_execute_on_new_leader.txt rename to test/csit/suites/clustering/datastore/060_failover_read_from_new_leader.txt index 06496e9e10..d673aefb59 100644 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_08_execute_on_new_leader.txt +++ b/test/csit/suites/clustering/datastore/060_failover_read_from_new_leader.txt @@ -1,7 +1,7 @@ *** Settings *** -Documentation Run this test after running test no 07 -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py +Documentation This test reads the data from the leader that was written to the follower by the previous test +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/ClusterStateLibrary.py *** Variables *** ${SHARD} shard-car-config @@ -9,7 +9,7 @@ ${SHARD} shard-car-config *** Test Cases *** Find Leader [Documentation] find new leader - ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} + ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${MEMBER1} ${MEMBER2} ${MEMBER3} Log ${NEW_LEADER} Set Suite Variable ${NEW_LEADER} diff --git a/test/csit/suites/clustering/datastore/130_recovery_restart_leader.txt b/test/csit/suites/clustering/datastore/130_recovery_restart_leader.txt new file mode 100644 index 0000000000..567eb3f37b --- /dev/null +++ b/test/csit/suites/clustering/datastore/130_recovery_restart_leader.txt @@ -0,0 +1,104 @@ +*** Settings *** +Documentation This test kills the leader and verifies that on restart the old leader is able to rejoin the cluster +Library Collections +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/SettingsLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py +Variables ../../../variables/Variables.py + +*** Variables *** +${REST_CONTEXT} /restconf/config/ +${KARAF_HOME} /root/odl/dist +${USER_NAME} root +${PASSWORD} Ecp123 +${CAR_SHARD} shard-car-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 + +Delete all cars + [Documentation] Delete all the cars from the system + ${resp} DeleteAllCars ${MEMBER1} ${PORT} 0 + ${resp} GetCars ${MEMBER1} ${PORT} 0 + Should Be Equal As Strings ${resp.status_code} 404 + + +Delete all people + [Documentation] Delete all the people from the system + ${resp} DeleteAllPersons ${MEMBER1} ${PORT} 0 + ${resp} GetPersons ${MEMBER1} ${PORT} 0 + Should Be Equal As Strings ${resp.status_code} 404 + +Add 200 cars + [Documentation] Add 200 cars + ${resp} AddCar ${MEMBER1} ${PORT} ${200} + Should Be Equal As Strings ${resp.status_code} 204 + +Add 200 people + [Documentation] Add 200 people + ${resp} AddPerson ${MEMBER1} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${200} + Should Be Equal As Strings ${resp.status_code} 204 + +Add Car Person mapping + [Documentation] Add Car Persons + ${resp} AddCarPerson ${MEMBER1} ${PORT} ${0} + ${resp} BuyCar ${MEMBER1} ${PORT} ${200} + +Stop the Leader + ${CAR_LEADER} GetLeader ${CAR_SHARD} ${3} ${3} ${1} 8181 ${MEMBER1} ${MEMBER2} ${MEMBER3} + Set Suite Variable ${CAR_LEADER} + Stopcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + Sleep 30 + KillController ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + +Get all the cars from Follower 1 + ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${MEMBER1} ${MEMBER2} ${MEMBER3} + ${resp} Getcars ${followers[0]} ${PORT} ${0} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} manufacturer1 + +Restart the Leader + Startcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + Sleep 120 + +Get all the cars from Leader + ${resp} Getcars ${CAR_LEADER} ${PORT} ${0} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} manufacturer1 + +Cleanup 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 + + + diff --git a/test/csit/suites/clustering/datastore/140_recovery_restart_follower.txt b/test/csit/suites/clustering/datastore/140_recovery_restart_follower.txt new file mode 100644 index 0000000000..195ef3efd8 --- /dev/null +++ b/test/csit/suites/clustering/datastore/140_recovery_restart_follower.txt @@ -0,0 +1,105 @@ +*** Settings *** +Documentation This test kills any of the followers and verifies that when that follower is restarted it can join the cluster +Library Collections +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/SettingsLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py +Variables ../../../variables/Variables.py + +*** Variables *** +${REST_CONTEXT} /restconf/config/ +${KARAF_HOME} /root/odl/dist +${USER_NAME} root +${PASSWORD} Ecp123 +${CAR_SHARD} shard-car-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 + +Delete all cars + [Documentation] Delete all the cars from the system + ${resp} DeleteAllCars ${MEMBER1} ${PORT} 0 + ${resp} GetCars ${MEMBER1} ${PORT} 0 + Should Be Equal As Strings ${resp.status_code} 404 + + +Delete all people + [Documentation] Delete all the people from the system + ${resp} DeleteAllPersons ${MEMBER1} ${PORT} 0 + ${resp} GetPersons ${MEMBER1} ${PORT} 0 + Should Be Equal As Strings ${resp.status_code} 404 + +Add 200 cars + [Documentation] Add 200 cars + ${resp} AddCar ${MEMBER1} ${PORT} ${200} + Should Be Equal As Strings ${resp.status_code} 204 + +Add 200 people + [Documentation] Add 200 people + ${resp} AddPerson ${MEMBER1} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${200} + Should Be Equal As Strings ${resp.status_code} 204 + +Add Car Person mapping + [Documentation] Add Car Persons + ${resp} AddCarPerson ${MEMBER1} ${PORT} ${0} + ${resp} BuyCar ${MEMBER1} ${PORT} ${200} + +Stop one of the followers + ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${MEMBER1} ${MEMBER2} ${MEMBER3} + ${CAR_FOLLOWER} Set Variable ${followers[0]} + Set Suite Variable ${CAR_FOLLOWER} + Stopcontroller ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + Sleep 30 + KillController ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + +Get all the cars from the other Follower + ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${MEMBER1} ${MEMBER2} ${MEMBER3} + ${resp} Getcars ${followers[0]} ${PORT} ${0} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} manufacturer1 + +Restart the Stopped Follower + Startcontroller ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} + Sleep 120 + +Get all the cars from Stopped Follower + ${resp} Getcars ${CAR_FOLLOWER} ${PORT} ${0} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} manufacturer1 + +Cleanup 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 + + + diff --git a/test/csit/suites/clustering/datastore/basic/__init__.txt b/test/csit/suites/clustering/datastore/__init__.txt similarity index 51% rename from test/csit/suites/clustering/datastore/basic/__init__.txt rename to test/csit/suites/clustering/datastore/__init__.txt index a6ced85fa2..cf422c9cf5 100644 --- a/test/csit/suites/clustering/datastore/basic/__init__.txt +++ b/test/csit/suites/clustering/datastore/__init__.txt @@ -1,5 +1,5 @@ *** Settings *** -Documentation Test suite for MD-SAL NSF +Documentation Test suite for Clustering Datastore Library SSHLibrary diff --git a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_09_execute_on_last_node.txt b/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_09_execute_on_last_node.txt deleted file mode 100644 index f3090814a5..0000000000 --- a/test/csit/suites/clustering/datastore/basic/010_restconf_rpc_crud_test_09_execute_on_last_node.txt +++ /dev/null @@ -1,31 +0,0 @@ -*** Settings *** -Documentation Run this test after running test no 05 -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py - -*** Variables *** -${SHARD} shard-car-config - -*** Test Cases *** -Stop Leader - [Documentation] find new leader - ${FOLLOWERS} GetFollowers ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - Log ${FOLLOWERS} - ${LAST_FOLLOWER} Set Variable ${FOLLOWERS[0]} - Set Suite Variable ${LAST_FOLLOWER} - ${NEW_LEADER} GetLeader ${SHARD} ${3} ${3} ${2} ${8181} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - Log ${NEW_LEADER} - Stopcontroller ${NEW_LEADER} ${USERNAME} ${PASSWORD} ${KARAFHOME} - Sleep 30 - - -Get cars from last follower - [Documentation] get cars from last follower - ${resp} Getcars ${LAST_FOLLOWER} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 500 - -Add cars and get cars from last follower - [Documentation] Add 80 cars and get added cars from last follower - ${resp} AddCar ${LAST_FOLLOWER} ${PORT} ${80} - Should Be Equal As Strings ${resp.status_code} 500 diff --git a/test/csit/suites/clustering/datastore/basic/030_restconf_rpc_crud_test_03_execute_on_follower2.txt b/test/csit/suites/clustering/datastore/basic/030_restconf_rpc_crud_test_03_execute_on_follower2.txt deleted file mode 100644 index 8bc66955a1..0000000000 --- a/test/csit/suites/clustering/datastore/basic/030_restconf_rpc_crud_test_03_execute_on_follower2.txt +++ /dev/null @@ -1,81 +0,0 @@ -*** Settings *** -Documentation Test suite for testing Distributed Datastore main operations performed from follower2 - -Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.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 - - -*** Test Cases *** -Add cars and get cars from Follower2 - [Documentation] Add 100 cars and get added cars from Follower2 - ${FOLLOWERS} GetFollowers ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - Log ${FOLLOWERS} - SET SUITE VARIABLE ${FOLLOWERS} - - ${resp} AddCar ${FOLLOWERS[1]} ${PORT} ${100} - Sleep 1 - ${resp} Getcars ${FOLLOWERS[1]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} manufacturer1 - -Add persons and get persons from Follower2 - [Documentation] Add 100 persons and get persons from Follower2 - [Documentation] Note: There should be one person added first to enable rpc - ${resp} AddPerson ${FOLLOWERS[1]} ${PORT} ${0} - ${resp} AddPerson ${FOLLOWERS[1]} ${PORT} ${100} - Sleep 1 - ${resp} GetPersons ${FOLLOWERS[1]} ${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 Follower2 - [Documentation] Add car-person and get car-person from Follower2 - [Documentation] Note: This is done to enable working of rpc - - ${resp} AddCarPerson ${FOLLOWERS[1]} ${PORT} ${0} - ${resp} GetCarPersonMappings ${FOLLOWERS[1]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} user0 - -Purchase 100 cars using Follower1 - [Documentation] Purchase 100 cars using Follower2 - - ${resp} BuyCar ${FOLLOWERS[1]} ${PORT} ${100} - Sleep 1 - ${resp} GetCarPersonMappings ${FOLLOWERS[1]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - -Get car-person mappings using Follower2 - [Documentation] Get car-person mappings using follower2 to see 100 entry - ${resp} GetCarPersonMappings ${FOLLOWERS[1]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} user100 - Should Contain ${resp.content} user5 - -Get car-person mappings using Leader - [Documentation] Get car-person mappings using Leader to see 100 entry - ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - Log ${CURRENT_CAR_LEADER} - Sleep 1 - ${resp} GetCarPersonMappings ${CURRENT_CAR_LEADER} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} user100 - -Get car-person mappings using Follower1 - [Documentation] Get car-person mappings using Follower1 to see 100 entry - ${resp} GetCarPersonMappings ${FOLLOWERS[0]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} user0 - Should Contain ${resp.content} user100 diff --git a/test/csit/suites/clustering/datastore/basic/130_restconf_disaster_recovery_restart_leader.txt b/test/csit/suites/clustering/datastore/basic/130_restconf_disaster_recovery_restart_leader.txt deleted file mode 100644 index 925dabace9..0000000000 --- a/test/csit/suites/clustering/datastore/basic/130_restconf_disaster_recovery_restart_leader.txt +++ /dev/null @@ -1,104 +0,0 @@ -*** Settings *** -Documentation Test suite for RESTCONF RPC CAR PERSON -Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py -Variables ../../../../variables/Variables.py - -*** Variables *** -${REST_CONTEXT} /restconf/config/ -${KARAF_HOME} /root/odl/dist -${USER_NAME} root -${PASSWORD} Ecp123 -${CAR_SHARD} shard-car-config - -*** Test Cases *** -Stop All Controllers - [Documentation] Stop all the controllers in the cluster - Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - KillController ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - KillController ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - KillController ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - - -Clean All Journals - [Documentation] Clean the journals of all the controllers in the cluster - CleanJournal ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - CleanJournal ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - CleanJournal ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 5 - -Start All Controllers - [Documentation] Start all the controllers in the cluster - Startcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Startcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Startcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 120 - -Delete all cars - [Documentation] Delete all the cars from the system - ${resp} DeleteAllCars ${LEADER} ${PORT} 0 - ${resp} GetCars ${LEADER} ${PORT} 0 - Should Be Equal As Strings ${resp.status_code} 404 - - -Delete all people - [Documentation] Delete all the people from the system - ${resp} DeleteAllPersons ${LEADER} ${PORT} 0 - ${resp} GetPersons ${LEADER} ${PORT} 0 - Should Be Equal As Strings ${resp.status_code} 404 - -Add 20000 cars - [Documentation] Add 200 cars - ${resp} AddCar ${LEADER} ${PORT} ${200} - Should Be Equal As Strings ${resp.status_code} 204 - -Add 20000 people - [Documentation] Add 200 people - ${resp} AddPerson ${LEADER} ${PORT} ${0} - ${resp} AddPerson ${LEADER} ${PORT} ${200} - Should Be Equal As Strings ${resp.status_code} 204 - -Add Car Person mapping - [Documentation] Add Car Persons - ${resp} AddCarPerson ${LEADER} ${PORT} ${0} - ${resp} BuyCar ${LEADER} ${PORT} ${200} - -Stop the Leader - ${CAR_LEADER} GetLeader ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - Set Suite Variable ${CAR_LEADER} - Stopcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - KillController ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - -Get all the cars from Follower 1 - ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - ${resp} Getcars ${followers[0]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} manufacturer1 - -Restart the Leader - Startcontroller ${CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 120 - -Get all the cars from Leader - ${resp} Getcars ${CAR_LEADER} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} manufacturer1 - -Cleanup All Controllers - [Documentation] Stop all the controllers in the cluster - Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - - - diff --git a/test/csit/suites/clustering/datastore/basic/140_restconf_disaster_recovery_restart_follower.txt b/test/csit/suites/clustering/datastore/basic/140_restconf_disaster_recovery_restart_follower.txt deleted file mode 100644 index 87793c5c57..0000000000 --- a/test/csit/suites/clustering/datastore/basic/140_restconf_disaster_recovery_restart_follower.txt +++ /dev/null @@ -1,105 +0,0 @@ -*** Settings *** -Documentation Test suite for RESTCONF RPC CAR PERSON -Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py -Variables ../../../../variables/Variables.py - -*** Variables *** -${REST_CONTEXT} /restconf/config/ -${KARAF_HOME} /root/odl/dist -${USER_NAME} root -${PASSWORD} Ecp123 -${CAR_SHARD} shard-car-config - -*** Test Cases *** -Stop All Controllers - [Documentation] Stop all the controllers in the cluster - Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - KillController ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - KillController ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - KillController ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - - -Clean All Journals - [Documentation] Clean the journals of all the controllers in the cluster - CleanJournal ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - CleanJournal ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - CleanJournal ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 5 - -Start All Controllers - [Documentation] Start all the controllers in the cluster - Startcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Startcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Startcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 120 - -Delete all cars - [Documentation] Delete all the cars from the system - ${resp} DeleteAllCars ${LEADER} ${PORT} 0 - ${resp} GetCars ${LEADER} ${PORT} 0 - Should Be Equal As Strings ${resp.status_code} 404 - - -Delete all people - [Documentation] Delete all the people from the system - ${resp} DeleteAllPersons ${LEADER} ${PORT} 0 - ${resp} GetPersons ${LEADER} ${PORT} 0 - Should Be Equal As Strings ${resp.status_code} 404 - -Add 20000 cars - [Documentation] Add 200 cars - ${resp} AddCar ${LEADER} ${PORT} ${200} - Should Be Equal As Strings ${resp.status_code} 204 - -Add 20000 people - [Documentation] Add 200 people - ${resp} AddPerson ${LEADER} ${PORT} ${0} - ${resp} AddPerson ${LEADER} ${PORT} ${200} - Should Be Equal As Strings ${resp.status_code} 204 - -Add Car Person mapping - [Documentation] Add Car Persons - ${resp} AddCarPerson ${LEADER} ${PORT} ${0} - ${resp} BuyCar ${LEADER} ${PORT} ${200} - -Stop of of the followers - ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - ${CAR_FOLLOWER} Set Variable ${followers[0]} - Set Suite Variable ${CAR_FOLLOWER} - Stopcontroller ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - KillController ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - -Get all the cars from the other Follower - ${followers} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} 8181 ${LEADER} ${FOLLOWER1} ${FOLLOWER2} - ${resp} Getcars ${followers[0]} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} manufacturer1 - -Restart the Stopped Follower - Startcontroller ${CAR_FOLLOWER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 120 - -Get all the cars from Stopped Follower - ${resp} Getcars ${CAR_FOLLOWER} ${PORT} ${0} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} manufacturer1 - -Cleanup All Controllers - [Documentation] Stop all the controllers in the cluster - Stopcontroller ${LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Stopcontroller ${FOLLOWER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} - Sleep 30 - - - diff --git a/test/csit/suites/clustering/datastore/longevity/010__longevity.txt b/test/csit/suites/clustering/longevity/010__longevity.txt similarity index 100% rename from test/csit/suites/clustering/datastore/longevity/010__longevity.txt rename to test/csit/suites/clustering/longevity/010__longevity.txt diff --git a/test/csit/suites/clustering/datastore/longevity/__init__.txt b/test/csit/suites/clustering/longevity/__init__.txt similarity index 100% rename from test/csit/suites/clustering/datastore/longevity/__init__.txt rename to test/csit/suites/clustering/longevity/__init__.txt diff --git a/test/csit/suites/clustering/routedrpc/001_start_cluster.txt b/test/csit/suites/clustering/routedrpc/001_start_cluster.txt new file mode 100644 index 0000000000..da9264a2f4 --- /dev/null +++ b/test/csit/suites/clustering/routedrpc/001_start_cluster.txt @@ -0,0 +1,38 @@ +*** 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 \ No newline at end of file diff --git a/test/csit/suites/clustering/datastore/routedrpc/023_routed_rpc_crud_test.txt b/test/csit/suites/clustering/routedrpc/023_routed_rpc_crud_test.txt similarity index 65% rename from test/csit/suites/clustering/datastore/routedrpc/023_routed_rpc_crud_test.txt rename to test/csit/suites/clustering/routedrpc/023_routed_rpc_crud_test.txt index 1e1781dce8..2ee99f2306 100644 --- a/test/csit/suites/clustering/datastore/routedrpc/023_routed_rpc_crud_test.txt +++ b/test/csit/suites/clustering/routedrpc/023_routed_rpc_crud_test.txt @@ -1,12 +1,12 @@ *** Settings *** Documentation Test suite for Routed RPC. 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 +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/ @@ -15,17 +15,17 @@ ${REST_CONTEXT} /restconf/config/ *** Test Cases *** Add cars and get cars from Leader [Documentation] Add 100 cars and get added cars from Leader - ${resp} AddCar ${LEADER} ${PORT} ${100} - ${resp} Getcars ${LEADER} ${PORT} ${0} + ${resp} AddCar ${MEMBER1} ${PORT} ${100} + ${resp} Getcars ${MEMBER1} ${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 [Documentation] Note: There should be one person added first to enable rpc - ${resp} AddPerson ${LEADER} ${PORT} ${0} - ${resp} AddPerson ${LEADER} ${PORT} ${100} - ${resp} GetPersons ${LEADER} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${100} + ${resp} GetPersons ${MEMBER1} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user5 SLEEP 10 @@ -33,32 +33,32 @@ Add persons and get persons from Leader Add car-person mapping and get car-person mapping from Follower1 [Documentation] Add car-person and get car-person from Leader [Documentation] Note: This is done to enable working of rpc - ${resp} AddCarPerson ${FOLLOWER1} ${PORT} ${0} - ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0} + ${resp} AddCarPerson ${MEMBER2} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user0 SLEEP 5 Purchase 100 cars using Follower1 [Documentation] Purchase 100 cars using Follower1 - ${resp} BuyCar ${FOLLOWER1} ${PORT} ${100} - ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0} + ${resp} BuyCar ${MEMBER2} ${PORT} ${100} + ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Get Cars from Leader [Documentation] Get 100 using Leader - ${resp} Getcars ${LEADER} ${PORT} ${0} + ${resp} Getcars ${MEMBER1} ${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 ${LEADER} ${PORT} ${0} + ${resp} GetPersons ${MEMBER1} ${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 ${LEADER} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER1} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 diff --git a/test/csit/suites/clustering/datastore/routedrpc/024_routed_rpc_crud_test.txt b/test/csit/suites/clustering/routedrpc/024_routed_rpc_crud_test.txt similarity index 64% rename from test/csit/suites/clustering/datastore/routedrpc/024_routed_rpc_crud_test.txt rename to test/csit/suites/clustering/routedrpc/024_routed_rpc_crud_test.txt index 82d4acc694..e29c3f5bf1 100644 --- a/test/csit/suites/clustering/datastore/routedrpc/024_routed_rpc_crud_test.txt +++ b/test/csit/suites/clustering/routedrpc/024_routed_rpc_crud_test.txt @@ -1,13 +1,13 @@ *** Settings *** Documentation Test suite for Routed RPC. Library Collections -Library ../../../../libraries/RequestsLibrary.py -Library ../../../../libraries/Common.py -Library ../../../../libraries/CrudLibrary.py -Library ../../../../libraries/SettingsLibrary.py -Library ../../../../libraries/UtilLibrary.py -Library ../../../../libraries/ClusterStateLibrary.py -Variables ../../../../variables/Variables.py +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py +Library ../../../libraries/CrudLibrary.py +Library ../../../libraries/SettingsLibrary.py +Library ../../../libraries/UtilLibrary.py +Library ../../../libraries/ClusterStateLibrary.py +Variables ../../../variables/Variables.py *** Variables *** ${REST_CONTEXT} /restconf/config/ @@ -15,104 +15,104 @@ ${REST_CONTEXT} /restconf/config/ *** Test Cases *** Add cars and get cars from Leader [Documentation] Add 100 cars and get added cars from Leader - ${resp} AddCar ${LEADER} ${PORT} ${100} - ${resp} Getcars ${LEADER} ${PORT} ${0} + ${resp} AddCar ${MEMBER1} ${PORT} ${100} + ${resp} Getcars ${MEMBER1} ${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 [Documentation] Note: There should be one person added first to enable rpc - ${resp} AddPerson ${LEADER} ${PORT} ${0} - ${resp} AddPerson ${LEADER} ${PORT} ${100} - ${resp} GetPersons ${LEADER} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${0} + ${resp} AddPerson ${MEMBER1} ${PORT} ${100} + ${resp} GetPersons ${MEMBER1} ${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 [Documentation] Note: This is done to enable working of rpc - ${resp} AddCarPerson ${FOLLOWER1} ${PORT} ${0} - ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0} + ${resp} AddCarPerson ${MEMBER2} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER2} ${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 ${FOLLOWER1} ${PORT} ${100} - ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0} + ${resp} BuyCar ${MEMBER2} ${PORT} ${100} + ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Get Cars from Leader [Documentation] Get 100 using Leader - ${resp} Getcars ${LEADER} ${PORT} ${0} + ${resp} Getcars ${MEMBER1} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} manufacturer9 Get persons from Leader [Documentation] Get 11 Persons from Leader - ${resp} GetPersons ${LEADER} ${PORT} ${0} + ${resp} GetPersons ${MEMBER1} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Get car-person mappings using Leader [Documentation] Get car-person mappings using Leader to see 100 entry - ${resp} GetCarPersonMappings ${LEADER} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER1} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Stop Leader [Documentation] Stop Leader controller - ${resp} Stopcontroller ${LEADER} root Ecp123 /opt/clustering/dist + ${resp} Stopcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME} SLEEP 30 - ${resp} Killcontroller ${LEADER} root Ecp123 /opt/clustering/dist + ${resp} Killcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME} Add cars and get cars from Follower1 [Documentation] Add 100 cars and get added cars from Follower - ${resp} AddCar ${FOLLOWER1} ${PORT} ${100} - ${resp} Getcars ${FOLLOWER1} ${PORT} ${0} + ${resp} AddCar ${MEMBER2} ${PORT} ${100} + ${resp} Getcars ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} manufacturer1 Add persons and get persons from Follower1 [Documentation] Add 100 persons and get persons [Documentation] Note: There should be one person added first to enable rpc - ${resp} AddPerson ${FOLLOWER1} ${PORT} ${0} - ${resp} AddPerson ${FOLLOWER1} ${PORT} ${100} - ${resp} GetPersons ${FOLLOWER1} ${PORT} ${0} + ${resp} AddPerson ${MEMBER2} ${PORT} ${0} + ${resp} AddPerson ${MEMBER2} ${PORT} ${100} + ${resp} GetPersons ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user5 SLEEP 10 Purchase 100 cars using Follower2 [Documentation] Purchase 100 cars using Follower2 - ${resp} BuyCar ${FOLLOWER2} ${PORT} ${100} + ${resp} BuyCar ${MEMBER3} ${PORT} ${100} SLEEP 10 - ${resp} GetCarPersonMappings ${FOLLOWER2} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER3} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Get Cars from Follower1 [Documentation] Get 100 using Follower1 - ${resp} Getcars ${FOLLOWER1} ${PORT} ${0} + ${resp} Getcars ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} manufacturer9 Get persons from Follower1 [Documentation] Get 11 Persons from Follower1 - ${resp} GetPersons ${FOLLOWER1} ${PORT} ${0} + ${resp} GetPersons ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Get car-person mappings using Follower1 [Documentation] Get car-person mappings using Follower1 to see 100 entry - ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0} + ${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} user100 Start Leader [Documentation] Start Leader controller - ${resp} Startcontroller ${LEADER} root Ecp123 /opt/clustering/dist + ${resp} Startcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME} SLEEP 20 diff --git a/test/tools/cluster-deployer/remote_host.py b/test/tools/cluster-deployer/remote_host.py index d6780ce960..aebea60e2e 100644 --- a/test/tools/cluster-deployer/remote_host.py +++ b/test/tools/cluster-deployer/remote_host.py @@ -1,6 +1,6 @@ # remote_host.py - -# +# +# # The RemoteHost class provides methods to do operations on a remote host # @@ -18,8 +18,10 @@ class RemoteHost: lib = SSHLibrary() lib.open_connection(self.host) lib.login(username=self.user,password=self.password) - lib.execute_command(command) + rc = lib.execute_command(command, return_rc = True) lib.close_connection() + if rc[1] != 0: + raise Exception('remote command failed [{0}] with exit code {1}'.format(command, rc)) def mkdir(self, dir_name): @@ -37,4 +39,4 @@ class RemoteHost: self.exec_cmd("ps axf | grep karaf | grep -v grep | awk '{print \"kill -9 \" $1}' | sh") def start_controller(self, dir_name): - self.exec_cmd(dir_name + "/odl/bin/start") \ No newline at end of file + self.exec_cmd(dir_name + "/odl/bin/start")