From e0301aebf13f08cdb03414f5aa646856f0ad0030 Mon Sep 17 00:00:00 2001
From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
Date: Fri, 23 Jun 2023 10:32:50 +0200
Subject: [PATCH] Fix for f_CSE_ANNC_CRE_002, reordering expected messages

---
 OneM2M_PermutationFunctions.ttcn | 42 ++++++++++++++++----------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn
index 4422099..a0bebce 100644
--- a/OneM2M_PermutationFunctions.ttcn
+++ b/OneM2M_PermutationFunctions.ttcn
@@ -10353,32 +10353,13 @@ module OneM2M_PermutationFunctions {
 					vc_ae1.start(f_cse_updateResource(p_resourceType, v_resourceIndex, p_updateRequest, -));
 					
 					
-					//IUT should first create CSEBaseAnnc at the announcement target, and then, IUT announces the resource on the remoteCSEAnnc resource
+					//IUT should first create CSEBaseAnnc at the announcement target, and then, IUT announces the resource on the CSEBaseAnnc resource
 					//p_createRequestAnnc.to_ := PX_TS_CSE1.cseId;
 					vc_cse2.start(f_cse_announcementProcedure_createHandler(p_createRequestAnnc));
 							
 					tc_ac.start;
 					alt {
-						[] mccPortIn.receive(mw_request(mw_createAnnc(-, PX_TS_CSE2.cseId))) -> value vc_request {
-							tc_ac.stop;
-							setverdict(pass, __SCOPE__ & ":INFO: Expected Announcement received");
-							
-							mccPortInternal.send(vc_request.primitive.requestPrimitive);
-							alt {
-								[]mccPortInternal.receive(mw_responsePrimitive(?)) -> value v_response {
-								}
-							}
-							f_send(e_mccPortIn, m_response(v_response));
-							
-							 //Retrieve the CSEBaseAnnc resource index
-							if(v_response.responseStatusCode == int2001) {
-								tc_ac.start;
-								repeat;
-							} else {
-								setverdict(fail, __SCOPE__ & ":ERROR: CSEBaseAnnc not created");
-							}
-						}
-						[] mccPortIn.receive(mw_request(mw_createAnnc)) -> value vc_request {
+						[] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 							if(f_getTargetCseId(vc_request.primitive.requestPrimitive.to_) ==  PX_TS_CSE2.cseId) {
@@ -10398,6 +10379,25 @@ module OneM2M_PermutationFunctions {
 								setverdict(fail, __SCOPE__ & ":ERROR: Wrong target resource address");
 							}	
 						}
+						[] mccPortIn.receive(mw_request(mw_createAnnc(-, pattern "{PX_TS_CSE2.cseId}*"))) -> value vc_request {
+							tc_ac.stop;
+							setverdict(pass, __SCOPE__ & ":INFO: Expected Announcement received");
+							
+							mccPortInternal.send(vc_request.primitive.requestPrimitive);
+							alt {
+								[]mccPortInternal.receive(mw_responsePrimitive(?)) -> value v_response {
+								}
+							}
+							f_send(e_mccPortIn, m_response(v_response));
+							
+							 //Retrieve the CSEBaseAnnc resource index
+							if(v_response.responseStatusCode == int2001) {
+								tc_ac.start;
+								repeat;
+							} else {
+								setverdict(fail, __SCOPE__ & ":ERROR: CSEBaseAnnc not created");
+							}
+						}
 						[] tc_ac.timeout {
 							setverdict(fail, __SCOPE__ & ":ERROR:  No announcement received");
 						}
-- 
GitLab