Some datastore functionality has changed between Helium and Lithium. The crud and settings libraries
needed to be modified for changes in restconf for the cars shard. Also, an unneccessary sleep was removed
from the crud library. Because there's a difference in the installed features required for Hydrogen
and Lithium cluster testing, the multi-node-test clustering template was changed. Some other features to
help with troubleshooting were also added. Finally, the clustering template temp directory was added to
gitignore to simplify test development.
Change-Id: I8b704d57af64985d8d4be6d2454601371c0f55e8
Signed-off-by: Phillip Shea <phillip.shea@hp.com>
Add Cars And Verify
[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}
Should Be Equal As Strings ${resp.status_code} 204
Wait Until Keyword Succeeds ${timeout} 2s Get Cars And Verify ${controller_ip} ${num_cars}
import time
+def initCar(hostname, port):
+ """Initiales the car shard"""
+ x = 0
+ strId = str(x)
+ payload = SettingsLibrary.add_car_init_payload_template.substitute(
+ id=strId, category="category" + strId, model="model" + strId,
+ manufacturer="manufacturer" + strId,
+ year=(2000 + x % 100))
+ print("Initialization payload=")
+ print(payload)
+ resp = UtilLibrary.post(SettingsLibrary.getAddCarInitUrl(hostname, port), "admin", "admin", payload)
+ print("the response of the POST to add car=")
+ print(resp)
+ return resp
+
+
def addCar(hostname, port, numberOfCars):
"""Creates the specified number of cars based on Cars yang model using RESTCONF"""
- for x in range(1, numberOfCars+1):
+ for x in range(1, numberOfCars + 1):
strId = str(x)
payload = SettingsLibrary.add_car_payload_template.substitute(
id=strId, category="category" + strId, model="model" + strId,
print("the response of the POST to add car=")
print(resp)
-
- time.sleep(5) # Let the add finish
return resp
# TBD: Detailed validation
before invoking this method
</note>
"""
+
+ print "Buying " + str(numberOfCarBuyers) + " Cars"
+ result = True
for x in range(start, start+numberOfCarBuyers):
strId = str(x+1)
print(resp)
print(resp.text)
- if (resp.status_code != 204):
- return False
+ if (resp.status_code != 200):
+ result = False
- return True
+ return result
def getCars(hostname, port, ignore):
return "http://" + hostname + ":" + port + "/restconf/config/car-people:car-people"
-def getAddCarUrl(hostname, port):
+def getAddCarInitUrl(hostname, port):
"""POST or DELETE URL"""
return "http://" + hostname + ":" + port + "/restconf/config"
+def getAddCarUrl(hostname, port):
+ """POST or DELETE URL"""
+ return "http://" + hostname + ":" + port + "/restconf/config/car:cars"
+
+
def getAddPersonUrl(hostname, port):
"""POST or DELETE URL"""
return "http://" + hostname + ":" + port + "/restconf/config"
shardIndex + "-" + shardName + ",type=DistributedConfigDatastore"
-# Template for Car resource payload
-add_car_payload_template = Template(
+# Template for Car init resource payload
+add_car_init_payload_template = Template(
"""
{"car:cars":{
"car-entry": [
}}
""")
+# Template for Car resource payload
+add_car_payload_template = Template(
+ """
+ {"car-entry": [
+ {
+ "id": "$id",
+ "category": "$category",
+ "model": "$model",
+ "manufacturer": "$manufacturer",
+ "year": "$year"
+ }
+ ]
+ }
+ """)
+
# Template for Person resource payload
add_person_payload_template = Template(
"""
${REST_CONTEXT} /restconf/config/
-*** Test Cases ***
-Add cars and get cars from Leader
+*** Test Cases ***
+Add cars and get cars from Leader
[Documentation] Add 100 cars and get added cars from Leader
- ${resp} AddCar ${MEMBER1} ${PORT} ${100}
+ ${resp} InitCar ${MEMBER1} ${PORT}
+ ${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
+ 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 ${MEMBER1} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER1} ${PORT} ${100}
+ ${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
+ SLEEP 10
Add car-person mapping and get car-person mapping from Follower1
[Documentation] Add car-person and get car-person from Leader
Should Contain ${resp.content} user0
SLEEP 5
-Purchase 100 cars using Follower1
+Purchase 100 cars using Follower1
[Documentation] Purchase 100 cars using Follower1
${resp} BuyCar ${MEMBER2} ${PORT} ${100}
${resp} GetCarPersonMappings ${MEMBER2} ${PORT} ${0}
*** Variables ***
${REST_CONTEXT} /restconf/config/
-*** Test Cases ***
-Add cars and get cars from Leader
+*** Test Cases ***
+Add cars and get cars from Leader
[Documentation] Add 100 cars and get added cars from Leader
- ${resp} AddCar ${MEMBER1} ${PORT} ${100}
+ ${resp} InitCar ${MEMBER1} ${PORT}
+ ${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
+ 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 ${MEMBER1} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER1} ${PORT} ${100}
+ ${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
+ 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
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} user0
-Purchase 100 cars using Follower
+Purchase 100 cars using Follower
[Documentation] Purchase 100 cars using Follower
SLEEP 10
${resp} BuyCar ${MEMBER2} ${PORT} ${100}
SLEEP 30
${resp} Killcontroller ${MEMBER1} ${USERNAME} ${PASSWORD} ${KARAF_HOME}
-
-Add cars and get cars from Follower1
+Add cars and get cars from Follower1
[Documentation] Add 100 cars and get added cars from Follower
- ${resp} AddCar ${MEMBER2} ${PORT} ${100}
+ ${resp InitCar ${MEMBER2} ${PORT}
+ ${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 ${MEMBER2} ${PORT} ${0}
- ${resp} AddPerson ${MEMBER2} ${PORT} ${100}
+ ${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
+
+Purchase 100 cars using Follower2
[Documentation] Purchase 100 cars using Follower2
${resp} BuyCar ${MEMBER3} ${PORT} ${100}
SLEEP 10
#
# Comma separated list of features to install at startup
#
-featuresBoot=config,standard,region,package,kar,ssh,management,odl-clustering-test-app,odl-restconf-noauth,odl-mdsal-clustering
+featuresBoot=config,standard,region,package,kar,ssh,management,odl-restconf,odl-mdsal-clustering,odl-clustering-test-app,odl-netconf-connector-ssh
#
# Defines if the boot features are started in asynchronous mode (in a dedicated thread)