${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
-${PUBLISH_NOTIFICATIONS_DIR} ${RPC_DIR}/publish_notifications
${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
${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}
-Publish_Notifications
+Start_Publish_Notifications
[Arguments] ${member_index} ${gid} ${seconds} ${notif_per_sec}
- [Documentation] Start publishing notifications by invoking publish-notifications rpc. This call is blocking
- ... and it returns when publishing is over. It suppose to take as long as ${seconds}.
+ [Documentation] Start publishing notifications by invoking publish-notifications rpc.
${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
&{mapping} BuiltIn.Create_Dictionary ID=${gid} DURATION=${seconds} RATE=${notif_per_sec}
- TemplatedRequests.Post_As_Xml_Templated ${PUBLISH_NOTIFICATIONS_DIR} mapping=${mapping} session=${session}
+ TemplatedRequests.Post_As_Xml_Templated ${START_PUBLISH_NOTIFICATIONS_DIR} mapping=${mapping} session=${session}
+
+Check_Publish_Notifications
+ [Arguments] ${member_index} ${gid}
+ [Documentation] Publishing notifications check by invoking check-publish-notifications rpc. Return publising process state details.
+ ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
+ &{mapping} BuiltIn.Create_Dictionary ID=${gid}
+ ${text} = TemplatedRequests.Post_As_Xml_Templated ${CHECK_PUBLISH_NOTIFICATIONS_DIR} mapping=${mapping} session=${session}
+ ${xml} = XML.Parse_Xml ${text}
+ ${active} = XML.Get_Element_Text ${xml} xpath=active
+ ${active} = BuiltIn.Convert_To_Boolean ${active}
+ ${status} ${publish_count}= BuiltIn.Run_Keyword_And_Ignore_Error XML.Get_Element_Text ${xml} xpath=publish-count
+ BuiltIn.Run_Keyword_If """${status}""" == """FAIL""" and """${publish_count}""" != """No element matching 'publish-count' found.""" BuiltIn.Fail ${publish_count}
+ ${publish_count} BuiltIn.Set_Variable_If """${status}""" == """FAIL""" ${EMPTY} ${publish_count}
+ ${status} ${last_error}= BuiltIn.Run_Keyword_And_Ignore_Error XML.Get_Element_Text ${xml} xpath=last-error
+ BuiltIn.Run_Keyword_If """${status}""" == """FAIL""" and """${last_error}""" != """No element matching 'last-error' found.""" BuiltIn.Fail ${last_error}
+ ${last_error} BuiltIn.Set_Variable_If """${status}""" == """FAIL""" ${EMPTY} ${last_error}
+ BuiltIn.Return_From_Keyword ${active} ${publish_count} ${last_error}
Subscribe_Ynl
[Arguments] ${member_index} ${gid}
... 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
+Library Collections
Resource ${CURDIR}/../MdsalLowlevel.robot
+Resource ${CURDIR}/../ScalarClosures.robot
+Resource ${CURDIR}/../WaitUtils.robot
*** Variables ***
${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} ${5000}
... The test case itself firstly subscribe listeners, then run publishers and at the end unsubscribe listeners
... and check achieved rates.
BuiltIn.Log Overall requested rate: ${total_notification_rate}, test duration: ${test_duration_in_seconds} seconds.
+ WaitUtils.WU_Setup
${count} = BuiltIn.Set_variable ${0}
: FOR ${suffix} IN RANGE ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} ${total_notification_rate}+1 ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE}
\ ${count} = BuiltIn.Evaluate ${count}+1
\ MdsalLowlevel.Subscribe_Ynl ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${count}
${count} = BuiltIn.Convert_To_Integer ${count}
- MdsalLowlevelPy.Publish_Notifications ${ODL_SYSTEM_${DNB_TESTED_MEMBER_INDEX}_IP} ${DNB_PUBLISHER_LISTENER_PREFIX} ${test_duration_in_seconds} ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} nrpairs=${count}
+ : FOR ${index} IN RANGE 1 ${count}+1
+ \ MdsalLowlevel.Start_Publish_Notifications ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${index} ${test_duration_in_seconds} ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE}
+ ${getter} = ScalarClosures.Closure_From_Keyword_And_Arguments Get_Notifications_Active_Status ${DNB_TESTED_MEMBER_INDEX} ${count}
+ ${validator} = ScalarClosures.Closure_From_Keyword_And_Arguments Check_Notifications_Active_Status data_holder
+ ${validation_timeout} = BuiltIn.Evaluate ${test_duration_in_seconds}+${60}
+ WaitUtils.Wait_For_Getter_Failure_Or_Stateless_Validator_Pass timeout=${validation_timeout} period=15s getter=${getter} stateless_validator=${validator}
${sum_local_number} BuiltIn.Set_Variable ${0}
${low_limit_pair_rate} = BuiltIn.Evaluate 0.9*${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE}
${high_limit_pair_rate} = BuiltIn.Evaluate 1.1*${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE}
${high_limit_final_rate} = BuiltIn.Evaluate 1.1*${total_notification_rate}
BuiltIn.Should_Be_True ${final_rate} > ${low_limit_final_rate}
BuiltIn.Should_Be_True ${final_rate} < ${high_limit_final_rate}
+
+Get_Notifications_Active_Status
+ [Arguments] ${node_to_ask} ${nr_pairs}
+ ${active_list} = BuiltIn.Create_List
+ : FOR ${index} IN RANGE 1 ${nr_pairs}+1
+ \ ${active} ${publ_count} ${last_error} MdsalLowlevel.Check_Publish_Notifications ${node_to_ask} ${DNB_PUBLISHER_LISTENER_PREFIX}${index}
+ \ Collections.Append_To_List ${active_list} ${active}
+ \ BuiltIn.Should_Be_Equal ${EMPTY} ${last_error}
+ BuiltIn.Return_From_Keyword ${active_list}
+
+Check_Notifications_Active_Status
+ [Arguments] ${active_list}
+ : FOR ${active} IN @{active_list}
+ \ BuiltIn.Should_Be_Equal ${False} ${active}