|
From: Thien H. <thi...@en...> - 2026-04-14 10:51:29
|
---
src/mds/apitest/mdstipc_api.c | 171 ++++++++++++++++++++++++++++++++++
1 file changed, 171 insertions(+)
diff --git a/src/mds/apitest/mdstipc_api.c b/src/mds/apitest/mdstipc_api.c
index dbfa00f05..505b3a2ad 100644
--- a/src/mds/apitest/mdstipc_api.c
+++ b/src/mds/apitest/mdstipc_api.c
@@ -2628,6 +2628,171 @@ void tet_svc_subscr_VDEST_14() {
}
}
+void tet_svc_subscr_VDEST_16(void)
+{
+ int FAIL = 0;
+ MDS_SVC_ID svc_id_inthd[] = {NCSMDS_SVC_ID_INTERNAL_MIN};
+ char tmp[] = " Hi Receiver ";
+ TET_MDS_MSG *mesg;
+
+ mesg = (TET_MDS_MSG *)malloc(sizeof(TET_MDS_MSG));
+ memset(mesg, 0, sizeof(TET_MDS_MSG));
+ memcpy(mesg->send_data, tmp, sizeof(tmp));
+ mesg->send_len = sizeof(tmp);
+
+ if (tet_initialise_setup(false)) {
+ printf("\nSetup Initialisation has Failed\n");
+ FAIL = 1;
+ } else {
+ printf("\nTest Case 16: Explicit subscribe replays the"
+ " active UP version after implicit subscription\n");
+
+ printf("\nAction: Create the implicit subscription by"
+ " sending to INTMIN on the active vdest\n");
+ if (mds_just_send(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SVC_ID_INTERNAL_MIN, gl_tet_vdest[1].vdest,
+ MDS_SEND_PRIORITY_LOW, mesg) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Convert the implicit subscription to"
+ " explicit\n");
+ if (mds_service_subscribe(gl_tet_adest.mds_pwe1_hdl,
+ NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SCOPE_NONE, 1,
+ svc_id_inthd) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Retrieve the replayed UP event\n");
+ if (wait_adest_sel_obj(NCSMDS_SVC_ID_EXTERNAL_MIN, 10)) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+ if (mds_service_retrieve(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ SA_DISPATCH_ONE) != NCSCC_RC_SUCCESS) {
+ printf("\nRetrieve fail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Verify the replayed UP version\n");
+ if (tet_verify_version(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SVC_ID_INTERNAL_MIN, 1, NCSMDS_UP) != 1) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Cancel the explicit subscription\n");
+ if (mds_service_cancel_subscription(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ 1, svc_id_inthd) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+ }
+
+ if (tet_cleanup_setup()) {
+ printf("\nSetup Clean Up has Failed\n");
+ FAIL = 1;
+ }
+
+ free(mesg);
+ test_validate(FAIL, 0);
+}
+
+void tet_svc_subscr_VDEST_17(void)
+{
+ int FAIL = 0;
+ MDS_SVC_ID svc_id_inthd[] = {NCSMDS_SVC_ID_INTERNAL_MIN};
+ char tmp[] = " Hi Receiver ";
+ TET_MDS_MSG *mesg;
+
+ mesg = (TET_MDS_MSG *)malloc(sizeof(TET_MDS_MSG));
+ memset(mesg, 0, sizeof(TET_MDS_MSG));
+ memcpy(mesg->send_data, tmp, sizeof(tmp));
+ mesg->send_len = sizeof(tmp);
+
+ if (tet_initialise_setup(false)) {
+ printf("\nSetup Initialisation has Failed\n");
+ FAIL = 1;
+ } else {
+ printf("\nTest Case 17: Explicit subscribe replays the"
+ " last-active NO_ACTIVE version after implicit"
+ " subscription\n");
+
+ printf("\nAction: Create the implicit subscription by"
+ " sending to INTMIN on the active vdest\n");
+ if (mds_just_send(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SVC_ID_INTERNAL_MIN, gl_tet_vdest[1].vdest,
+ MDS_SEND_PRIORITY_LOW, mesg) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Change the active vdest to standby\n");
+ if (vdest_change_role(200, V_DEST_RL_STANDBY) !=
+ NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ sleep(1);
+
+ printf("\nAction: Convert the implicit subscription to"
+ " explicit while await-active is running\n");
+ if (mds_service_subscribe(gl_tet_adest.mds_pwe1_hdl,
+ NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SCOPE_NONE, 1,
+ svc_id_inthd) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Retrieve the replayed NO_ACTIVE event\n");
+ if (wait_adest_sel_obj(NCSMDS_SVC_ID_EXTERNAL_MIN, 10)) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+ if (mds_service_retrieve(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ SA_DISPATCH_ONE) != NCSCC_RC_SUCCESS) {
+ printf("\nRetrieve fail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Verify the replayed NO_ACTIVE version\n");
+ if (tet_verify_version(gl_tet_adest.mds_pwe1_hdl,
+ NCSMDS_SVC_ID_EXTERNAL_MIN,
+ NCSMDS_SVC_ID_INTERNAL_MIN, 1,
+ NCSMDS_NO_ACTIVE) != 1) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+
+ printf("\nAction: Cancel the explicit subscription\n");
+ if (mds_service_cancel_subscription(
+ gl_tet_adest.mds_pwe1_hdl, NCSMDS_SVC_ID_EXTERNAL_MIN,
+ 1, svc_id_inthd) != NCSCC_RC_SUCCESS) {
+ printf("\nFail\n");
+ FAIL = 1;
+ }
+ }
+
+ if (tet_cleanup_setup()) {
+ printf("\nSetup Clean Up has Failed\n");
+ FAIL = 1;
+ }
+
+ free(mesg);
+ test_validate(FAIL, 0);
+}
+
void tet_adest_cancel_thread()
{
MDS_SVC_ID svcids[] = {600, 700};
@@ -15095,6 +15260,12 @@ __attribute__((constructor)) static void mdsTipcAPI_constructor(void)
test_case_add(
4, tet_svc_subscr_VDEST_14,
"Conflict nway active vdests");
+ test_case_add(4, tet_svc_subscr_VDEST_16,
+ "Explicit subscribe replay sends UP with the current "
+ "active version after an implicit subscription");
+ test_case_add(4, tet_svc_subscr_VDEST_17,
+ "Explicit subscribe replay sends NO_ACTIVE with the "
+ "last active version while await-active is running");
test_suite_add(5, "Subscribe ADEST");
test_case_add(
--
2.34.1
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Any opinions expressed are mine and do not necessarily represent the opinions of the Company. Emails are susceptible to interference. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is strictly prohibited and may be unlawful. If you have received this message in error, do not open any attachments but please notify the Endava Service Desk on (+44 (0)870 423 0187), and delete this message from your system. The sender accepts no responsibility for information, errors or omissions in this email, or for its use or misuse, or for any act committed or omitted in connection with this communication. If in doubt, please verify the authenticity of the contents with the sender. Please rely on your own virus checkers as no responsibility is taken by the sender for any damage rising out of any bug or virus infection.
Endava plc is a company registered in England under company number 5722669 whose registered office is at 125 Old Broad Street, London, EC2N 1AR, United Kingdom. Endava plc is the Endava group holding company and does not provide any services to clients. Each of Endava plc and its subsidiaries is a separate legal entity and has no liability for another such entity's acts or omissions.
|