--- /dev/null
+*** Settings ***
+Documentation Keywords wrapping controller's cluster-admin yang model rpcs.
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+Library XML
+Resource ${CURDIR}/ClusterManagement.robot
+Resource ${CURDIR}/TemplatedRequests.robot
+
+*** Variables ***
+${CLUSTERADMIN_RPC_DIR} ${CURDIR}/../variables/mdsal/clusteradmin
+${ADD_PREFIX_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/add_prefix_shard_replica
+${ADD_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/add_shard_replica
+${MAKE_LEADER_LOCAL_DIR} ${CLUSTERADMIN_RPC_DIR}/make_leader_local
+${REMOVE_PREFIX_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/remove_prefix_shard_replica
+${REMOVE_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/remove_shard_replica
+
+*** Keywords ***
+Make_Leader_Local
+ [Arguments] ${member_index} ${shard_name} ${shard_type}
+ [Documentation] Makes the node to be a shard leader by invoking make-leader-local rpc.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} SHARD_TYPE=${shard_type}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${MAKE_LEADER_LOCAL_DIR} mapping=${mapping} session=${session}
+
+Add_Prefix_Shard_Replica
+ [Arguments] ${member_index} ${shard_prefix} ${ds_type}
+ [Documentation] Add prefix shard replica to given member by invoking add-prefix-shard-replica rpc.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary SHARD_PREFIX=${shard_prefix} DATA_STORE_TYPE=${ds_type}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${ADD_PREFIX_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
+
+Remove_Prefix_Shard_Replica
+ [Arguments] ${member_index} ${shard_prefix} ${member_name} ${ds_type}
+ [Documentation] Remove prefix shard replica from the given member by invoking remove-prefix-shard-replica rpc.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary SHARD_PREFIX=${shard_prefix} MEMBER_NAME=${member_name} DATA_STORE_TYPE=${ds_type}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${REMOVE_PREFIX_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
+
+Add_Shard_Replica
+ [Arguments] ${member_index} ${shard_name} ${ds_type}
+ [Documentation] Add shard replica to given member by invoking add-shard-replica rpc.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} DATA_STORE_TYPE=${ds_type}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${ADD_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
+
+Remove_Shard_Replica
+ [Arguments] ${member_index} ${shard_name} ${member_name} ${ds_type}
+ [Documentation] Remove shard replica from the given member by invoking remove-shard-replica rpc.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} MEMBER_NAME=${member_name} DATA_STORE_TYPE=${ds_type}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${REMOVE_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
${ip_address} = Collections.Get From Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${member_index}
[Return] ${ip_address}
+Resolve_IP_Address_For_Members
+ [Arguments] ${member_index_list}
+ [Documentation] Return a list of IP address of given indexes.
+ ${member_ip_list} = BuiltIn.Create_List
+ : FOR ${index} IN @{member_index_list}
+ \ ${ip_address} = Collections.Get From Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${index}
+ \ Collections.Append_To_List ${member_ip_list} ${ip_address}
+ [Return] ${member_ip_list}
+
Resolve_Http_Session_For_Member
[Arguments] ${member_index}
[Documentation] Return RequestsLibrary session alias pointing to node of given index.
*** Settings ***
Documentation Keywords wrapping controller's odl-mdsal-lowlevel yang model rpcs.
...
-... This is just an initial skeleton implementation, calls are debugged. Multiple
-... changes will follow as suites will be implemented.
-... This suite should be preferably merged before any suite to avoid conflicting
-... situations while suites will be implementing.
-...
... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
...
... This program and the accompanying materials are made available under the
Resource ${CURDIR}/TemplatedRequests.robot
*** Variables ***
-${RPC_DIR} ${CURDIR}/../variables/mdsal/lowlevelrpc
-${ADD_SHARD_REPLICA_DIR} ${RPC_DIR}/add_shard_replica
-${BECOME_MODULE_LEADER_DIR} ${RPC_DIR}/become_module_leader
-${BECOME_PREFIX_LEADER_DIR} ${RPC_DIR}/become_prefix_leader
-${CHECK_PUBLISH_NOTIFICATIONS_DIR} ${RPC_DIR}/check_publish_notifications
-${DECONFIGURE_ID_INTS_SHARD_DIR} ${RPC_DIR}/deconfigure_id_ints_shard
-${GET_CONSTANT_DIR} ${RPC_DIR}/get_constant
-${GET_CONTEXTED_CONSTANT_DIR} ${RPC_DIR}/get_contexted_constant
-${GET_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/get_singleton_constant
-${IS_CLIENT_ABORTED_DIR} ${RPC_DIR}/is_client_aborted
-${PRODUCE_TRANSACTIONS_DIR} ${RPC_DIR}/produce_transactions
-${REGISTER_BOUND_CONSTANT_DIR} ${RPC_DIR}/register_bound_constant
-${REGISTER_CONSTANT_DIR} ${RPC_DIR}/register_constant
-${REGISTER_DEFAULT_CONSTANT_DIR} ${RPC_DIR}/register_default_constant
-${REGISTER_FLAPPING_SINGLETON_DIR} ${RPC_DIR}/register_flapping_singleton
-${REGISTER_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/register_singleton_constant
-${REMOVE_SHARD_REPLICA_DIR} ${RPC_DIR}/remove_shard_replica
-${START_PUBLISH_NOTIFICATIONS_DIR} ${RPC_DIR}/start_publish_notifications
-${SUBSCRIBE_DDTL_DIR} ${RPC_DIR}/subscribe_ddtl
-${SUBSCRIBE_DTCL_DIR} ${RPC_DIR}/subscribe_dtcl
-${SUBSCRIBE_YNL_DIR} ${RPC_DIR}/subscribe_ynl
-${UNREGISTER_BOUND_CONSTANT_DIR} ${RPC_DIR}/unregister_bound_constant
-${UNREGISTER_CONSTANT_DIR} ${RPC_DIR}/unregister_constant
-${UNREGISTER_DEFAULT_CONSTANT_DIR} ${RPC_DIR}/unregister_default_constant
-${UNREGISTER_FLAPPING_SINGLETON_DIR} ${RPC_DIR}/unregister_flapping_singleton
-${UNREGISTER_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/unregister_singleton_constant
-${UNSUBSCRIBE_DDTL_DIR} ${RPC_DIR}/unsubscribe_ddtl
-${UNSUBSCRIBE_DTCL_DIR} ${RPC_DIR}/unsubscribe_dtcl
-${UNSUBSCRIBE_YNL_DIR} ${RPC_DIR}/unsubscribe_ynl
-${WRITE_TRANSACTIONS_DIR} ${RPC_DIR}/write_transactions
+${LOWLEVEL_RPC_DIR} ${CURDIR}/../variables/mdsal/lowlevelrpc
+${BECOME_PREFIX_LEADER_DIR} ${LOWLEVEL_RPC_DIR}/become_prefix_leader
+${CHECK_PUBLISH_NOTIFICATIONS_DIR} ${LOWLEVEL_RPC_DIR}/check_publish_notifications
+${CREATE_PREFIX_SHARD_DIR} ${LOWLEVEL_RPC_DIR}/create_prefix_shard
+${GET_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/get_constant
+${GET_CONTEXTED_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/get_contexted_constant
+${GET_SINGLETON_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/get_singleton_constant
+${PRODUCE_TRANSACTIONS_DIR} ${LOWLEVEL_RPC_DIR}/produce_transactions
+${REGISTER_BOUND_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/register_bound_constant
+${REGISTER_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/register_constant
+${REGISTER_FLAPPING_SINGLETON_DIR} ${LOWLEVEL_RPC_DIR}/register_flapping_singleton
+${REGISTER_SINGLETON_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/register_singleton_constant
+${REMOVE_PREFIX_SHARD_DIR} ${LOWLEVEL_RPC_DIR}/remove_prefix_shard
+${START_PUBLISH_NOTIFICATIONS_DIR} ${LOWLEVEL_RPC_DIR}/start_publish_notifications
+${SUBSCRIBE_DDTL_DIR} ${LOWLEVEL_RPC_DIR}/subscribe_ddtl
+${SUBSCRIBE_DTCL_DIR} ${LOWLEVEL_RPC_DIR}/subscribe_dtcl
+${SUBSCRIBE_YNL_DIR} ${LOWLEVEL_RPC_DIR}/subscribe_ynl
+${UNREGISTER_BOUND_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/unregister_bound_constant
+${UNREGISTER_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/unregister_constant
+${UNREGISTER_FLAPPING_SINGLETON_DIR} ${LOWLEVEL_RPC_DIR}/unregister_flapping_singleton
+${UNREGISTER_SINGLETON_CONSTANT_DIR} ${LOWLEVEL_RPC_DIR}/unregister_singleton_constant
+${UNSUBSCRIBE_DDTL_DIR} ${LOWLEVEL_RPC_DIR}/unsubscribe_ddtl
+${UNSUBSCRIBE_DTCL_DIR} ${LOWLEVEL_RPC_DIR}/unsubscribe_dtcl
+${UNSUBSCRIBE_YNL_DIR} ${LOWLEVEL_RPC_DIR}/unsubscribe_ynl
+${WRITE_TRANSACTIONS_DIR} ${LOWLEVEL_RPC_DIR}/write_transactions
*** Keywords ***
Get_Constant
Register_Singleton_Constant
[Arguments] ${member_index} ${constant}
- [Documentation] TODO: more desctiptive comment than: Invoke register-singleton-constant rpc.
+ [Documentation] Register singleton application on given node by invoking register-singleton-constant rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
&{mapping} BuiltIn.Create_Dictionary CONSTANT=${constant}
TemplatedRequests.Post_As_Xml_Templated ${REGISTER_SINGLETON_CONSTANT_DIR} mapping=${mapping} session=${session}
Unregister_Singleton_Constant
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke unregister-singleton-constant rpc.
+ [Documentation] Unregister singleton application on given node by invoking unregister-singleton-constant rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
TemplatedRequests.Post_As_Xml_Templated ${UNREGISTER_SINGLETON_CONSTANT_DIR} session=${session}
Register_Flapping_Singleton
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke register-flapping-singleton rpc.
+ [Documentation] Activate flapping application on given node by invoking register-flapping-singleton rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
TemplatedRequests.Post_As_Xml_Templated ${REGISTER_FLAPPING_SINGLETON_DIR} session=${session}
Unregister_Flapping_Singleton
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke unregister-flapping-singleton rpc.
+ [Documentation] Deactivate flapping singleton application by invoking unregister-flapping-singleton rpc.
+ ... Return the successful re-registrations count.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
${text} = TemplatedRequests.Post_As_Xml_Templated ${UNREGISTER_FLAPPING_SINGLETON_DIR} session=${session}
${xml} = XML.Parse_Xml ${text}
BuiltIn.Return_From_Keyword ${count}
Write_Transactions
- [Arguments] ${member_index} ${seconds} ${trans_per_sec} ${chained_trans}=${True}
- [Documentation] TODO: more desctiptive comment than: Invoke write-transactions rpc.
+ [Arguments] ${member_index} ${identifier} ${seconds} ${trans_per_sec} ${chained_trans}=${True}
+ [Documentation] Create transactions with given rate for given time for module-based shards.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary SECONDS=${seconds} TPS=${trans_per_sec} CHAINED_TRANSACTIONS=${chained_trans}
+ &{mapping} BuiltIn.Create_Dictionary ID=${identifier} DURATION=${seconds} RATE=${trans_per_sec} CHAINED_FLAG=${chained_trans}
TemplatedRequests.Post_As_Xml_Templated ${WRITE_TRANSACTIONS_DIR} mapping=${mapping} session=${session}
Produce_Transactions
[Arguments] ${member_index} ${seconds} ${trans_per_sec} ${isolated_trans}=${True}
- [Documentation] TODO: more desctiptive comment than: Invoke produce-transactions rpc.
+ [Documentation] Create transactions with given rate for given time for prefix-based shards.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
&{mapping} BuiltIn.Create_Dictionary SECONDS=${seconds} TPS=${trans_per_sec} ISOLATED_TRANSACTIONS=${chained_trans}
TemplatedRequests.Post_As_Xml_Templated ${PRODUCE_TRANSACTIONS_DIR} mapping=${mapping} session=${session}
-Become_Prefix_Leader
- [Arguments] ${member_index} ${shard_name}
- [Documentation] TODO: more desctiptive comment than: Invoke become-prefix-leader rpc.
- ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
- ${text} = TemplatedRequests.Post_As_Xml_Templated ${BECOME_PREFIX_LEADER_DIR} mapping=${mapping} session=${session}
-
-Become_Module_Leader
- [Arguments] ${member_index} ${shard_name}
- [Documentation] TODO: more desctiptive comment than: Invoke become-module-leader rpc.
- ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
- ${text} = TemplatedRequests.Post_As_Xml_Templated ${BECOME_MODULE_LEADER_DIR} mapping=${mapping} session=${session}
-
-Remove_Shard_Replica
- [Arguments] ${member_index} ${shard_name}
- [Documentation] TODO: more desctiptive comment than: Invoke remove-shard-replica rpc.
- ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
- TemplatedRequests.Post_As_Xml_Templated ${REMOVE_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
-
-Add_Shard_Replica
- [Arguments] ${member_index} ${shard_name}
- [Documentation] TODO: more desctiptive comment than: Invoke add-shard-replica rpc.
+Create_Prefix_Shard
+ [Arguments] ${member_index} ${prefix} ${replicas}
+ [Documentation] Create prefix based shard.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
- TemplatedRequests.Post_As_Xml_Templated ${ADD_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
+ ${replicas_str} BuiltIn.Set_Variable ${EMPTY}
+ : FOR ${replica} IN @{replicas}
+ \ ${replicas_str} BuiltIn.Set_Variable ${replicas_str}<replica>${replica}</replica>
+ &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix} REPLICAS=${replicas_str}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${CREATE_PREFIX_SHARD_DIR} mapping=${mapping} session=${session}
-Deconfigure_Id_Ints_Shard
- [Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke deconfigure-id-ints-shard rpc.
+Remove_Prefix_Shard
+ [Arguments] ${member_index} ${prefix}
+ [Documentation] Remove prefix based shard.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${DECONFIGURE_ID_INTS_SHARD_DIR} base_name=location extension=uri
- TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
+ &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${REMOVE_PREFIX_SHARD_DIR} mapping=${mapping} session=${session}
-Is_Client_Aborted
- [Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke is-client-aborted rpc.
+Become_Prefix_Leader
+ [Arguments] ${member_index} ${prefix}
+ [Documentation] Given node ask to become a shard leader.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${IS_CLIENT_ABORTED_SHARD_DIR} base_name=location extension=uri
- ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
+ &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${BECOME_PREFIX_LEADER_DIR} mapping=${mapping} session=${session}
Subscribe_Dtcl
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke subscribe-dtcl rpc.
+ [Documentation] Subscribe a listener for data changes. Invoke subscribe-dtcl rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${SUBSCRIBE_DTCL_DIR} base_name=location extension=uri
- TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
+ TemplatedRequests.Post_As_Xml_Templated ${SUBSCRIBE_DTCL_DIR} session=${session}
Unsubscribe_Dtcl
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke unsubscribe-dtcl rpc.
+ [Documentation] Unsubscribe a listener from the data changes. Invoke unsubscribe-dtcl rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNSUBSCRIBE_DTCL_DIR} base_name=location extension=uri
- ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
+ TemplatedRequests.Post_As_Xml_Templated ${UNSUBSCRIBE_DTCL_DIR} session=${session}
Subscribe_Ddtl
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke subscribe-ddtl rpc.
+ [Documentation] Subscribe DOMDataTreeListener to listen for the data changes.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${SUBSCRIBE_DDTL_DIR} base_name=location extension=uri
TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
Unsubscribe_Ddtl
[Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke unsubscribe-ddtl rpc.
+ [Documentation] Unsubscribe DOMDataTreeListener from listening to the data changes.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNSUBSCRIBE_DDTL_DIR} base_name=location extension=uri
${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
&{mapping} BuiltIn.Create_Dictionary CONTEXT=${context}
TemplatedRequests.Post_As_Xml_Templated ${UNREGISTER_BOUND_CONSTANT_DIR} mapping=${mapping} session=${session}
-
-Register_Default_Constant
- [Arguments] ${member_index} ${constant}
- [Documentation] TODO: more desctiptive comment than: Invoke register-default-constant rpc.
- ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- &{mapping} BuiltIn.Create_Dictionary CONSTANT=${constant}
- TemplatedRequests.Post_As_Xml_Templated ${REGISTER_DEFAULT_CONSTANT_DIR} mapping=${mapping} session=${session}
-
-Unregister_Default_Constant
- [Arguments] ${member_index}
- [Documentation] TODO: more desctiptive comment than: Invoke unregister-default-constant rpc.
- ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
- TemplatedRequests.Post_As_Xml_Templated ${REGISTER_DEFAULT_CONSTANT_DIR} session=${session}
"""
Python invocation of several parallel publish-notifications RPCs.
"""
+from robot.api import logger
import Queue
import requests
import string
import threading
-def publish_notifications(host, grprefix, duration, rate, nrpairs=1):
+_globals = {}
+
+
+def start_write_transactions_on_nodes(host_list, id_prefix, duration, rate, chained_flag=True):
"""Invoke publish notification rpcs and verify the response.
- :param host: ip address of odl node
- :type host: string
- :param grprefix: prefix identifier for publisher/listener pair
- :type grprefix: string
- :param duration: publishing notification duration in seconds
+ :param host_list: list of ip address of odl nodes
+ :type host_list: list of strings
+ :param id_prefix: identifier prefix
+ :type id_prefix: string
+ :param duration: time in seconds
:type duration: int
- :param rate: events rate per second
+ :param rate: writing transactions rate per second
:type rate: int
- :param nrpairs: number of publisher/listener pairs, id suffix is counted from it
- :type nrpairs: int
+ :param chained_flag: specify chained vs. simple transactions
+ :type chained_flag: bool
"""
- def _publ_notifications(rqueue, url, grid, duration, rate):
+ def _write_transactions(rqueue, url, grid, duration, rate, chained_flag):
dtmpl = string.Template('''<input xmlns="tag:opendaylight.org,2017:controller:yang:lowlevel:control">
<id>$ID</id>
<seconds>$DURATION</seconds>
- <notifications-per-second>$RATE</notifications-per-second>
+ <transactions-per-second>$RATE</transactions-per-second>
+ <chained-transactions>$CHAINED_FLAG</chained-transactions>
</input>''')
- data = dtmpl.substitute({'ID': grid, 'DURATION': duration, 'RATE': rate})
+ data = dtmpl.substitute({'ID': grid, 'DURATION': duration, 'RATE': rate, 'CHAINED_FLAG': chained_flag})
+ logger.info('write-transactions rpc indoked with details: {}'.format(data))
try:
resp = requests.post(url=url, headers={'Content-Type': 'application/xml'},
data=data, auth=('admin', 'admin'), timeout=int(duration)+60)
except Exception as exc:
resp = exc
+ logger.debug(exc)
rqueue.put(resp)
- resqueue = Queue.Queue()
- lthreads = []
- url = 'http://{}:8181/restconf/operations/odl-mdsal-lowlevel-control:publish-notifications'.format(host)
- for i in range(nrpairs):
- t = threading.Thread(target=_publ_notifications,
- args=(resqueue, url, '{}{}'.format(grprefix, i+1), duration, rate))
+ logger.info("Input parameters: host_list:{}, id_prefix:{}, duration:{}, rate:{}, chained_flag:{}".format(
+ host_list, id_prefix, duration, rate, chained_flag))
+ resqueue = _globals.pop('result_queue', Queue.Queue())
+ lthreads = _globals.pop('threads', [])
+ for i, host in enumerate(host_list):
+ url = 'http://{}:8181/restconf/operations/odl-mdsal-lowlevel-control:write-transactions'.format(host)
+ t = threading.Thread(target=_write_transactions,
+ args=(resqueue, url, '{}{}'.format(id_prefix, i), duration, rate, chained_flag))
t.daemon = True
t.start()
lthreads.append(t)
+ _globals.update({'threads': lthreads, 'result_queue': resqueue})
+
+
+def wait_for_write_transactions():
+ """Blocking call, waiting for responses from all threads."""
+ lthreads = _globals.pop('threads')
+ resqueue = _globals.pop('result_queue')
+
for t in lthreads:
t.join()
- for i in range(nrpairs):
- resp = resqueue.get()
- assert resp.status_code == 200
+ results = []
+ while not resqueue.empty():
+ results.append(resqueue.get())
+ logger.info(results)
+ return results
+
+
+def get_next_write_transactions_response():
+ """Get http response from write-transactions rpc if available."""
+ resqueue = _globals.get('result_queue')
+
+ if not resqueue.empty():
+ return resqueue.get()
+ return None
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Common keywords
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+Library ${CURDIR}/../MdsalLowlevelPy.py
+Resource ${CURDIR}/../ClusterAdmin.robot
+Resource ${CURDIR}/../ClusterManagement.robot
+Resource ${CURDIR}/../MdsalLowlevel.robot
+Resource ${CURDIR}/../TemplatedRequests.robot
+Resource ${CURDIR}/../WaitForFailure.robot
+
+*** Variables ***
+${SHARD_NAME} default
+${SHARD_TYPE} config
+${TRANSACTION_RATE_1K} ${1000}
+${DURATION_30S} ${30}
+${DURATION_10S} ${10}
+${ID_PREFIX} prefix-
+${TRANSACTION_TIMEOUT} ${30}
+${TRANSACTION_TIMEOUT_2X} ${2*${TRANSACTION_TIMEOUT}}
+${SIMPLE_TX} ${False}
+${CHAINED_TX} ${True}
+${HARD_TIMEOUT} ${60}
+@{TRANSACTION_FAILED} ${500}
+
+*** Keywords ***
+Explicit_Leader_Movement_Test_Templ
+ [Arguments] ${leader_from} ${leader_to} ${shard_name}=${SHARD_NAME} ${shard_type}=${SHARD_TYPE}
+ [Documentation] Implements explicit leader movement test scenario.
+ ${idx_from} ${idx_to} ${idx_trans} = Get_Node_Indexes_For_The_ELM_Test ${leader_from} ${leader_to}
+ ${ip_trans_as_list} = BuiltIn.Create_List ${ODL_SYSTEM_${idx_trans}_IP}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${ip_trans_as_list} ${ID_PREFIX} ${DURATION_30S} ${TRANSACTION_RATE_1K} chained_flag=${False}
+ ClusterAdmin.Make_Leader_Local ${idx_to} ${shard_name} ${shard_type}
+ ${new_leader} ${new_followers} = BuiltIn.Wait_Until_Keyword_Succeeds 10s 1s ClusterManagement.Verify_Shard_Leader_Elected ${shard_name}
+ ... ${shard_type} ${True} ${idx_from}
+ BuiltIn.Should_Be_Equal ${idx_to} ${new_leader}
+ ${resp_list} = MdsalLowlevelPy.Wait_For_Write_Transactions
+ TemplatedRequests.Check_Status_Code @{resp_list}[0]
+
+Get_Node_Indexes_For_The_ELM_Test
+ [Arguments] ${leader_from} ${leader_to}
+ [Documentation] Return indexes for explicit leader movement test case, indexes of present to next leader node and index where transaction
+ ... producer should be deployed.
+ ${leader} ${follower_list} = ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${SHARD_NAME} shard_type=${SHARD_TYPE}
+ ${idx_from} = BuiltIn.Set_Variable ${leader}
+ ${idx_to} = BuiltIn.Set_Variable @{follower_list}[0]
+ ${idx_trans} = BuiltIn.Set_Variable_If "${leader_from}" == "remote" and "${leader_to}" == "remote" @{follower_list}[1] "${leader_from}" == "local" ${leader} "${leader_to}" == "local"
+ ... @{follower_list}[0]
+ BuiltIn.Return_From_Keyword ${idx_from} ${idx_to} ${idx_trans}
+
+Clean_Leader_Shutdown_Test_Templ
+ [Arguments] ${leader_location} ${shard_name}=${SHARD_NAME} ${shard_type}=${SHARD_TYPE}
+ [Documentation] Implements clean leader shutdown test scenario.
+ ${removed} = BuiltIn.Set_Variable ${False}
+ ${producer_idx} ${actual_leader} = Get_Node_Indexes_For_Clean_Leader_Shutdown_Test ${leader_location}
+ ${producer_ip_as_list} = BuiltIn.Create_List ${ODL_SYSTEM_${producer_idx}_IP}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${producer_ip_as_list} ${ID_PREFIX} ${DURATION_30S} ${TRANSACTION_RATE_1K} chained_flag=${False}
+ ClusterAdmin.Remove_Shard_Replica ${actual_leader} ${shard_name} member-${actual_leader} ${shard_type}
+ ${removed} = BuiltIn.Set_Variable ${True}
+ ${resp_list} = MdsalLowlevelPy.Wait_For_Write_Transactions
+ TemplatedRequests.Check_Status_Code @{resp_list}[0]
+ [Teardown] ClusterAdmin.Add_Shard_Replica ${actual_leader} ${shard_name} ${shard_type}
+
+Get_Node_Indexes_For_Clean_Leader_Shutdown_Test
+ [Arguments] ${leader_location}
+ [Documentation] Return indexes for clean leader shudown test case, index where transaction producer shoudl be deployed and a shard leader index.
+ ${leader} ${follower_list} = ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${SHARD_NAME} shard_type=${SHARD_TYPE}
+ ${follower_list_leangth} = BuiltIn.Evaluate ${NUM_ODL_SYSTEM}-1
+ BuiltIn.Length_Should_Be ${follower_list} ${follower_list_leangth}
+ ${producer_idx} = BuiltIn.Set_Variable_If "${leader_location}" == "local" ${leader} @{follower_list}[0]
+ BuiltIn.Return_From_Keyword ${producer_idx} ${leader}
+
+Leader_Isolation_Test_Templ
+ [Arguments] ${heal_timeout}
+ [Documentation] Implements leader isolation test scenario.
+ ${producing_transactions_time} = BuiltIn.Set_Variable ${${heal_timeout}+60}
+ ${all_indices} = ClusterManagement.List_All_Indices
+ ${leader} ${follower_list} = ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${SHARD_NAME} shard_type=${SHARD_TYPE} member_index_list=${all_indices}
+ ${all_ip_list} = ClusterManagement.Resolve_IP_Address_For_Members ${all_indices}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${all_ip_list} ${ID_PREFIX} ${producing_transactions_time} ${TRANSACTION_RATE_1K} chained_flag=${SIMPLE_TX}
+ ${date_start} = DateTime.Get_Current_Date
+ ${date_end} = DateTime.Add_Time_To_Date ${date_start} ${producing_transactions_time}
+ ClusterManagement.Isolate_Member_From_List_Or_All ${leader}
+ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s ClusterManagement.Verify_Shard_Leader_Elected ${SHARD_NAME} ${SHARD_TYPE} ${True}
+ ... ${leader} member_index_list=${follower_list}
+ BuiltIn.Sleep ${heal_timeout}
+ ClusterManagement.Rejoin_Member_From_List_Or_All ${leader}
+ BuiltIn.Wait_Until_Keyword_Succeeds 20s 2s ClusterManagement.Get_Leader_And_Followers_For_Shard ${SHARD_NAME} ${SHARD_TYPE}
+ ${time_to_finish} = Get_Seconds_To_Time ${date_end}
+ BuiltIn.Run_Keyword_If ${heal_timeout} < ${TRANSACTION_TIMEOUT} Leader_Isolation_Heal_Within_Tt
+ ... ELSE Leader_Isolation_Heal_Default ${time_to_finish}
+
+Leader_Isolation_Heal_Within_Tt
+ [Documentation] The leader isolation test case end if the heal happens within transaction timeout. All write transaction
+ ... producers shoudl finish without error.
+ ${resp_list} = MdsalLowlevelPy.Wait_For_Write_Transactions
+ : FOR ${resp} IN @{resp_list}
+ \ TemplatedRequests.Check_Status_Code ${resp}
+
+Leader_Isolation_Heal_Default
+ [Arguments] ${isolated_node} ${time_to_finish}
+ [Documentation] The leader isolation test case end. The transaction producer on isolated node shoudl fail and should be restarted.
+ Then all write transaction producers shoudl finish without error.
+ ${resp} = MdsalLowlevelPy.Get_Next_Write_Transactions_Response
+ BuiltIn.Log ${resp}
+ ${restart_producer_node} BuiltIn.Create_List ${isolated_node}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${restart_producer_node} ${ID_PREFIX} ${time_to_finish} ${TRANSACTION_RATE_1K} chained_flag=${SIMPLE_TX}
+ ${resp_list} = MdsalLowlevelPy.Wait_For_Write_Transactions
+ : FOR ${resp} IN @{resp_list}
+ \ TemplatedRequests.Check_Status_Code ${resp}
+
+Client_Isolation_Test_Templ
+ [Arguments] ${listener_node_role} ${trans_chain_flag} ${shard_name}=${SHARD_NAME} ${shard_type}=${SHARD_TYPE}
+ [Documentation] Implements client isolation test scenario.
+ ${all_indices} = ClusterManagement.List_All_Indices
+ ${leader} ${follower_list} = ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} member_index_list=${all_indices}
+ ${follower1} = Collections.Get_From_List ${follower_list} ${0}
+ ${client_node_dst} = BuiltIn.Set_Variable_If "${listener_node_role}" == "leader" ${leader} ${follower1}
+ ${client_node_ip} = ClusterManagement.Resolve_IP_Address_For_Member ${client_node_dst}
+ ${client_node_ip_as_list} BuiltIn.Create_List ${client_node_ip}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${client_node_ip_as_list} ${ID_PREFIX} ${DURATION_30S} ${TRANSACTION_RATE_1K} chained_flag=${trans_chain_flag}
+ ${start_date} DateTime.Get_Current_Date
+ ${timeout_date} = DateTime.Add_Time_To_Date ${start_date} ${TRANSACTION_TIMEOUT}
+ ${abort_date} = DateTime.Add_Time_To_Date ${start_date} ${HARD_TIMEOUT}
+ ClusterManagement.Isolate_Member_From_List_Or_All ${client_node_dst}
+ WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout ${TRANSACTION_TIMEOUT} 1s Write_Transactions_Not_Failed_Yet
+ WaitForFailure.Confirm_Keyword_Fails_Within_Timeout 3s 1s Write_Transactions_Failed
+ ${abort_time} Get_Seconds_To_Time ${abort_date}
+ WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout ${abort_time} 1s Verify_Client_Aborted ${False}
+ WaitForFailure.Confirm_Keyword_Fails_Within_Timeout 3s 1s Verify_Client_Aborted ${True}
+ [Teardown] BuiltIn.Run Keywords ClusterManagement.Rejoin_Member_From_List_Or_All ${client_node_dst}
+ ... AND MdsalLowlevelPy.Wait_For_Write_Transactions
+
+Write_Transactions_Not_Failed_Yet
+ [Documentation] Verify that no write-transaction rpc finished, means they are still running.
+ ${resp} = MdsalLowlevelPy.Get_Next_Write_Transactions_Response
+ BuiltIn.Should_Be_Equal ${None} ${resp} ${resp} not expected.
+
+Write_Transactions_Failed
+ [Documentation] Verify if write-transaction failed.
+ ${resp} = MdsalLowlevelPy.Get_Next_Write_Transactions_Response
+ Check_Status_Code ${resp} explicit_status_codes=${TRANSACTION_FAILED}
+
+Verify_Client_Aborted
+ [Arguments] ${exp_aborted}
+ [Documentation] To be reworked
+ BuiltIn.Fail TODO: Logic to be reworked
+
+Get_Seconds_To_Time
+ [Arguments] ${date_in_future}
+ [Documentation] Return number of seconds remaining to ${date_in_future}.
+ ${date_now} = DateTime.Get_Current_Date
+ ${duration} = DateTime.Subtract_Date_From_Date ${date_in_future} ${date_now}
+ BuiltIn.Run_Keyword_And_Return BuiltIn.Convert_To_Integer ${duration}
+
+Remote_Listener_Test_Templ
+ [Arguments] ${listener_node_role} ${shard_name}=${SHARD_NAME} ${shard_type}=${SHARD_TYPE}
+ [Documentation] Implements remote listener test scenario.
+ ${all_indices} = ClusterManagement.List_All_Indices
+ ${leader} ${follower_list} = ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} member_index_list=${all_indices}
+ ${follower1} = Collections.Get_From_List ${follower_list} ${0}
+ ${follower2} = Collections.Get_From_List ${follower_list} ${1}
+ ${listener_node_dst} = BuiltIn.Set_Variable_If "${listener_node_role}" == "leader" ${leader} ${follower1}
+ MdsalLowlevel.Subscribe_Dtcl ${listener_node_dst}
+ ${all_ip_list} = ClusterManagement.Resolve_IP_Address_For_Members ${all_indices}
+ MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${all_ip_list} ${ID_PREFIX} ${DURATION_10S} ${TRANSACTION_RATE_1K} chained_flag=${SIMPLE_TX}
+ ClusterAdmin.Make_Leader_Local ${follower1} ${shard_name} ${shard_type}
+ ${resp_list} = MdsalLowlevelPy.Wait_For_Write_Transactions
+ : FOR ${resp} IN @{resp_list}
+ \ TemplatedRequests.Check_Status_Code ${resp}
+ [Teardown] MdsalLowlevel.Unsubscribe_Dtcl ${listener_node_dst}
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Clean Leader Shutdown
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... The goal is to ensure that applications do not observe disruption when a shard
+... leader is shut down cleanly. This is performed by having a steady-stream
+... producer execute operations against the shard and then initiate leader shard
+... shutdown, then the producer is shut down cleanly.
+Suite Setup SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Teardown SSHLibrary.Close_All_Connections
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags critical
+Test Template DdbCommons.Clean_Leader_Shutdown_Test_Templ
+Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/controller/DdbCommons.robot
+Resource ${CURDIR}/../../../libraries/SetupUtils.robot
+
+*** Test Cases ***
+Local_Leader_Shutdown
+ [Documentation] Shutdown the leader on the same node as transaction producer.
+ local
+
+Remote_Leader_Shutdown
+ [Documentation] Shutdown the leader on different node as transaction producer.
+ remote
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Client Isolation
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... The purpose of this test is to ascertain that the failure modes of
+... cds-access-client work as expected. This is performed by having a steady
+... stream of transactions flowing from the frontend and isolating the node hosting
+... the frontend from the rest of the cluster.
+Suite Setup SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Teardown SSHLibrary.Close_All_Connections
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags critical
+Test Template DdbCommons.Client_Isolation_Test_Templ
+Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/controller/DdbCommons.robot
+Resource ${CURDIR}/../../../libraries/SetupUtils.robot
+
+*** Test Cases ***
+Producer_On_Shard_Leader_Node_ChainedTx
+ [Documentation] Client isolation with producer on shard leader with chained transactions.
+ leader ${CHAINED_TX}
+
+Producer_On_Shard_Leader_Node_SimpleTx
+ [Documentation] Client isolation with producer on shard leader with simple transactions.
+ leader ${SIMPLE_TX}
+
+Producer_On_Shard_Non_Leader_Node_ChainedTx
+ [Documentation] Client isolation with producer on shard non-leader with chained transactions.
+ non-leader ${CHAINED_TX}
+
+Producer_On_Shard_Non_Leader_Node_SimpleTx
+ [Documentation] Client isolation with producer on shard non-leader with simple transactions.
+ non-leader ${SIMPLE_TX}
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Explicit Leader Movement
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... The goal is to ensure that applications do not observe disruption when a shard
+... leader is moved as the result of explicit application request. This is performed
+... by having a steady-stream producer execute operations against the shard and then
+... initiate shard leader shutdown, then the producer is shut down cleanly.
+Suite Setup SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Teardown SSHLibrary.Close_All_Connections
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags critical
+Test Template DdbCommons.Explicit_Leader_Movement_Test_Templ
+Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/controller/DdbCommons.robot
+Resource ${CURDIR}/../../../libraries/SetupUtils.robot
+
+*** Test Cases ***
+Local_To_Remote_Movement
+ [Documentation] Leader moves from local to remote node during transaction producing.
+ local remote
+
+Remote_To_Remote_Movement
+ [Documentation] Leader moves from one remote to other remote node during transaction producing.
+ remote remote
+
+Remote_To_Local_Movement
+ [Documentation] Leader moves from remote to local node during transaction producing.
+ remote local
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Leader Isolation
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... The goal is to ensure the datastore succeeds in basic isolation/rejoin scenario,
+... simulating either a network partition, or a prolonged GC pause.
+Suite Setup SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Teardown SSHLibrary.Close_All_Connections
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags critical
+Test Template DdbCommons.Leader_Isolation_Test_Templ
+Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/controller/DdbCommons.robot
+Resource ${CURDIR}/../../../libraries/SetupUtils.robot
+
+*** Test Cases ***
+Healing_Within_Transaction_Timeout
+ [Documentation] The isolated node (leader) is rejoined as soon as new leader is elected and
+ ... and within transaction timeout.
+ ${0}
+
+Healing_After_2x_Transaction_Timeout
+ [Documentation] The isolated node (leader) is rejoined after 2x transaction timeout.
+ ${${TRANSACTION_TIMEOUT_2X}+1}
--- /dev/null
+*** Settings ***
+Documentation DOMDataBroker testing: Remote Listener
+...
+... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+... This program and the accompanying materials are made available under the
+... terms of the Eclipse Public License v1.0 which accompanies this distribution,
+... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... The goal is to ensure listeners do no observe disruption when the leader moves.
+... This is performed by having a steady stream of transactions being observed by
+... the listeners and having the leader move.
+Suite Setup SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Teardown SSHLibrary.Close_All_Connections
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+Default Tags critical
+Test Template DdbCommons.Remote_Listener_Test_Templ
+Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/controller/DdbCommons.robot
+Resource ${CURDIR}/../../../libraries/SetupUtils.robot
+
+*** Test Cases ***
+Listener_On_Shard_Leader_Node
+ [Documentation] Listener runs on leader node when leader changed.
+ leader
+
+Listener_On_Shard_Non_Leader_Node
+ [Documentation] Listener runs on non-leader node when leader changed.
+ non-leader
--- /dev/null
+/restconf/operations/cluster-admin:add-prefix-shard-replica
--- /dev/null
+<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin">
+ <shard-prefix>$SHARD_PREFIX</shard-prefix>
+ <data-store-type>$DATA_STORE_TYPE</data-store-type>
+</input>
+
--- /dev/null
+/restconf/operations/cluster-admin:add-shard-replica
--- /dev/null
+<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin">
+ <shard-name>$SHARD_NAME</shard-name>
+ <data-store-type>$DATA_STORE_TYPE</data-store-type>
+</input>
+
--- /dev/null
+/restconf/operations/cluster-admin:make-leader-local
--- /dev/null
+<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin">
+ <shard-name>$SHARD_NAME</shard-name>
+ <data-store-type>$SHARD_TYPE</data-store-type>
+</input>
--- /dev/null
+/restconf/operations/cluster-admin:remove-prefix-shard-replica
--- /dev/null
+<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin">
+ <shard-prefix>$SHARD_PREFIX</shard-prefix>
+ <member-name>$MEMBER_NAME</member-name>
+ <data-store-type>$DATA_STORE_TYPE</data-store-type>
+</input>
+
--- /dev/null
+/restconf/operations/cluster-admin:remove-shard-replica
--- /dev/null
+<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin">
+ <shard-name>$SHARD_NAME</shard-name>
+ <member-name>$MEMBER_NAME</member-name>
+ <data-store-type>$DATA_STORE_TYPE</data-store-type>
+</input>
+
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:add-shard-replica
\ No newline at end of file
+++ /dev/null
-<input>
- <shard-name>$SHARD_NAME</shard-name>
-</input>
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:become-module-leader
\ No newline at end of file
+++ /dev/null
-<input>
- <shard-name>$NAME</shard-name>
-</input>
-<input>
- <shard-name>$NAME</shard-name>
+<input xmlns="tag:opendaylight.org,2017:controller:yang:lowlevel:control">
+ <prefix>$PREFIX</prefix>
</input>
--- /dev/null
+/restconf/operations/odl-mdsal-lowlevel-control:add-prefix-shard
--- /dev/null
+<input xmlns="tag:opendaylight.org,2017:controller:yang:lowlevel:control">
+ <prefix>$PREFIX</prefix>
+ $REPLICAS
+</input>
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:deconfigure-id-ints-shard
\ No newline at end of file
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:is-client-aborted
\ No newline at end of file
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:register-default-constant
\ No newline at end of file
--- /dev/null
+/restconf/operations/odl-mdsal-lowlevel-control:become-prefix-leader
\ No newline at end of file
--- /dev/null
+<input xmlns="tag:opendaylight.org,2017:controller:yang:lowlevel:control">
+ <prefix>$PREFIX</prefix>
+</input>
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:remove-shard-replica
\ No newline at end of file
+++ /dev/null
-/restconf/operations/odl-mdsal-lowlevel-control:unregister-default-constant
\ No newline at end of file
-<input>
- <seconds>$SECONDS</seconds>
- <transactions-per-second>$TPS</transactions-per-second>
- <chained-transactions>$CHAINED_TRANSACTIONS</chained-transactions>
+<input xmlns="tag:opendaylight.org,2017:controller:yang:lowlevel:control">
+ <id>$ID</id>
+ <seconds>$DURATION</seconds>
+ <transactions-per-second>$RATE</transactions-per-second>
+ <chained-transactions>$CHAINED_FLAG</chained-transactions>
</input>