diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e94dd351ca885e6100357c6893c400eb2185078f..0000000000000000000000000000000000000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.project -/.classpath -/ttcn3build/ diff --git a/.settings/.gitignore b/.settings/.gitignore deleted file mode 100644 index 22d458a52a6ecad6b4bea6bfc0f74ff783b9979b..0000000000000000000000000000000000000000 --- a/.settings/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/com.testingtech.ttworkbench.core.prefs diff --git a/LibCommon/LibCommon_Sync.ttcn b/LibCommon/LibCommon_Sync.ttcn deleted file mode 100644 index 38e29df924fe40e808448a50008ad62ccc765d27..0000000000000000000000000000000000000000 --- a/LibCommon/LibCommon_Sync.ttcn +++ /dev/null @@ -1,1358 +0,0 @@ -/** - * @author ETSI - * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Sync.ttcn $ - * $Id: LibCommon_Sync.ttcn 66 2017-03-06 09:59:41Z filatov $ - * @desc This module implements _one_ generic synchronization mechanism - * for TTCN-3 test cases with one or more test components. - * Key concept is here that one test component acts as a - * synchronization server which listens and triggers one or more - * synchronization clients. It is recomended to use the MTC always as - * the synchronization server but in theory also a PTC can act as such - * a server.<br><br> - * This synchronization is used by calling a function on - * the server test component to wait for a desired amount of clients - * to notify the server that they have reached a specific synchronization - * point. Each client test component must call another - * function to perform this notification.<br><br> - * In the event that a client is not able to reach a synchronization - * point the server sends out a signal to all clients to abort the - * test case. This signal is a STOP message which can be caught by - * a test component default which in turn can then run a proper - * shut down behavior based on the current state of the test - * component. <br><br> - * Note that this synchronization mechanism can also be used - * in a special mode called "self synchronization" when a test case - * only has one test component. Here, the test component in essence - * acts as a server and client at the same time. The main benefit of - * using self synchoronization is that the same shutdown mechanisms - * can also be reused fomr the multi component test cases. <br><br> - * This module contains a lot of TTCN-3 definitions. It has been - * structured into tree main groups to help the user to identify - * quickly relevant TTCN-3 definitions. For rookie users of this - * module basicUserRelevantDefinitions should offer all the needed - * definitions. Advanced users can consider use of definitions in - * advancedUserRelevantDefinitions. Finally, internalDefinitions - * are definitions which are required for the module to work - * properly but do not need to be used in your code. Remember that - * the main motiviation of this sychronization module is to offer - * are _simple_ user interface. Practice has shown that when writing - * actual test component behavior _only a handful_ of functions - * usually wind up being used! Also check the synchronization examples - * module for example uses of this synchronization mechanism.<br><br> - * The invocation of the sync functions is also closely tied - * to the verdict control functions which should also be reviewed - * prior to using this module. <br><br> - * This module has been derived from EtsiCommon_Synchronization - * which was created in ETSIs STF256/276. It has been kept - * intentionally separate to avoid conflicts with future ETSI - * test suite releases. - * @see LibCommon_Sync.basicUserRelevantDefinitions - * @see LibCommon_Sync.advancedUserRelevantDefinitions - * @remark End users should be aware that any changes made to the in - * definitions this module may be overwritten in future releases. - * End users are encouraged to contact the distributers of this - * module regarding their modifications or additions so that future - * updates will include your changes. - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibCommon_Sync { - - //Common - import from LibCommon_BasicTypesAndValues { type UInt } ; - import from LibCommon_AbstractData all; - import from LibCommon_VerdictControl all; - - group basicUserRelevantDefinitions { - - group importantSyncTypeDefinitions { - - group compTypeRelated { - - /** - * @desc This type is used to be the base of any synchronization - * behavior which is to be executed on a sync server - * component. The test component which acts as a - * sync server in a test case must NOT directly use - * this component type in its runs on clause! - * Note that server synchronization functions may be - * invoked by a test component as long as its - * component type is type compatible to this component - * type definition! - */ - type component BaseSyncComp { - port SyncPort syncPort; - timer tc_sync := PX_TSYNC_TIME_LIMIT; - } - - /** - * @desc This type is used to define any synchronization - * behavior which is to be executed on a sync server - * component. The test component which acts as a - * sync server in a test case may - but does - * not have to - directly use this component type its - * runs on clause. - * Note that server synchronization functions may be - * invoked by a test component as long as its - * component type is type compatible to this component - * type definition! - */ - type component ServerSyncComp extends BaseSyncComp { - timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT; - } - - /** - * @desc This type is used to define any synchronization - * behavior which is to be executed on a sync client - * component. The test component(s) which act as a - * sync client in a test case may - but do not have - * to - directly use this component type their runs - * on clause. - * Note that server synchronization functions may be - * invoked by a test component as long as its - * component type is type compatible to this component - * type definition! - */ - type component ClientSyncComp extends BaseSyncComp { - var StringStack v_stateStack:= c_initStringStack; - var TestcaseStep vc_testcaseStep := e_preamble; - } - - /** - * @desc This type is used to define any synchronization - * behavior which is relevant to non-concurrent test - * cases. - * Note that self synchronization functions may be - * invoked by a test component as long as its - * component type is type compatible to this component - * type definition! - * Note also that this type is type compatible to the - * ClientSyncComp type so that shutdown altsteps from - * concurrent test cases can also be reused in single - * component test cases! - * @see LibCommon_Sync.ClientSyncComp - */ - type component SelfSyncComp extends ClientSyncComp { - port SyncPort syncSendPort; - } - - /** - * @desc This port type must be imported into test suites - * when defining test component types which are - * type compatible to a synchronization component - * type - * @see LibCommon_Sync.SelfSyncComp - * @see LibCommon_Sync.ServerSyncComp - * @see LibCommon_Sync.ClientSyncComp - */ - type port SyncPort message { - inout SyncCmd - } with { - extension "internal" - } - - - /** - * @desc Describes in which step of execution is the testcase - */ - type enumerated TestcaseStep { - e_preamble, - e_testBody, - e_postamble - } - - } // end compTypeRelated - - group standardSyncPointNames { - const charstring c_prDone := "preambleDone"; - const charstring c_poDone := "postambleDone"; - const charstring c_tbDone := "testBodyDone"; - const charstring c_initDone := "initDone"; - } - - } // end group importantSyncTypeDefinitions - - group syncCompTestConfiguration { - - /** - * @desc Calls self connect function if invoking - * component is the MTC or otherwise connects the client - * the server. This function allows to implement preambles - * in a way that they can be used by test components - * in both non-concurrent as well as concurrent test - * cases! - * @remark This function should _not_ be called if the MTC - * acts as a client (and not a server) in a concurrent - * test case. In this case f_connect4ClientSync - * should be used instead. - * @see LibCommon_Sync.f_connect4SelfSync - * @see LibCommon_Sync.f_connect4ClientSync - */ - function f_connect4SelfOrClientSync() - runs on SelfSyncComp { - if ( self == mtc ) { - f_connect4SelfSync(); - } else { - f_connect4ClientSync(); - } - } - - /** - * @desc Calls self connect function if the invoking - * component is the MTC or otherwise disconnects the client - * from the server. This function allows to implement - * postambles in a way that they can be used in both - * non-concurrent as well as concurrent test cases. - * @remark This function should _not_ be called if the MTC - * acts as a client (and not a server) in a concurrent - * test case. In this case f_disconnect4ClientSync - * should be used instead. - * @see LibCommon_Sync.f_disconnect4SelfSync - * @see LibCommon_Sync.f_disconnect4ClientSync - */ - function f_disconnect4SelfOrClientSync() - runs on SelfSyncComp { - if ( self == mtc ) { - f_disconnect4SelfSync(); - } else { - f_disconnect4ClientSync(); - } - } - - } // end group syncCompTestConfiguration - - group syncFunctions { - - /** - * @desc Implements synchronization of 2 clients from server side - * on one or more synchronization points. - * If problem occurs, then server sends STOP to all clients. - * Waits for PX_TSYNC_TIME_LIMIT to let clients - * finish executing their behavior until this - * synchronization point. After passing all synchronization - * points successfuly the server waits for all clients - * to stop. - * See f_serverSyncClientsTimed for overwriting this - * the timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @see LibCommon_Sync.f_serverWaitForAllClientsToStop - * @param p_syncPointIds list of synchronization point name/ids - */ - function f_serverSync2ClientsAndStop( in SyncPointList p_syncPointIds ) - runs on ServerSyncComp { - f_serverSyncNClientsAndStop(2, p_syncPointIds); - } - - /** - * @desc Implements synchronization of 3 clients from server side - * on one or more synchronization points. - * If problem occurs, then server sends STOP to all clients. - * Waits for PX_TSYNC_TIME_LIMIT to let clients - * finish executing their behavior until this - * synchronization point. After passing all synchronization - * points successfuly the server waits for all clients - * to stop. - * See f_serverSyncClientsTimed for overwriting this - * the timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @see LibCommon_Sync.f_serverWaitForAllClientsToStop - * @param p_syncPointIds list of synchronization point name/ids - */ - function f_serverSync3ClientsAndStop( in SyncPointList p_syncPointIds ) - runs on ServerSyncComp { - f_serverSyncNClientsAndStop(3, p_syncPointIds); - } - - /** - * @desc Implements synchronization of 4 clients from server side - * on one or more synchronization points. - * If problem occurs, then server sends STOP to all clients. - * Waits for PX_TSYNC_TIME_LIMIT to let clients - * finish executing their behavior until this - * synchronization point. After passing all synchronization - * points successfuly the server waits for all clients - * to stop. - * See f_serverSyncClientsTimed for overwriting this - * the timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @see LibCommon_Sync.f_serverWaitForAllClientsToStop - * @param p_syncPointIds list of synchronization point name/ids - */ - function f_serverSync4ClientsAndStop( in SyncPointList p_syncPointIds ) - runs on ServerSyncComp { - f_serverSyncNClientsAndStop(4, p_syncPointIds); - } - - /** - * @desc Implements synchronization of N clients from server side - * on one or more synchronization points. - * If problem occurs, then server sends STOP to all clients. - * Waits for PX_TSYNC_TIME_LIMIT to let clients - * finish executing their behavior until this - * synchronization point. After passing all synchronization - * points successfuly the server waits for all clients - * to stop. - * See f_serverSyncClientsTimed for overwriting this - * the timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @see LibCommon_Sync.f_serverWaitForAllClientsToStop - * @param p_numClients number of synchronization clients - * @param p_syncPointIds list of synchronization point name/ids - */ - function f_serverSyncNClientsAndStop ( - in UInt p_numClients, - in SyncPointList p_syncPointIds ) - runs on ServerSyncComp { - var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); - for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { - f_serverSyncClientsTimed ( - p_numClients, - valueof(p_syncPointIds[i]), - PX_TSYNC_TIME_LIMIT ); - } - f_serverWaitForAllClientsToStop(); - } - - /** - * @desc Implements synchronization of 2 clients and 1 UT from server side - * on one or more synchronization points. - * If problem occurs, then server sends STOP to all clients. - * Waits for PX_TSYNC_TIME_LIMIT to let clients - * finish executing their behavior until this - * synchronization point. After passing all synchronization - * points successfuly the server waits for all clients - * to stop. - * See f_serverSyncClientsTimed for overwriting this - * the timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @see LibCommon_Sync.f_serverWaitForAllClientsToStop - * @param p_syncPointIds list of synchronization point name/ids - */ - function f_serverSync2ClientsUtAndStop( in SyncPointList p_syncPointIds ) - runs on ServerSyncComp { - var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); - for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { - f_serverSyncClientsTimed(3,valueof(p_syncPointIds[i]), PX_TSYNC_TIME_LIMIT); - } - f_serverWaitForAllClientsToStop(); - } - - /** - * @desc Calls either self synchronization function if - * invoking component is the MTC, otherwise - * calls client synchronization. After that it - * sets the verdict based on the specified return code. - * This function allows to implement TTCN-3 functions - * in a way that they can be used in both non-concurrent - * as well as concurrent test cases. - * @remark This function should _not_ be called if the MTC - * acts as a client (and not a server) in a concurrent - * test case. In this case f_clientSyncAndVerdict - * should be used instead. - * @param p_syncPoint Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_Sync.f_clientSyncAndVerdict - * @see LibCommon_VerdictControl.f_setVerdict - */ - function f_selfOrClientSyncAndVerdict( in charstring p_syncPoint, - in FncRetCode p_ret) - runs on SelfSyncComp { - if ( self == mtc ) { - // then assume we are running non-conurrent test case - f_selfSyncAndVerdict(p_syncPoint, p_ret); - } else { - f_clientSyncAndVerdict(p_syncPoint, p_ret); - } - } - - /** - * @desc Calls either self synchronization function if - * invoking component is the MTC, otherwise - * calls client synchronization. After that it - * sets a preamble specific verdict based on the - * specified return code. - * This function allows to implement TTCN-3 functions - * in a way that they can be used in both non-concurrent - * as well as concurrent test cases. - * @remark This function should _not_ be called if the MTC - * acts as a client (and not a server) in a concurrent - * test case. In this case f_clientSyncAndVerdictPreamble - * should be used instead. - * @param p_syncPoint Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_Sync.f_clientSyncAndVerdict - * @see LibCommon_VerdictControl.f_setVerdictPreamble - */ - function f_selfOrClientSyncAndVerdictPreamble( in charstring p_syncPoint, - in FncRetCode p_ret) - runs on SelfSyncComp { - if ( self == mtc ) { - // then assume we are running non-conurrent test case - f_selfSyncAndVerdictPreamble(p_syncPoint, p_ret); - } else { - f_clientSyncAndVerdictPreamble(p_syncPoint, p_ret); - } - } - - /** - * @desc Calls either self synchronization function if - * invoking component is the MTC, otherwise - * calls client synchronization. After that it - * sets a preamble specific verdict based on the - * specified return code. - * This function allows to implement TTCN-3 functions - * in a way that they can be used in both non-concurrent - * as well as concurrent test cases. - * @remark This function should _not_ be called if the MTC - * acts as a client (and not a server) in a concurrent - * test case. In this case f_clientSyncAndVerdictTestBody - * should be used instead. - * @param p_syncPoint Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_Sync.f_clientSyncAndVerdict - * @see LibCommon_VerdictControl.f_setVerdictPreamble - */ - function f_selfOrClientSyncAndVerdictTestBody( in charstring p_syncPoint, - in FncRetCode p_ret) - runs on SelfSyncComp { - if ( self == mtc ) { - // then assume we are running non-conurrent test case - f_selfSyncAndVerdictTestBody(p_syncPoint, p_ret); - } else { - f_clientSyncAndVerdictTestBody(p_syncPoint, p_ret); - } - } - - /** - * @desc Function kept for backward compatibility - * @see f_selfOrClientSyncAndVerdictPreamble - * - */ - function f_selfOrClientSyncAndVerdictPR( in charstring p_syncPoint, - in FncRetCode p_ret) - runs on SelfSyncComp { - f_selfOrClientSyncAndVerdictPreamble(p_syncPoint, p_ret); - } - - } // end group syncFunctions - - group syncCompStateHandling { - - /** - * - * @desc This function updates the state (stack) of a - * sync client or self sync component. This stack is - * key in the shutdown handling of test components. - * It adds the new state name to the top of the - * sync component stack of states. - * The state will only be added in case of a current - * execution status of e_success. - * @param p_newSyncCompState Name of state which was attempted to be reached. - * @param p_ret Current behavior execution status - * @remark If the state of component changes this function must be - * _at least_ called from your test suite prior to f_selfSync - * or f_clientSync which is the only definite place for the - * shutdown default invocation! - * @see LibCommon_Sync.a_dummyShutDown - * @see LibCommon_Sync.f_selfSync - * @see LibCommon_Sync.f_clientSync - */ - function f_addSyncCompState(in charstring p_newSyncCompState, - in FncRetCode p_ret) - runs on ClientSyncComp { - if ( p_ret == e_success ) { - if ( f_isItemOnStringStack(v_stateStack,p_newSyncCompState) ) { - log("**** f_addSyncCompState: WARNING: Attempt to add state which is already on sync state stack! No additition done.****"); - } else { - f_pushStringStack(v_stateStack,p_newSyncCompState); - } - } - } // end function f_addSyncCompState - - /** - * - * @desc This function returns the top state on the sync - * state stack of a sync client or self sync - * component and removes it from the stack - * This function cna be used, e.g., in a while - * statement within a postamble or shutdown - * implementation - * @param p_state State on top of the state stack. - * @return false if state stack is empty, true otherwise - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_getTopSyncCompState( out charstring p_state ) - runs on ClientSyncComp - return boolean { - if ( not f_peekStringStackTop(v_stateStack,p_state) ) { - p_state := "IDLE"; - return false; - } - f_popStringStack(v_stateStack); - return true; - } // end function f_getTopSyncCompState - - /* - * @desc This function removes the last state on the state stack - * of a sync client or self sync component. - * This stack is key in the shutdown handling of test - * components. - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_popSyncCompState() - runs on ClientSyncComp { - f_popStringStack(v_stateStack); - } // end function f_popSyncCompState - - /** - * - * @desc This function returns the top state on the sync state - * stack of a sync client or self sync component. It - * does not remove it from the stack - * This stack is key in the shutdown handling of test - * components. - * @param p_state State on top of the state stack. - * @return false if state stack is empty, true otherwise - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_peekTopSyncCompState(out charstring p_state) - runs on ClientSyncComp - return boolean { - return f_peekStringStackTop(v_stateStack,p_state); - } // end function f_peekTopSyncCompState - - /** - * @desc This function checks if the sync state stack - * of a sync client or self sync component is empty. - * This stack is key in the shutdown handling of test - * components. - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_isSyncCompStateStackEmpty() - runs on ClientSyncComp - return boolean { - return f_isStringStackEmpty(v_stateStack); - } // end function f_isSyncCompStateStackEmpty - - } // end group syncCompStateHandling - - group shutDownAltsteps { - - /** - * @desc This is an example of a shutdown altstep which can be - * used as a "template" for a interface specific shutdown - * altstep or possily as a first temporary solution in - * test case development.<br><br> - * This altstep shall be activated as a default as the - * first statement in each test case function which drives - * an interface, i.e., in MTC behavior of single component - * and in each client behavior of multi component test - * cases.<br> - * The required behavior from this altstep is to:<br><br> - * 1) expect the STOP either via the test component - * syncPort<br><br> - * 2) upon its arrival it should shut down the SUT - * gracefully based on the current component state<br><br> - * The current component state should have been - * previously kept uptodate from a test suite via the - * f_addSyncCompState function. This default will then be - * (automatically) invoked either from within f_selfSync - * or f_clientSync.<br> - * Note that shutdown defaults can be written as - * _interface specific_ - they do not need to be test case - * or test component specific! See another example of a - * shutdown altstep in the sync module. - * @see LibCommon_Sync.f_addSyncCompState - * @see LibCommon_Sync.f_selfSync - * @see LibCommon_Sync.f_clientSync - * @see LibCommon_SyncExamples.a_exampleShutDown - * @remark Your application specific shutdown altstep - * implementation(s) should _not_ be defined in this - * module but as part of your test suite or application specific - * modules. - */ - altstep a_dummyShutDown() - runs on SelfSyncComp { - [] syncPort.receive(m_syncServerStop){ - var charstring v_state := ""; - tc_sync.stop; - log("**** a_dummyShutDown: Test component received STOP signal from sync server - going to IDLE state ****"); - while ( f_getTopSyncCompState(v_state) ) { - if ( v_state == "x" ) { - // then do something - } else if ( v_state == "y" ) { - // then do something else - } - } // end while - f_disconnect4SelfOrClientSync(); - // unmap/disconnect more if needed - log("**** a_dummyShutDown: -> Test component stopping itself now! ****") ; - stop ; - } - } // end altstep a_dummyShutDown - - /** - * @desc Shutdown alstep in case the sync server is requesting shutdown. - * - * @remark User shall stop the component - */ - altstep a_shutdown() - runs on ClientSyncComp { - [] syncPort.receive(m_syncServerStop){ - tc_sync.stop ; - log("**** a_shutdown: Test component received STOP signal from MTC **** "); - } - } - - } // end group shutDownAltsteps - - } // end group basicUserRelevantDefinitions - - group advancedUserRelevantDefinitions { - - group serverRelated { - - /** - * @desc Implements synchronization of "n" clients from server - * side. If a problem occurs, then server sends STOP to - * all clients. Waits for PX_TSYNC_TIME_LIMIT to let - * clients finish executing their behavior until this - * synchronization point. See f_serverSyncClientsTimed for - * overwriting this later timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync port! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @param p_noOfClients number of clients to be synchronized - * @param p_syncId synchronization point name/id - */ - function f_serverSyncClients( in UInt p_noOfClients, in charstring p_syncId ) - runs on ServerSyncComp { - f_serverSyncClientsTimed(p_noOfClients,p_syncId, PX_TSYNC_TIME_LIMIT); - } - - /** - * @desc Implements synchronization of "n" clients from server - * side including intermediate synchronization. - * If a problem occurs, then server sends STOP to - * all clients. Waits for PX_TSYNC_TIME_LIMIT to let - * clients finish executing their behavior until this - * synchronization point. See f_serverSyncClientsTimed for - * overwriting this later timing constraint! - * This function sets the server component verdict. - * @remark The use of this function requires prior connection of - * the server sync port! - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.f_serverSyncClientsTimed - * @param p_noOfClients number of clients to be synchronized - * @param p_syncId synchronization point name/id - */ - function f_serverSyncClientsIntermediateSync( in UInt p_noOfClients, in charstring p_syncId, in UInt p_NoOfClientIntermediate, in template (present) charstring p_syncIdIntermediate ) - runs on ServerSyncComp { - f_serverSyncClientsTimedIntermediateSync(p_noOfClients,p_syncId, p_NoOfClientIntermediate, p_syncIdIntermediate, PX_TSYNC_TIME_LIMIT); - } - - /** - * @desc Handles synchronization of clients from server side. - * If problem occurs, then server sends STOP to all clients. - * This function sets the server verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @param p_NoOfClients number of clients to be synchronized - * @param p_syncId synchronization point name/id - * @param p_execTimeLimit time limit given to all clients to finish the execution - * of their behavior up to this synchronization point - * @see LibCommon_Sync.f_connect4SelfOrClientSync - */ - function f_serverSyncClientsTimed(in UInt p_NoOfClients, - in charstring p_syncId, - float p_execTimeLimit ) - runs on ServerSyncComp { - f_serverSyncClientsTimedIntermediateSync(p_NoOfClients, p_syncId, 0, ?, p_execTimeLimit ) - } // end function f_serverSyncClientsTimed - - /** @desc Handles synchronization of clients from server side including - * intermediate synchronization. - * If problem occurs, then server sends STOP to all clients. - * This function sets the server verdict. - * @remark The use of this function requires prior connection of - * the server sync ports! - * @param p_NoOfClients number of clients to be synchronized - * @param p_syncId synchronization point name/id - * @param p_execTimeLimit time limit given to all clients to finish the execution - * of their behavior up to this synchronization point - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @return execution status - */ - function f_serverSyncClientsTimedIntermediateSync( in UInt p_NoOfClients, - in charstring p_syncId, in UInt p_NoOfClientIntermediate, in template (present) charstring p_syncIdIntermediate, - float p_execTimeLimit ) - runs on ServerSyncComp { - - var integer v_noOfRecvdSyncMsgs := 0, v_noOfRecvdSyncMsgsIntermediate := 0; - var boolean v_stopClients := false; - var ClientSyncCompList v_clientRefs := {}, v_clientRefsIntermediate := {}; - var ClientSyncComp v_clientRef; - - if ( p_syncId == c_prDone ) { - log("**** f_serverSyncClientsTimed: Sync server now starting PREAMBLE synchronization ... ****") ; - } else if ( p_syncId == c_tbDone ) { - log("**** f_serverSyncClientsTimed: Sync server now starting TEST BODY synchronization ... ****") ; - } else if ( p_syncId == c_initDone ) { - log("**** f_serverSyncClientsTimed: Sync server now starting UPPER TESTER synchronization ... ****") ; - } else { - log("**** f_serverSyncClientsTimed: Sync server now starting handling of next synchronization point ... ****") ; - } - tc_sync.start(p_execTimeLimit) ; - alt{ - [v_noOfRecvdSyncMsgsIntermediate != p_NoOfClientIntermediate] syncPort.receive(m_syncClientReady(p_syncIdIntermediate)) -> sender v_clientRef { - if(not f_isPresentInArray(v_clientRef, v_clientRefsIntermediate)) { - v_clientRefsIntermediate[v_noOfRecvdSyncMsgsIntermediate] := v_clientRef; - v_noOfRecvdSyncMsgsIntermediate := v_noOfRecvdSyncMsgsIntermediate + 1; - if (v_noOfRecvdSyncMsgsIntermediate == p_NoOfClientIntermediate) { - f_serverSendToAllClients(v_clientRefsIntermediate, m_syncServerReady(p_syncIdIntermediate)); - } - } - repeat; - } - [] syncPort.receive(m_syncClientReady(p_syncId)) -> sender v_clientRef { - if(not f_isPresentInArray(v_clientRef, v_clientRefs)) { - v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; - v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1; - } - if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; } - } - [] syncPort.receive(m_syncClientStop) -> sender v_clientRef { - log("**** f_serverSyncClientsTimed: Sync server received STOP signal from a client - server will wait for all clients to reach their next synchronization point and then stop them! ****") ; - v_stopClients := true; - if(not f_isPresentInArray(v_clientRef, v_clientRefs)) { - v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; - v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1; - } - if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; } - - } - [] syncPort.receive(m_syncClientReady(?)) -> sender v_clientRef { - log("**** f_serverSyncClientsTimed: Sync server received client sync message with incorrect synchronization point id which is currently not handled - server will stop all clients! ****") ; - v_stopClients := true; - if(not f_isPresentInArray(v_clientRef, v_clientRefs)) { - v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; - } - } - [] syncPort.receive(SyncCmd :? ) { - log("**** f_serverSyncClientsTimed: Sync server received (invalid) sync message from other sync server - server will stop all clients! ****") ; - v_stopClients := true; } - [] any port.receive { - // leave it to be ok to receive anything else - // in case that the user has added any non-sync ports to - // his/her server component type definition! - } - [] tc_sync.timeout{ - log("**** f_serverSyncClientsTimed: A client is not responding within specified time limit - sync server is sending stop to all clients! ****"); - v_stopClients := true; } - } //end alt - if (v_noOfRecvdSyncMsgsIntermediate != p_NoOfClientIntermediate) { - v_stopClients := true; - } - tc_sync.stop ; - if ( v_stopClients ) { - setverdict(inconc); - // then send out STOP sync msg - f_serverSendToAllClients(v_clientRefs, m_syncServerStop); - f_serverWaitForAllClientsToShutDown(); // function will never return! - } else { - setverdict(pass); - // then send out READY sync msg - f_serverSendToAllClients(v_clientRefs, m_syncServerReady(p_syncId)); - if ( p_syncId == c_prDone ) { - log("**** f_serverSyncClientsTimed: Sync server successfully passed PREAMBLE synchronization point. ****") ; - } else if ( p_syncId == c_tbDone ) { - log("**** f_serverSyncClientsTimed: Sync server successfully passed TEST BODY synchronization point. ****") ; - } else { - log("**** f_serverSyncClientsTimed: Sync server successfully passed synchronization point. ****") ; - } - } - } // end function f_serverSyncClientsTimedIntermediateSync - - /** - * @desc This function is intended only for use on the sync - * server component in concurrent TTCN-3 test cases. - * It waits for all components to finish execution within - * the PX_TSYNC_TIME_LIMIT. If a timeout occurs - * the server will stop all clients. - * This function sets the server component verdict. - */ - function f_serverWaitForAllClientsToStop() - runs on ServerSyncComp { - tc_sync.start; - alt { - [] all component.done { - tc_sync.stop; - log("**** f_serverWaitForAllClientsToStop: All sync clients have finished their execution. Sync server now terminating test case. ****") ; - } - [] tc_sync.timeout { - log("**** f_serverWaitForAllClientsToStop: Not all sync clients have finshed execution within the sync time limit. Sync server will stop test case! ****") ; - stop; - } - } // end alt - setverdict(pass); - } // end function f_serverWaitForAllClientsToStop - - } // end group serverRelated - - group clientRelated { - - /** - * @desc This function creates the connection needed to - * execute client synchronization functions - * @see LibCommon_Sync.f_clientSync - * @see LibCommon_Sync.f_clientSendStop - */ - function f_connect4ClientSync() - runs on ClientSyncComp { - connect(self:syncPort, mtc:syncPort); - }// end function f_connect4ClientSync - - /** - * @desc This function removes the connection needed - * to execute client synchronization functions - * @see LibCommon_Sync.f_clientSync - * @see LibCommon_Sync.f_clientSendStop - */ - function f_disconnect4ClientSync() - runs on ClientSyncComp { - disconnect(self:syncPort, mtc:syncPort); - }// end function f_disconnect4ClientSync - - /** - * @desc This function combines client verdict setting with its - * synchronization for use,e.g, after or within a - * test body implementation. - * Note that such premables can _not_ be reused in non- - * concurrent test cases. This can be achieved by using - * the f_selfOrClientSyncAndVerdict function instead. - * This function sets the client component verdict. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_VerdictControl.f_setVerdict - * @see LibCommon_Sync.f_selfOrClientSyncAndVerdict - */ - function f_clientSyncAndVerdict(in charstring p_syncId, - in FncRetCode p_ret) - runs on ClientSyncComp { - if(vc_testcaseStep == e_preamble) { - f_clientSyncAndVerdictPreamble(p_syncId, p_ret); - } else if(vc_testcaseStep == e_testBody) { - f_clientSyncAndVerdictTestBody(p_syncId, p_ret); - } - else { - f_clientSyncAndVerdictPostamble(p_syncId, p_ret); - } - } - - /** - * @desc This function combines client verdict setting with its - * synchronization for use after or within a preamble - * implementation. - * Note that such preambles can _not_ be reused in non- - * concurrent test cases. - * This function sets the client component verdict. - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_VerdictControl.f_setVerdictPreamble - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - */ - function f_clientSyncAndVerdictPreamble(in charstring p_syncId , - FncRetCode p_ret) - runs on ClientSyncComp { - f_setVerdictPreamble(p_ret); - f_clientSync(p_syncId,p_ret); - vc_testcaseStep := e_testBody; - } - - /** - * @desc This function combines client verdict setting with its - * synchronization for use,e.g, after or within a - * test body implementation. - * Note that such premables can _not_ be reused in non- - * concurrent test cases. This can be achieved by using - * the f_selfOrClientSyncAndVerdict function instead. - * This function sets the client component verdict. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_VerdictControl.f_setVerdict - * @see LibCommon_Sync.f_selfOrClientSyncAndVerdict - */ - function f_clientSyncAndVerdictTestBody(in charstring p_syncId, - in FncRetCode p_ret) - runs on ClientSyncComp { - f_setVerdict(p_ret); - f_clientSync(p_syncId,p_ret); - vc_testcaseStep := e_postamble; - } - - /** - * @desc This function combines client verdict setting with its - * synchronization for use after or within a - * postamble implementation. - * Note that such prostambles can _not_ be reused in non- - * concurrent test cases. - * This function sets the client component verdict. - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_VerdictControl.f_setVerdictPostamble - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - */ - function f_clientSyncAndVerdictPostamble(in charstring p_syncId , - in FncRetCode p_ret) - runs on ClientSyncComp { - f_setVerdictPostamble(p_ret); - f_clientSync(p_syncId,p_ret); - } - - /** - * @desc This function handles synchronization of a sync client - * with the server. In case of successful execution it sends - * a READY message to the server and waits the READY back. - * The time used for waiting is defined by PX_TSYNC_TIME_LIMIT. - * In case of a non successful execution status it - * sends a STOP message to the server. - * In both cases the receipt of a STOP message or no - * response from the server it will trigger the shutdown - * default (if activated). - * This function will set only the client verdict to INCONC - * (and stop its execution) if no STOP response is received - * from the server within the PX_TSYNC_TIME_LIMIT - * or if no shutdown default is activated. In all other - * cases the client verdict is NOT set. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.a_dummyShutDown - * @see LibCommon_Sync.f_clientSendStop - * @return Updated execution status - */ - function f_clientSync( in charstring p_syncId , - in FncRetCode p_ret ) - runs on ClientSyncComp - return FncRetCode{ - - if (p_ret == e_success){ - syncPort.send(m_syncClientReady(p_syncId)); - tc_sync.start; - alt{ - [] syncPort.receive(m_syncServerReady(p_syncId)){ - tc_sync.stop ; } - [] tc_sync.timeout{ - log("**** f_clientSync: Sync client did not receive message from sync server within the specified time limit - sync client will ask sync server to stop test case! ****") ; - f_clientSendStop(); } // function will not return! - } //end alt - } //end if - else { - log("**** f_clientSync: Execution status indicates that execution of test component behavior was not successful - sync client will ask sync server to stop test case! ****") ; - f_clientSendStop(); // function will not return! - } - if ( p_syncId == c_prDone ) { - log("**** f_clientSync: Sync client successfully passed PREAMBLE synchronization point. ****") ; - } else if ( p_syncId == c_tbDone ) { - log("**** f_clientSync: Sync client successfully passed TEST BODY synchronization point. ****") ; - } else { - log("**** f_clientSync: Sync client successfully passed synchronization point. ****") ; - } - return e_success ; - - } // end function f_clientSync - - /** - * @desc This function can be used to request the shutdown a - * multi component test case _prior_ to reaching a - * synchronization point. It sends a STOP message to - * the sync server and awaits then the STOP from the server - * which will trigger the shutdown default (if activated). - * This function will set the server verdict to INCONC (and - * stop the test case) if no shutdown default is activated. - * This function will set only the client verdict to INCONC - * (and stop its execution) if no STOP response is received - * from the server within the PX_TSYNC_TIME_LIMIT - * or if no shutdown default is activated. In all other - * cases the client verdict is NOT set. - * @remark The use of this function requires prior connection - * of the client sync port! - * @see LibCommon_Sync.f_connect4ClientSync - * @see LibCommon_Sync.f_connect4SelfOrClientSync - * @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_clientSendStop() - runs on ClientSyncComp { - log("**** f_clientSendStop: Sync client requesting from server to stop test case (including itself). ****") ; - syncPort.send(m_syncClientStop) ; - tc_sync.start; - alt{ - [] tc_sync.timeout{ - log("**** f_clientSendStop: Stopping sync client without shutdown - either no shutdown default active or no stop received from server. ****") ; - setverdict(inconc); - stop ; - } - }//end alt - tc_sync.stop; - stop; // stop here if shutdown default does not stop - } - - } // end group clientRelated - - } // end group advancedUserRelevantDefinitions - - group otherSyncModuleDefinitions { - - group syncModuleparams { - /** - * - * @desc Default time limit for a sync client to reach a - * synchronization point - */ - modulepar float PX_TSYNC_TIME_LIMIT := 120.0; - - /* - * @desc Default time limit for a sync client to finish - * its execution of the shutdown default - */ - modulepar float PX_TSHUT_DOWN_TIME_LIMIT := 120.0; - } - - group otherSyncTypes { - - type record of charstring SyncPointList; - - type record of ClientSyncComp ClientSyncCompList; - - } // end group otherSyncTypes - - group otherSelfSyncRelatedDefinitions { - - /** - * @desc This function creates the connection needed to - * execute self sync functions - * @see LibCommon_Sync.f_selfSync - * @see LibCommon_Sync.f_selfSyncStop - */ - function f_connect4SelfSync() - runs on SelfSyncComp { - connect(self:syncSendPort, self:syncPort); - }// end function f_connect4SelfSync - - /** - * @desc This function removes the connection needed - * to execute self sync functions - * @see LibCommon_Sync.f_selfSync - * @see LibCommon_Sync.f_selfSyncStop - */ - function f_disconnect4SelfSync() - runs on SelfSyncComp { - disconnect(self:syncSendPort, self:syncPort); - }// end function f_disconnect4SelfSync - - /** - * @desc This function combines MTC verdict setting with self - * synchronization for use in the preamble / test body / postamble - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_VerdictControl.f_setVerdict - * @see LibCommon_Sync.f_selfSync - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_selfSyncAndVerdict( in charstring p_syncId, - in FncRetCode p_ret ) - runs on SelfSyncComp { - if(vc_testcaseStep == e_preamble) { - f_selfSyncAndVerdictPreamble(p_syncId, p_ret); - } else if(vc_testcaseStep == e_testBody) { - f_selfSyncAndVerdictTestBody(p_syncId, p_ret); - } - else { - f_selfSyncAndVerdictPostamble(p_syncId, p_ret); - } - } - - /** - * @desc This function combines MTC verdict setting with self - * synchronization for use after the preamble. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_VerdictControl.f_setVerdictPreamble - * @see LibCommon_Sync.f_selfSync - */ - function f_selfSyncAndVerdictPreamble( in charstring p_syncId, - in FncRetCode p_ret ) - runs on SelfSyncComp { - f_setVerdictPreOrPostamble(p_ret); - f_selfSync(p_syncId,p_ret); - vc_testcaseStep := e_testBody; - } - - /** - * @desc This function combines MTC verdict setting with self - * synchronization for use after the test body. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_VerdictControl.f_setVerdict - * @see LibCommon_Sync.f_selfSync - */ - function f_selfSyncAndVerdictTestBody( in charstring p_syncId, - in FncRetCode p_ret ) - runs on SelfSyncComp { - f_setVerdict(p_ret); - f_selfSync(p_syncId,p_ret); - vc_testcaseStep := e_postamble; - } - - /** - * @desc This function combines MTC verdict setting with self - * synchronization for use after the postamble. - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @see LibCommon_VerdictControl.f_setVerdictPostamble - * @see LibCommon_Sync.f_selfSync - */ - function f_selfSyncAndVerdictPostamble( in charstring p_syncId , - in FncRetCode p_ret ) - runs on SelfSyncComp { - f_setVerdictPreOrPostamble(p_ret); - f_selfSync(p_syncId,p_ret); - } - - /** - * @desc This function synchronizes a MTC with itself. In case - * of a non successful execution status it sends a STOP - * message to itself and invokes that way the - * shutdown default (if activated). - * This function will set the server verdict to INCONC (and - * stop the test case) if no shutdown default is activated. - * Otherwise no verdict is set. - * @remark Sync ports should be connected prior to the invocation - * of this function! - * @param p_syncId Synchronization point name/id - * @param p_ret Current behavior execution status - * @return Updated execution status - * @see LibCommon_Sync.f_connect4SelfSync - * @see LibCommon_Sync.a_dummyShutDown - */ - function f_selfSync( in charstring p_syncId , - in FncRetCode p_ret ) - runs on SelfSyncComp - return FncRetCode{ - if (p_ret != e_success){ - f_selfSyncStop() ; // function will not return! - } - if ( p_syncId == c_prDone ) { - log("**** f_selfSync: Successfully passed PREAMBLE synchronization point. ****") ; - } else if ( p_syncId == c_tbDone ) { - log("**** f_selfSync: Successfully passed TEST BODY synchronization point. ****") ; - } else { - log("**** f_selfSync: Successfully passed synchronization point. ****") ; - } - return e_success ; - }// end function f_selfSync - - /** - * @desc This function can be used to shut down a test case _prior_ - * to reaching a synchronization point. it sends a STOP - * message to itself and invokes that way the - * shutdown default (if activated). - * This function will set the server verdict to INCONC (and - * stop the test case) if no shutdown default is activated. - * Otherwise no verdict is set. - * @remark Sync ports should be connected prior to the invocation - * of this function! - * @see LibCommon_Sync.f_connect4SelfSync - */ - function f_selfSyncStop() - runs on SelfSyncComp { - - log("**** f_selfSyncStop: MTC requests to stop test case (itself). ****") ; - syncSendPort.send(m_syncServerStop) ; // this MUST be _server_ for the default to catch! - tc_sync.start(PX_TSYNC_TIME_LIMIT); - alt{ - [] tc_sync.timeout{ - log("**** f_selfSyncStop: Stopping MTC without shutdown - either no shutdown default active or missing syncPort connection ****") ; - setverdict(inconc); - stop ; - } - }//end alt - tc_sync.stop; - stop; // if shutdown default is not activated or if it does not stop - } // end function f_selfSyncStop - - } // end group otherSelfSyncRelatedDefinitions - - /** - * - * @desc The sychronization protocol is conceptually based on - * named synchronization. Each synchronization point - * has it own specific synchronization message. This - * makes each synchronization unique, and allows, e.g., to - * ensure that a server synchronizes only clients which have - * reached the same synchronization point. - */ - group syncProtocolDefinition { - - type union SyncCmd { - ClientReady clientReady, - ServerReady serverReady, - ClientStop clientStop, - ServerStop serverStop - } - - type record ClientReady { - charstring syncPointId - } - - type record ServerReady { - charstring syncPointId - } - - type record ClientStop {} - - type record ServerStop {} - - } // end group syncProtocolDefinition - - group syncMessages { - template SyncCmd m_syncClientReady( template (present) charstring p_syncId ) := { - clientReady := { p_syncId } - } - - template SyncCmd m_syncServerReady( template (present) charstring p_syncId ) := { - serverReady := { p_syncId } - } - - template SyncCmd m_syncClientStop := { - clientStop := {} - } - - template SyncCmd m_syncServerStop := { - serverStop := {} - } - - } // end group syncMessages - - group otherSyncFunctions { - - /** - * @desc Makes server send a sync message to all known clients - * @param p_clientRefs List of client references to which the message is to be send - * @param p_syncCmd The actual synchronization message to be sent out - */ - function f_serverSendToAllClients( in ClientSyncCompList p_clientRefs, - in template (value) SyncCmd p_syncCmd) - runs on ServerSyncComp { - var integer i:=0; - for (i:=0; i< sizeof(p_clientRefs); i:=i+1 ){ - syncPort.send(p_syncCmd) to valueof(p_clientRefs[i]); - } - } // end function f_serverSendToAllClients - - /** - * @desc This function is intended only for use on server in concurrent - * TTCN-3 test cases. It waits for all components to shut down - * within the PX_TSHUT_DOWN_TIME_LIMIT. If a timeout occurs - * it aborts the test case (no matter how far clients got with their - * shutdown). - * This function sets the server verdict. - */ - function f_serverWaitForAllClientsToShutDown() - runs on ServerSyncComp { - - tc_shutDown.start(PX_TSHUT_DOWN_TIME_LIMIT); - alt { - [] syncPort.receive { - // clients may still try to send some sync message - } - [] all component.done { - tc_shutDown.stop; - log("**** f_serverWaitForAllClientsToShutDown: All components have properly shut down. Sync server will now terminate the test case. ****") ; - } - [] tc_shutDown.timeout { - log("**** f_serverWaitForAllClientsToShutDown: Not all clients have properly shutdown within the shut down time limit. Sync server will now terminate test case! ****") ; - } - } // end alt - // cover case that shut down default is NOT activated - setverdict(inconc); - //mtc.stop; - syncPort.send(m_syncServerStop) to self; // this MUST be _server_ for the default to catch! - tc_sync.start(PX_TSYNC_TIME_LIMIT); - alt{ - [] tc_sync.timeout{ - log("**** f_selfSyncStop: Stopping MTC without shutdown - either no shutdown default active or missing syncPort connection ****") ; - setverdict(inconc); - stop ; - } - }//end alt - tc_sync.stop; - stop; // if shutdown default is not activated or if it does not stop - } // end function f_serverWaitForAllClientsToShutDown - - function f_isPresentInArray(in ClientSyncComp p_clientRef, in ClientSyncCompList p_clientRefs) - return boolean { - var integer i; - for(i:=0; i < sizeof(p_clientRefs); i:=i+1) { - if(p_clientRefs[i] == p_clientRef) { - return true; - } - } - return false; - } - } // end group otherSyncFunctions - - } // end group otherSyncDefinitions - -} // end module LibCommon_Sync diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 6c4fc437e878ca46d6a71a9c2f1fcc2694925f91..a07d2c92aed65593cead899938fd452c4531eef2 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -130,6 +130,10 @@ module OneM2M_Functions { vc_config := e_cf02CseSimuMaster; vc_testSystemRole := e_cse; vc_ae1 := AeSimu.create("AE1") alive; + + //Initialization of local CSEBase + v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); + vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); // Map map(self:mccPort, system:mccPort); @@ -139,9 +143,6 @@ module OneM2M_Functions { activate(a_cse_cf02_cse1()); vc_ae1.start(f_cf02UpAe1()); vc_ae1.done; - - v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); - vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); // Connect @@ -177,6 +178,10 @@ module OneM2M_Functions { vc_config := e_cf03; vc_testSystemRole := e_cse; + //Creation of CSEBase + v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); + vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); + // Map map(self:mcaPortIn, system:mcaPortIn);//TODO To be consistent, we should use mcaPortIn for AE testing map(self:acPort, system:acPort); @@ -185,11 +190,6 @@ module OneM2M_Functions { } activate(a_default()); activate(a_ae_cf03()); - - //Creation of CSEBase - - v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); - vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); // Connect @@ -207,18 +207,16 @@ module OneM2M_Functions { vc_config := e_cf04; vc_testSystemRole := e_cse; - + //Creation of CSEBase + v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); + vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); + // Map map(self:mccPort, system:mccPort); map(self:mccPortIn, system:mccPortIn); map(self:acPort, system:acPort); activate(a_default()); activate(a_cse_cf04()); - - //Creation of CSEBase - - v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); - vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); // Connect @@ -332,7 +330,8 @@ module OneM2M_Functions { []infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response { } } - + + p_component.done; f_disconnectInfoPort(p_component); return v_response; @@ -354,6 +353,7 @@ module OneM2M_Functions { } } + p_component.done; f_disconnectInfoPort(p_component); return v_request; @@ -375,6 +375,7 @@ module OneM2M_Functions { } } + p_ae.done; f_disconnectInfoPort(p_ae); return v_primitiveContent; @@ -398,6 +399,7 @@ module OneM2M_Functions { } } + p_cse.done; f_disconnectInfoPort(p_cse); return v_resourceIndex; @@ -422,6 +424,7 @@ module OneM2M_Functions { } } + p_component.done; f_disconnectInfoPort(p_component); return v_resourceIndex; @@ -681,9 +684,11 @@ module OneM2M_Functions { function f_cse_preamble_subscriptionVerification(inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu { if(p_resourceType == int23){ - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred + vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); - f_checkComponentDoneAndGetVerdict(vc_ae2); + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); p_ae2Index := f_getResource(vc_ae2); if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced @@ -708,8 +713,16 @@ module OneM2M_Functions { if (PX_RUN_POSTAMBLE) { + if(vc_config == e_cf02) { + if(vc_cse1.alive) { + f_cse_postamble_cse1(); + } + } + if(vc_auxiliaryAe2Up) { - f_cse_postamble_aeSimu(vc_ae2); + if (vc_ae2.alive) { + f_cse_postamble_aeSimu(vc_ae2); + } } for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) { @@ -766,6 +779,18 @@ module OneM2M_Functions { vc_ae1.done; } + /** + * @desc Calls to postamble for CseSimu component (i.e. CSE1) on AeSimu + * @verdict + */ + function f_cse_postamble_cse1() runs on AeSimu { + if(vc_cse1.running) { + vc_cse1.stop; + } + vc_cse1.start(f_cse_postamble_deleteResourcesCSE()); + vc_cse1.done; + } + /** * @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution * @verdict @@ -778,12 +803,18 @@ module OneM2M_Functions { if (PX_RUN_POSTAMBLE) { if(vc_config == e_cf02CseSimuMaster) { - f_cse_postamble_ae1(); + if(vc_ae1.alive) { + f_cse_postamble_ae1(); + } }; for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) { - v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]); + if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.remoteCSE) and PX_MN_CSE) { + v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i], e_nonHierarchical, e_spRelative); + } else { + v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]); + } v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false))); @@ -862,6 +893,32 @@ module OneM2M_Functions { } + /** + * @desc Creation of a resource + * @param p_resourceType Resource type of the resource to be created + * @param p_requestPrimitive CREATE request primitive for the resource to be created + * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created + * @return Internal resource index of the created resource + * @verdict + */ + function f_cse_createResource_withAcpAux(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu return integer { + + var RequestPrimitive v_request; + var integer v_resourceIndex := -1; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + if(vc_acpAuxIndex != -1) { + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[vc_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, p_parentIndex); + + return v_resourceIndex; + + } + /** * @desc Message exchange for the update of an announced resource * @param p_requestPrimitive UPDATE request primitive to be used @@ -903,7 +960,7 @@ module OneM2M_Functions { function f_cse_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) runs on AeSimu return integer{ var RequestPrimitive v_request; var integer v_acpAuxIndex := -1; - v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_allowedOperations := p_allowedOperations)); + v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_acor := p_acor, p_allowedOperations := p_allowedOperations)); v_request := f_getCreateRequestPrimitive(int1, v_request, -1); @@ -986,10 +1043,6 @@ module OneM2M_Functions { tc_ac.stop; setverdict(inconc, __SCOPE__&":INFO: Error while retrieving resource"); } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); - } [] tc_ac.timeout { setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); } @@ -1072,36 +1125,7 @@ module OneM2M_Functions { } return false; } - - /** - * @desc Check that a resource is present in the IUT (resourceId is known) by using RETRIEVE operation - * @param p_resourceIndex Resource index of the resource to be checked - * @return boolean - */ - function f_isResourcePresentCseSimu (integer p_resourceIndex) runs on CseSimu return boolean { - - //Check to see if the resource is present or not - mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex)); - return true; - } - [] mccPort.receive(mw_response(mw_responsePrimitive(?, -))) { - tc_ac.stop; - setverdict(inconc, testcasename() & ": Wrong response status code in the response"); - return false; - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - return false; - } - } - return false; - } - + /** * @desc Check that a resource is not present in the IUT (resourceId is NOT known) * @param p_parentIndex Index of the parent resource of the resource to be checked @@ -1144,6 +1168,8 @@ module OneM2M_Functions { v_request := valueof(m_updateAcpBase); + v_request.requestIdentifier := valueof(v_request.requestIdentifier) & f_rnd(1, 1000000); + v_request.to_ := f_getResourceAddress(vc_acpAuxIndex); v_request.from_ := f_getOriginator(vc_acpAuxIndex); v_request.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {valueof(m_createAcr(PX_ACOR, p_allowedOperations))}; @@ -1368,6 +1394,41 @@ module OneM2M_Functions { //mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted } //end f_subscriptionVerificationHandler + + /** + * @desc Default handling message exchange for the notification procedure + * @verdict + */ + function f_cse_notifyProcedure_defaultHandler() runs on AeSimu { + // Local variables + var ResponsePrimitive v_responsePrimitive; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2001, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + mcaPortIn.send(m_response(v_responsePrimitive)); + tc_ac.start; + repeat; + } + [] mcaPortIn.receive{ + tc_ac.stop; + setverdict(inconc, __SCOPE__ & ":ERROR: unexpected message received"); + tc_ac.start; + repeat; + } + } + + } //end f_cse_notifyProcedure_defaultHandler /** * @desc Handling message exchange for the notification procedure @@ -1768,6 +1829,11 @@ module OneM2M_Functions { setverdict(pass, testcasename() & ": Resource not present"); return true; } + [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource " & p_resourceName & " present"); + return false; + } [] mccPort.receive(mw_response(mw_responsePrimitive(?))) { tc_ac.stop; setverdict(inconc, testcasename() & ": Wrong response status code in the response"); @@ -1867,7 +1933,8 @@ module OneM2M_Functions { v_response.primitiveContent.remoteCSE := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE; mccPortIn.send(m_response(v_response)); - v_resourceIndex := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource)), int16, -1); + vc_remoteCseIndex := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource)), int16, -1); + v_resourceIndex := vc_remoteCseIndex; v_remoteCSERegistered:=true; tc_ac.start; repeat; @@ -1937,8 +2004,8 @@ module OneM2M_Functions { if(p_resourceType == int5) { //CSEBase v_myResource.cSEBase.resourceName := PX_CSE1_NAME; v_myResource.cSEBase.resourceType := p_resourceType; - v_myResource.cSEBase.resourceID := PX_CSE1_ID; - v_myResource.cSEBase.parentID := omit; //Following TS-0001, it must be NULL + v_myResource.cSEBase.resourceID := f_resourceIdCleaner(PX_CSE1_ID); + v_myResource.cSEBase.parentID := "";//Following TS-0001, it must be NULL. Set to a value for Codec to set it to null v_myResource.cSEBase.creationTime := fx_generateTimestamp(); v_myResource.cSEBase.creationTime := "20171231T012345"; v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime; @@ -1960,6 +2027,7 @@ module OneM2M_Functions { } v_myResource.remoteCSE.resourceType := p_resourceType; v_myResource.remoteCSE.resourceID := f_resourceIdCleaner(v_myResource.remoteCSE.cSE_ID); + //v_myResource.remoteCSE.resourceID := "remoteCSE-ID" & int2str(v_resourceIndex); v_myResource.remoteCSE.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource); v_myResource.remoteCSE.creationTime := fx_generateTimestamp(); v_myResource.remoteCSE.creationTime := "20171231T012345"; @@ -1983,37 +2051,27 @@ module OneM2M_Functions { } } else if (p_resourceType == int10002 and ispresent (p_resource)) { //AE Annc if(ischosen(p_resource.aEAnnc)) { - v_myResource.aEAnnc.expirationTime := p_resource.aEAnnc.expirationTime; - v_myResource.aEAnnc.accessControlPolicyIDs := p_resource.aEAnnc.accessControlPolicyIDs; - v_myResource.aEAnnc.labels := p_resource.aEAnnc.labels; - } + v_myResource.aEAnnc := valueof(p_resource.aEAnnc); + } } else if (p_resourceType == int10001 and ispresent (p_resource)) { //Acp Annc if(ischosen(p_resource.accessControlPolicyAnnc)) { - v_myResource.accessControlPolicyAnnc.expirationTime := p_resource.accessControlPolicyAnnc.expirationTime; - v_myResource.accessControlPolicyAnnc.labels := p_resource.accessControlPolicyAnnc.labels; - v_myResource.accessControlPolicyAnnc.privileges := p_resource.accessControlPolicyAnnc.privileges; - v_myResource.accessControlPolicyAnnc.selfPrivileges := p_resource.accessControlPolicyAnnc.selfPrivileges; + v_myResource.accessControlPolicyAnnc := valueof(p_resource.accessControlPolicyAnnc); } } else if (p_resourceType == int10003 and ispresent (p_resource)) { //Container Annc if(ischosen(p_resource.containerAnnc)) { - v_myResource.containerAnnc.expirationTime := p_resource.containerAnnc.expirationTime; - v_myResource.containerAnnc.accessControlPolicyIDs := p_resource.containerAnnc.accessControlPolicyIDs; - v_myResource.containerAnnc.labels := p_resource.containerAnnc.labels; + v_myResource.containerAnnc := valueof(p_resource.containerAnnc); } } else if (p_resourceType == int10009 and ispresent (p_resource)) { //Group Annc if(ischosen(p_resource.groupAnnc)) { - v_myResource.groupAnnc.expirationTime := p_resource.groupAnnc.expirationTime; - v_myResource.groupAnnc.accessControlPolicyIDs := p_resource.groupAnnc.accessControlPolicyIDs; - v_myResource.groupAnnc.labels := p_resource.groupAnnc.labels; + v_myResource.groupAnnc := valueof(p_resource.groupAnnc); } } else if (p_resourceType == int10014 and ispresent (p_resource)) { //ContentInstance Annc if(ischosen(p_resource.contentInstanceAnnc)) { - v_myResource.contentInstanceAnnc.expirationTime := p_resource.contentInstanceAnnc.expirationTime; - v_myResource.contentInstanceAnnc.labels := p_resource.contentInstanceAnnc.labels; + v_myResource.contentInstanceAnnc := valueof(p_resource.contentInstanceAnnc); } } else if (p_resourceType == int1 and ispresent (p_resource)) { //Acp Resource if(ischosen (p_resource.accessControlPolicy)){ - v_myResource.accessControlPolicy := valueof(p_resource.accessControlPolicy); + v_myResource.accessControlPolicy := valueof(p_resource.accessControlPolicy); if(not(ispresent(p_resource.accessControlPolicy.resourceName))) { v_myResource.accessControlPolicy.resourceName := "accessControlPolicy" & int2str(v_resourceIndex); @@ -2022,7 +2080,6 @@ module OneM2M_Functions { v_myResource.accessControlPolicy.resourceType := p_resourceType; v_myResource.accessControlPolicy.resourceID := "accessControlPolicy" & int2str(v_resourceIndex); v_myResource.accessControlPolicy.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource); - v_myResource.accessControlPolicy.labels := p_resource.accessControlPolicy.labels; v_myResource.accessControlPolicy.creationTime := fx_generateTimestamp(); if(not(ispresent(p_resource.accessControlPolicy.expirationTime))) { v_myResource.accessControlPolicy.expirationTime := "20301231T012345"; @@ -2038,25 +2095,105 @@ module OneM2M_Functions { }//End of function /** - * @desc Sending of a request primitive over mca port - * @param p_resourceType Resource type of the resource to be created - * @param p_requestPrimitive CREATE request primitive for the resource to be created - * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created - * @return Internal resource index of the created resource - * @verdict + * @desc Update of a local resource (Test System simulating a CSE) + * @param p_localResourceIndex Resource index of resource to be updated + * @param p_resource Resource update */ - function f_cse_sendCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu { - - var RequestPrimitive v_request; - var integer v_resourceIndex := -1; + function f_cse_updateLocalResource(in integer p_localResourceIndex, in PrimitiveContent p_resource) runs on CseSimu { + + // TODO To review the code (use of indexes, generation of value for certain attributes, etc..) + if(ischosen(vc_localResourcesList[p_localResourceIndex].resource.remoteCSE) and ischosen(p_resource.remoteCSE)) {//RemoteCSE + + if(ispresent(p_resource.remoteCSE.accessControlPolicyIDs)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.accessControlPolicyIDs := p_resource.remoteCSE.accessControlPolicyIDs; + } + if(ispresent(p_resource.remoteCSE.expirationTime)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.expirationTime := p_resource.remoteCSE.expirationTime; + } + if(ispresent(p_resource.remoteCSE.labels)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.labels := p_resource.remoteCSE.labels; + } + if(ispresent(p_resource.remoteCSE.announceTo)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.announceTo := p_resource.remoteCSE.announceTo; + } + if(ispresent(p_resource.remoteCSE.announcedAttribute)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.announcedAttribute := p_resource.remoteCSE.announcedAttribute; + } + if(ispresent(p_resource.remoteCSE.pointOfAccess)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.pointOfAccess := p_resource.remoteCSE.pointOfAccess; + } + if(ispresent(p_resource.remoteCSE.m2M_Ext_ID)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.m2M_Ext_ID := p_resource.remoteCSE.m2M_Ext_ID; + } + if(ispresent(p_resource.remoteCSE.trigger_Recipient_ID)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.trigger_Recipient_ID := p_resource.remoteCSE.trigger_Recipient_ID; + } + if(ispresent(p_resource.remoteCSE.requestReachability)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.requestReachability := p_resource.remoteCSE.requestReachability; + } + if(ispresent(p_resource.remoteCSE.nodeLink)) { + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.nodeLink := p_resource.remoteCSE.nodeLink; + } + + } else if(ischosen(vc_localResourcesList[p_localResourceIndex].resource.container) and (ischosen(p_resource.container))) {//Container + } - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); + }//End of function + + /** + * @desc Send response to the IUT (Test System simulating a CSE) + * @param p_requestPrimtive Received request primitive + */ + function f_cse_sendResponse(in MsgIn p_requestPrimitive) runs on CseSimu { + + var integer v_parentResourceIndex := -1; + var integer v_localResourceIndex := -1; + var ResponsePrimitive v_response; + var PrimitiveContent v_localResource; + + v_parentResourceIndex := f_getResourceIndex(p_requestPrimitive.primitive.requestPrimitive.to_); + if(v_parentResourceIndex == -1) { + log(__SCOPE__&": ERROR: Target resource not found"); + v_response := valueof(m_responsePrimitive(int4004,p_requestPrimitive.primitive.requestPrimitive.requestIdentifier)); + + } else { + v_localResource := f_cse_generateLocalResource(p_requestPrimitive.primitive.requestPrimitive.primitiveContent, v_parentResourceIndex, p_requestPrimitive.primitive.requestPrimitive.resourceType); + v_localResourceIndex := f_setLocalResource(v_localResource, p_requestPrimitive.primitive.requestPrimitive.resourceType, v_parentResourceIndex); + + v_response := valueof(m_responsePrimitive(int2001,p_requestPrimitive.primitive.requestPrimitive.requestIdentifier)); + v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; + } + v_response.from_ := PX_CSE1_ID; + v_response.to_ := p_requestPrimitive.primitive.requestPrimitive.from_; + mccPortIn.send(m_response(v_response)); - mcaPort.send(m_request(v_request)); - } - + /** + * @desc Receive response from the IUT + * @param p_requestPrimtive Received request primitive + */ + function f_cse_receiveResponse() runs on AeSimu { + + var integer v_localResourceIndex := -1; + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Response received with positive response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Response received with negative response status code"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No response received"); + } + } + + } + }//end group CseSimuFunctions group CseAltstepFunctions { @@ -2088,23 +2225,31 @@ module OneM2M_Functions { altstep a_cse_cf02_cse1() runs on CseSimu { var PrimitiveContent v_localResource; - var integer vc_localResourceIndex := -1; + var integer v_localResourceIndex := -1; + var integer v_parentResourceIndex := -1; var MsgIn v_request; var ResponsePrimitive v_response; - var integer v_localResourceIndex := -1; [] mccPortIn.receive(mw_request(mw_create())) -> value v_request { log(__SCOPE__&": WARNING: Unexpected CREATE message received"); tc_ac.stop; - v_localResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, vc_cSEBaseIndex, v_request.primitive.requestPrimitive.resourceType);//TODO Get index from v_request.primitive.requestPrimitive.to_ - vc_localResourceIndex := f_setLocalResource(v_localResource, v_request.primitive.requestPrimitive.resourceType, vc_cSEBaseIndex); - - v_response := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier)); + + v_parentResourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_); + if(v_parentResourceIndex == -1) { + log(__SCOPE__&": ERROR: Target resource not found"); + v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier)); + + } else { + v_localResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentResourceIndex, v_request.primitive.requestPrimitive.resourceType); + v_localResourceIndex := f_setLocalResource(v_localResource, v_request.primitive.requestPrimitive.resourceType, v_parentResourceIndex); + + v_response := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier)); + v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; + } v_response.from_ := PX_CSE1_ID; v_response.to_ := v_request.primitive.requestPrimitive.from_; - v_response.primitiveContent := vc_localResourcesList[vc_localResourceIndex].resource; mccPortIn.send(m_response(v_response)); - tc_ac.start; + tc_ac.start(10.0); repeat; } [] mccPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request { @@ -2124,9 +2269,14 @@ module OneM2M_Functions { v_response.from_ := PX_CSE1_ID; v_response.to_ := v_request.primitive.requestPrimitive.from_; v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; - mccPortIn.send(m_response(v_response)); + if(ischosen(vc_localResourcesList[v_localResourceIndex].resource.cSEBase)) { + mccPortIn.send(m_response(v_response, {{"parentID", omit}})); + } else { + mccPortIn.send(m_response(v_response)); + } + } - tc_ac.start; + tc_ac.start(10.0); repeat; } [] mccPortIn.receive(mw_request(mw_update())) -> value v_request { @@ -2145,10 +2295,11 @@ module OneM2M_Functions { v_response := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier)); v_response.from_ := PX_CSE1_ID; v_response.to_ := v_request.primitive.requestPrimitive.from_; + f_cse_updateLocalResource(v_localResourceIndex, v_request.primitive.requestPrimitive.primitiveContent); v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; mccPortIn.send(m_response(v_response)); } - tc_ac.start; + tc_ac.start(10.0); repeat; } [] mccPortIn.receive (mw_request(?)){ @@ -2524,10 +2675,6 @@ module OneM2M_Functions { p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex); } } - //creator attribute - if(ispresent(p_request.primitiveContent.subscription.creator)) { - p_request.primitiveContent.subscription.creator := f_getCreator(p_parentIndex); - } //accessControlPolicyIds if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) { if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){ @@ -2870,7 +3017,7 @@ module OneM2M_Functions { log("Hierarchical method: " & v_cleanedURI); for(i:=0; i < lengthof(vc_localResourcesList); i := i+1){ - if(match(f_getResourceName(vc_localResourcesList[i].resource), v_cleanedURI)){ + if(v_cleanedURI == f_getResourceName(vc_localResourcesList[i].resource)){ v_resourceIndex := i; break; } @@ -2880,7 +3027,7 @@ module OneM2M_Functions { log("Non Hierarchical method: " & v_cleanedURI); for(i:=0; i < lengthof(vc_localResourcesList); i := i+1){ - if(match(f_getResourceId(vc_localResourcesList[i].resource), v_cleanedURI)){ + if(v_cleanedURI == f_getResourceId(vc_localResourcesList[i].resource)){ v_resourceIndex := i; break; } @@ -2889,10 +3036,11 @@ module OneM2M_Functions { log("Resource index found: " & int2str(v_resourceIndex)); //Try CSEBase if(v_resourceIndex == -1) { - if(match(f_getResourceName(vc_localResourcesList[vc_cSEBaseIndex].resource), v_cleanedURI)) { + if(v_cleanedURI == f_getResourceName(vc_localResourcesList[vc_cSEBaseIndex].resource)) { v_resourceIndex := vc_cSEBaseIndex; } } + log("Resource index found: " & int2str(v_resourceIndex)); return v_resourceIndex; } @@ -2972,13 +3120,13 @@ module OneM2M_Functions { if(p_primitiveScope == e_cseRelative) { if(p_addressingMethod == e_nonHierarchical) { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_CSE1_RESOURCE_ID; } else { return f_getResourceId(vc_localResourcesList[p_targetResourceIndex].resource); } } else { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_CSE1_NAME; } else { v_resourceAddress := f_getLocalResourceAddress(vc_localResourcesList[p_targetResourceIndex].parentIndex, p_addressingMethod, p_primitiveScope) & "/" & f_getResourceName(vc_localResourcesList[p_targetResourceIndex].resource); @@ -2988,14 +3136,14 @@ module OneM2M_Functions { } else if (p_primitiveScope == e_spRelative) { if(p_addressingMethod == e_nonHierarchical) { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_CSE1_ID & "/" & PX_CSE1_RESOURCE_ID; } else { v_resourceAddress := PX_CSE1_ID & "/" & f_getResourceId(vc_localResourcesList[p_targetResourceIndex].resource); return v_resourceAddress; } } else { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_CSE1_ID & "/" & PX_CSE1_NAME; } else { v_resourceAddress := f_getLocalResourceAddress(vc_localResourcesList[p_targetResourceIndex].parentIndex, p_addressingMethod, p_primitiveScope) & "/" & f_getResourceName(vc_localResourcesList[p_targetResourceIndex].resource); @@ -3004,14 +3152,14 @@ module OneM2M_Functions { } } else if (p_primitiveScope == e_absolute) { if(p_addressingMethod == e_nonHierarchical) { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_SP1_ID & PX_CSE1_ID; } else { v_resourceAddress := f_getLocalResourceAddress(-, p_addressingMethod, p_primitiveScope) & "/" & f_getResourceId(vc_localResourcesList[p_targetResourceIndex].resource); return v_resourceAddress; } } else { - if(p_targetResourceIndex == -1) { + if(p_targetResourceIndex == 0) { return PX_SP1_ID & PX_CSE1_ID & "/" & PX_CSE1_NAME; } else { v_resourceAddress := f_getLocalResourceAddress(vc_localResourcesList[p_targetResourceIndex].parentIndex, p_addressingMethod, p_primitiveScope) & "/" & f_getResourceName(vc_localResourcesList[p_targetResourceIndex].resource); @@ -3269,15 +3417,14 @@ module OneM2M_Functions { if (getverdict != pass) { f_cse_postamble_deleteResources(); + // Tear down if(vc_config == e_cf01) { f_cf01Down(); } else if (vc_config ==e_cf02) { - vc_cse1.start(f_cse_postamble_deleteResourcesCSE()); - vc_cse1.done; f_cf02Down(); } - stop; + kill; } } @@ -3287,7 +3434,7 @@ module OneM2M_Functions { * @param data Corresponding information for the correct execution of the given action * @verdict */ - function f_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu { + function f_aeSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu { var verdicttype v_verdict := none; @@ -3310,6 +3457,35 @@ module OneM2M_Functions { f_checkAeSimuStatus(); } + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_cseSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on CseSimu { + + var verdicttype v_verdict := none; + + tc_ac.start(15.0); + alt { + [] p_ae.done -> value v_verdict { + tc_ac.stop; + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); + } + } + + if(v_verdict == pass) { // Component was successfully completed and got stopped state + setverdict(pass); + } else { + setverdict(inconc); // Component was not completed successfully + } + + f_checkCseSimuStatus(); + } + /** * @desc Sending of an Adapter Control primitive * @param event Action to be performed by TA @@ -3323,16 +3499,15 @@ module OneM2M_Functions { // Tear down //f_cfAeTesterDown(); f_cse_postamble_deleteResourcesCSE(); + //Tear down if(vc_config == e_cf03) { f_cf03Down(); - stop; - } else if (vc_config ==e_cf04) { + } else if (vc_config ==e_cf04) { f_cf04Down(); - stop; } else if (vc_config == e_cf02CseSimuMaster) { f_cf02DownCseSimuMaster(); - stop; } + kill; } } @@ -3765,16 +3940,35 @@ module OneM2M_Functions { */ function f_getYear(charstring p_timestamp) runs on Tester return charstring { - var charstring v_year; + var charstring v_year := ""; var integer i; - for(i := 0; i < 3; i := i+1){ + for(i := 0; i <= 3; i := i+1){ v_year := v_year & p_timestamp[i]; } return v_year; } // end f_getYear + /** + * @desc Retrieve Month from a given timestamp + * @param p_timestamp Given timestamp + * @return Year + */ + function f_getMonth(charstring p_timestamp) runs on Tester return charstring { + + var charstring v_month := ""; + var integer i; + + for(i := 4; i <= 5; i := i+1){ + if(p_timestamp[i] != "0") { + v_month := v_month & p_timestamp[i]; + } + } + return v_month; + + } // end f_getYear + /** * @desc Retrieve IP address from a given address which includes port information separated by : * @param p_addressPort Given address @@ -3782,7 +3976,7 @@ module OneM2M_Functions { */ function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring { - var charstring v_ipv4Address; + var charstring v_ipv4Address := ""; var integer i:= 0; while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){ diff --git a/LibOneM2M/OneM2M_Pics.ttcn b/LibOneM2M/OneM2M_Pics.ttcn index abdd8b751b92dc9b0c34e674787aa5f6508a59a2..2b4a6cd68159cbf29eb702860e1210b4b8a1172e 100644 --- a/LibOneM2M/OneM2M_Pics.ttcn +++ b/LibOneM2M/OneM2M_Pics.ttcn @@ -28,83 +28,86 @@ module OneM2M_Pics { modulepar boolean PICS_PRIMITIVE_SCOPE_SP_RELATIVE := true; modulepar boolean PICS_PRIMITIVE_SCOPE_ABSOLUTE := true; - //AccessControlPolicy optional attributes - - modulepar boolean PICS_ACP_LBL := true; - modulepar boolean PICS_ACP_AT := true; - - //AE optional attributes - - modulepar boolean PICS_AE_LBL := true; - modulepar boolean PICS_AE_APN := true; - modulepar boolean PICS_AE_POA := true; - modulepar boolean PICS_AE_NL := true; - modulepar boolean PICS_AE_CSZ := true; - modulepar boolean PICS_AE_OR := true; - modulepar boolean PICS_AE_ACPI := true; - - //Container optional attributes - - modulepar boolean PICS_CNT_ACPI := true; - modulepar boolean PICS_CNT_MNI := true; - modulepar boolean PICS_CNT_MBS := true; - modulepar boolean PICS_CNT_MIA := true; - modulepar boolean PICS_CNT_OR := true; - modulepar boolean PICS_CNT_LI := true; - modulepar boolean PICS_CNT_RN := true; - modulepar boolean PICS_CNT_ET := true; - modulepar boolean PICS_CNT_LBL := true; - modulepar boolean PICS_CNT_CR := true; - - //ContentInstance optional attributes - - modulepar boolean PICS_CIN_CNF := true; - modulepar boolean PICS_CIN_RN := true; - modulepar boolean PICS_CIN_ET := true; - modulepar boolean PICS_CIN_LBL := true; - modulepar boolean PICS_CIN_CR := true; - modulepar boolean PICS_CIN_OR := true; - - //CSEBase optional attributes - - modulepar boolean PICS_CB_CST := true; - modulepar boolean PICS_CB_NL := true; - - //Group optional attributes - - modulepar boolean PICS_GRP_LBL := true; - modulepar boolean PICS_GRP_GN := true; - modulepar boolean PICS_GRP_ACPI := true; - modulepar boolean PICS_GRP_MACP := true; - - //RemoteCSE optional attributes - - modulepar boolean PICS_CSR_LBL := true; - modulepar boolean PICS_CSR_CST := true; - modulepar boolean PICS_CSR_POA := true; - modulepar boolean PICS_CSR_NL := true; - modulepar boolean PICS_CSR_RN := true; - modulepar boolean PICS_CSR_ET := true; - modulepar boolean PICS_CSR_RR := true; - - //Subscription optional attributes - - modulepar boolean PICS_SUB_ACPI := true; - modulepar boolean PICS_SUB_ENC := true; - modulepar boolean PICS_SUB_EXC := true; - modulepar boolean PICS_SUB_NFU := true; - modulepar boolean PICS_SUB_NCT := true; - modulepar boolean PICS_SUB_NEC := true; - modulepar boolean PICS_SUB_SU := true; - modulepar boolean PICS_SUB_LBL := true; - modulepar boolean PICS_SUB_GPI := true; - modulepar boolean PICS_SUB_BN := true; - modulepar boolean PICS_SUB_RL := true; - modulepar boolean PICS_SUB_PN := true; - modulepar boolean PICS_SUB_NSP := true; - modulepar boolean PICS_SUB_LN := true; - modulepar boolean PICS_SUB_PSN := true; - modulepar boolean PICS_SUB_CR := true; + group ResourceOptionalAttributes { + //AccessControlPolicy optional attributes + group AccessControlPolicyOptionalAttributes { + modulepar boolean PICS_ACP_LBL := true; + modulepar boolean PICS_ACP_AT := true; + } + //AE optional attributes + group AeOptionalAttributes { + modulepar boolean PICS_AE_LBL := true; + modulepar boolean PICS_AE_APN := true; + modulepar boolean PICS_AE_POA := true; + modulepar boolean PICS_AE_NL := true; + modulepar boolean PICS_AE_CSZ := true; + modulepar boolean PICS_AE_OR := true; + modulepar boolean PICS_AE_ACPI := true; + } + //Container optional attributes + group ContainerOptionalAttributes { + modulepar boolean PICS_CNT_ACPI := true; + modulepar boolean PICS_CNT_MNI := true; + modulepar boolean PICS_CNT_MBS := true; + modulepar boolean PICS_CNT_MIA := true; + modulepar boolean PICS_CNT_OR := true; + modulepar boolean PICS_CNT_LI := true; + modulepar boolean PICS_CNT_RN := true; + modulepar boolean PICS_CNT_ET := true; + modulepar boolean PICS_CNT_LBL := true; + modulepar boolean PICS_CNT_CR := true; + } + //ContentInstance optional attributes + group ContentInstanceOptionalAttributes { + modulepar boolean PICS_CIN_CNF := true; + modulepar boolean PICS_CIN_RN := true; + modulepar boolean PICS_CIN_ET := true; + modulepar boolean PICS_CIN_LBL := true; + modulepar boolean PICS_CIN_CR := true; + modulepar boolean PICS_CIN_OR := true; + } + //CSEBase optional attributes + group CSEBaseOptionalAttributes { + modulepar boolean PICS_CB_CST := true; + modulepar boolean PICS_CB_NL := true; + } + //Group optional attributes + group GroupOptionalAttributes { + modulepar boolean PICS_GRP_LBL := true; + modulepar boolean PICS_GRP_GN := true; + modulepar boolean PICS_GRP_ACPI := true; + modulepar boolean PICS_GRP_MACP := true; + } + //RemoteCSE optional attributes + group RemoteCSEOptionalAttributes { + modulepar boolean PICS_CSR_LBL := true; + modulepar boolean PICS_CSR_CST := true; + modulepar boolean PICS_CSR_POA := true; + modulepar boolean PICS_CSR_NL := true; + modulepar boolean PICS_CSR_RN := true; + modulepar boolean PICS_CSR_ET := true; + modulepar boolean PICS_CSR_RR := true; + } + //Subscription optional attributes + group SubscriptionOptionalAttributes { + modulepar boolean PICS_SUB_ACPI := true; + modulepar boolean PICS_SUB_ENC := true; + modulepar boolean PICS_SUB_EXC := true; + modulepar boolean PICS_SUB_NFU := true; + modulepar boolean PICS_SUB_NCT := true; + modulepar boolean PICS_SUB_NEC := true; + modulepar boolean PICS_SUB_SU := true; + modulepar boolean PICS_SUB_LBL := true; + modulepar boolean PICS_SUB_GPI := true; + modulepar boolean PICS_SUB_BN := true; + modulepar boolean PICS_SUB_RL := true; + modulepar boolean PICS_SUB_PN := true; + modulepar boolean PICS_SUB_NSP := true; + modulepar boolean PICS_SUB_LN := true; + modulepar boolean PICS_SUB_PSN := true; + modulepar boolean PICS_SUB_CR := true; + } + } } // end of module diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index 35c02075c1f69398a13ebcdbfe5363b97b9348b3..691c0dffae8d8b08a5e7c2b54b3437b38f854945 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -21,9 +21,11 @@ module OneM2M_Pixits { group IutParameters { - modulepar boolean PX_MN_CSE := true; + modulepar boolean PX_IN_CSE := true; - modulepar boolean PX_IN_CSE := false; + modulepar boolean PX_MN_CSE := false; + + modulepar boolean PX_ASN_CSE:= false; modulepar charstring PX_SUT_ADDRESS := "127.0.0.1:8080"; @@ -67,6 +69,8 @@ module OneM2M_Pixits { modulepar XSD.IDREFS PX_NOT_ALLOWED_S_AE_IDS := {"S-NotAllowedAeId"}; + modulepar XSD.ID PX_NOT_ALLOWED_APP_ID := "NotAllowedAppId"; + modulepar AddressingMethod PX_ADDRESSING_METHOD := e_hierarchical; modulepar PrimitiveScope PX_PRIMITIVE_SCOPE := e_cseRelative; @@ -78,6 +82,8 @@ module OneM2M_Pixits { modulepar charstring PX_XML_NAMESPACE := "m2m=""http://www.onem2m.org/xml/protocols"""; modulepar ListOfURIs PX_ACOR := {"all"}; + + modulepar float PX_TCONFIG_IUT := 10.0; } @@ -138,13 +144,6 @@ module OneM2M_Pixits { modulepar boolean PX_RUN_POSTAMBLE := true; } - - - //for checking whether the locationPolicy creation request is originated from a ASN-AE - //NOTE: Apply to Device-based location request, and this requires Test System (TS) to activate ASN-AE mode to test IUT - modulepar boolean PX_IUT_IS_ASN_CSE := false; //default //set it to true when running Device-based location testcases - modulepar boolean PX_IUT_IS_MN_CSE := false; //default //set it to true when running Share-based location testcases - modulepar boolean PX_IUT_IS_IN_CSE := false; //default //set it to true when running Share-based location testcases //constant parameters for LOC modulepar LocationTargetID PX_LOCATION_TARGET_ID := {alt_ := "{LOCATION-TARGET-ID}"}; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index f7a382183b3ca4f8ae5139113af69a3789df2bf6..c96334f472a3344f877a7d22a7c0f718229ce6d0 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -76,16 +76,18 @@ module OneM2M_Templates { forcedFields := p_forcedFields }; - template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := { - primitive := { requestPrimitive := p_requestPrimitive} + template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive, template AttributeList_1 p_nullFields := *) := { + primitive := { requestPrimitive := p_requestPrimitive}, + nullFields := p_nullFields }; /** * @desc Base template for response receiving operations * @param p_responsePrimitive */ - template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?) := { - primitive := { responsePrimitive := p_responsePrimitive} + template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?, template AttributeList_1 p_nullFields := *) := { + primitive := { responsePrimitive := p_responsePrimitive}, + nullFields := p_nullFields }; }//end of group primitives @@ -129,7 +131,7 @@ module OneM2M_Templates { * @desc Base Receive RETRIEVE request primitive * @param p_targetResourceAddress Target resource address */ - template RequestPrimitive mw_retrieve(XSD.ID p_targetResourceAddress) := { + template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := { operation := int2, to_ := p_targetResourceAddress, from_ := ?, @@ -333,10 +335,10 @@ module OneM2M_Templates { }; /** - * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field - * @param p_targetResourceAddress Target resource address - * @param p_filterCriteria FilterCriteria - * @param p_originator Originator (from) + * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field + * @param p_targetResourceAddress Target resource address + * @param p_filterCriteria FilterCriteria + * @param p_originator Originator (from) */ template (value) RequestPrimitive m_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), @@ -649,9 +651,7 @@ module OneM2M_Templates { /** * @desc Reception template for CREATE AEAnnc */ - template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template (omit) AcpType p_accessControlPolicyIds := omit, template XSD.AnyURI p_link := ?) modifies mw_create := { - resourceType := int10002, - primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)} + template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := { primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)} }; template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName := c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := { @@ -995,9 +995,9 @@ module OneM2M_Templates { */ template (value) RequestPrimitive m_createScheduleBase modifies m_create := { requestIdentifier := testcasename() & "-m_createSchedule", - resourceType := int18, - primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 * *"}})} - }; + resourceType := int18, + primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 *"}})} + }; template (value) RequestPrimitive m_createSchedule(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name, in template (value) ScheduleEntries p_scheduleElement ) modifies m_create := { to_ := p_parentResourceAddress, @@ -1469,7 +1469,7 @@ module OneM2M_Templates { accessControlRule_list := {valueof(m_createAcr(p_acor, p_allowedOperations))} },//M selfPrivileges := { - accessControlRule_list := {valueof(m_createAcr(p_acor, int63))} + accessControlRule_list := {valueof(m_createAcr({"all"}, int63))} },//M choice := omit //NP }; @@ -3079,7 +3079,7 @@ module OneM2M_Templates { resourceType := int16,//M resourceID := PX_CSE1_RESOURCE_ID,//M pointOfAccess := {PX_CSE1_ADDRESS},//O - cSEBase := PX_CSE1_NAME,//M + cSEBase := PX_CSE1_ID & "/" & PX_CSE1_NAME,//M cSE_ID := PX_CSE1_ID,//M requestReachability := true//M }; @@ -3651,7 +3651,7 @@ module OneM2M_Templates { resourceName := ?,//M resourceType := ?,//M resourceID := ?,//M - parentID := ?,//M + parentID := omit,//M creationTime := ?,//M lastModifiedTime := ?,//M labels := *,//O diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index 1cdc879112bd1adc60231581747eba31dcd6c9f2..3e8e31e87931b6e52bf0cb2edc0d494c7323d9fb 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -1231,7 +1231,11 @@ with { }; -type XSD.Token DeviceID (pattern "urn:meid:[\dABCDEFabcdef]#(14)") +type XSD.Token DeviceID (pattern "(urn:dev:ops:[\dABCDEFabcdef]#6-[\w_%]#(1,)-[\w_%]#(1,))" & "|" & + "(urn:dev:os:[\dABCDEFabcdef]#6-[\w_%]#(1,))" & "|" & + "(urn:imei:\d#15)" & "|" & + "(urn:esn:[\dABCDEFabcdef]#8)" & "|" & + "(urn:meid:[\dABCDEFabcdef]#14)") with { variant "name as uncapitalized"; }; @@ -1317,13 +1321,25 @@ with { -type XSD.Token Ipv4 (pattern "[0-9A-Fa-f]#(8)(/([0-9]|[1-2][0-9]|3[0-2]))#(0,1)") +type XSD.Token Ipv4 (pattern "([0-9A-Fa-f]#(8)(/([0-9]|[1-2][0-9]|3[0-2]))#(0,1))" & "|" & + "((25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])(/([0-9]|[1-2][0-9]|3[0-2]))#(0,1))") with { variant "name as uncapitalized"; }; -type XSD.Token Ipv6 (pattern "::(/0)#(0,1)") +type XSD.Token Ipv6 (pattern "([0-9A-Fa-f]#(1,4)(:[0-9A-Fa-f]#(1,4))#7(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(:(:[0-9A-Fa-f]#(1,4))#(1,7))" & "|" & //Double colon start +"(([0-9A-Fa-f]#(1,4):)#(1,6)(:[0-9A-Fa-f]#(1,4))#1(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & //Double colon middle +"(([0-9A-Fa-f]#(1,4):)#(1,5)(:[0-9A-Fa-f]#(1,4))#(1,2)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(([0-9A-Fa-f]#(1,4):)#(1,4)(:[0-9A-Fa-f]#(1,4))#(1,3)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(([0-9A-Fa-f]#(1,4):)#(1,3)(:[0-9A-Fa-f]#(1,4))#(1,4)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(([0-9A-Fa-f]#(1,4):)#(1,2)(:[0-9A-Fa-f]#(1,4))#(1,5)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(([0-9A-Fa-f]#(1,4):)#1(:[0-9A-Fa-f]#(1,4))#(1,6)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & +"(([0-9A-Fa-f]#(1,4):)#(1,7):(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))#(0,1))" & "|" & //Double colon end +"(((:(:0#(1,4))#(0,3)(:(0#(1,4)|[fF]#4))#(0,1))|(0#(1,4):(:0#(1,4))#(0,2)(:(0#(1,4)|[fF]#4))#(0,1))|((0#(1,4):)#2(:0#(1,4))#(0,1)(:(0#(1,4)|[fF]#4))#(0,1))|((0#(1,4):)#3(:(0#(1,4)|[fF]#4))#(0,1))|((0#(1,4):)#4(0#(1,4)|[fF]#4)#(0,1))):(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9])\.(25[0-5]|2[0-4][0-9]|[0-1]#(0,1)[0-9]#(0,1)[0-9]))" & "|" & //Embedded IPv4 addresses without CIDR suffix. Should IPv4 CIDR suffix be added +"(::(/0)#(0,1))") //The unspecified address + with { variant "name as uncapitalized"; }; @@ -1419,7 +1435,9 @@ with { }; -type XSD.String ContentInfo //FIXME To be fixed (pattern "[\w/!#$\^_.+\q{0, 0, 0, 38}&\-]+((:[0-2])#(0,1))+((:[0-5])#(0,1))") +type XSD.String ContentInfo //TODO To be fixed (pattern "([\w/!#$^_.#(1,)&\-]#(1,)(:[0-2])#(0,1))" & "|" & + // "([\w/!#$^_.#(1,)&\-]#(1,)((:[0-2])#(0,1))#(1,)((:[0-5])#(0,1)))") + with { variant "name as uncapitalized"; }; @@ -5448,9 +5466,10 @@ with { }; -type ListOfURIs URIList +type record length(0 .. infinity) of XSD.AnyURI URIList //TODO Allow URIList to be empty as defined in PRO with { - variant "element";//Change from previous version "list" + variant "name as uncapitalized"; + variant "list"; }; @@ -6518,7 +6537,8 @@ with { union { RequestPrimitive requestPrimitive, ResponsePrimitive responsePrimitive - } primitive + } primitive, + AttributeList_1 nullFields optional } with { encode "" @@ -8319,7 +8339,11 @@ group OtherTypes { variant "untagged"; } - type record of ResourceType ResourceTypeList_1; + type record of ResourceType ResourceTypeList_1 + with { + variant "name as uncapitalized"; + variant "list"; + }; } } with { diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 1580cbf0e53222ba1c609063e74b95ba0e271b21..4e628826f1812ef4201eade13f4f7f08a4d15200 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -1405,7 +1405,7 @@ module OneM2M_PermutationFunctions { } - function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in charstring p_action) runs on CseSimu { + function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { var ResponsePrimitive v_responsePrimitive; @@ -1795,8 +1795,12 @@ module OneM2M_PermutationFunctions { if(ispresent(p_parentRequestPrimitive)) { if(match(int23, p_parentRequestPrimitive.resourceType)){ - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; + vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_ae2Index := f_getResource(vc_ae2); p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); @@ -1830,8 +1834,10 @@ module OneM2M_PermutationFunctions { // Test Body if(match(int23, p_requestPrimitive.resourceType)){ - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; + vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); v_ae2Index := f_getResource(vc_ae2); p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); @@ -1902,8 +1908,10 @@ module OneM2M_PermutationFunctions { vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); if(match(int23, p_resourceType)){ - vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered - vc_ae1.done; + vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); v_ae1Index := f_getResource(vc_ae1); p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); @@ -1938,7 +1946,7 @@ module OneM2M_PermutationFunctions { f_checkCseSimuStatus(); //Check to see if the resource is present or not - if (f_isResourcePresentCseSimu(v_resourceIndex)){ + if (f_cse_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2666,9 +2674,9 @@ module OneM2M_PermutationFunctions { // Preamble - if (PX_IUT_IS_MN_CSE == true) { + if (PX_MN_CSE) { vc_cse1.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase)); - }else if (PX_IUT_IS_IN_CSE == true) { + }else if (PX_IN_CSE) { vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); } vc_cse1.done; @@ -2792,16 +2800,17 @@ module OneM2M_PermutationFunctions { // Test adapter configuration // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) + if(p_resourceType != int1) { + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int61);//c_CRUDNDi) + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); + } - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - f_cse_updateAcpAuxResource(int61); //c_CUDNDi - // Test Body mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); @@ -4973,9 +4982,17 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitiveChildResource, p_childResourceType); + v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); + if((p_resourceType == int23) or (p_childResourceType == int23)) { + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); + } + f_cse_deleteResource(v_resourceIndex); + + f_checkAeSimuStatus(); // Test Body mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); @@ -5857,7 +5874,6 @@ module OneM2M_PermutationFunctions { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_acpIndex := -1; var charstring v_currentTime; var RequestPrimitive v_createRequest; var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); @@ -5872,11 +5888,11 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); v_currentTime := fx_generateTimestamp(); - v_accessControlRule.accessControlContexts_list := {{{"* * * * * " & f_getYear(v_currentTime)}, omit, omit}}; + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & f_getMonth(v_currentTime) & " *"}, omit, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, -); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -5889,6 +5905,9 @@ module OneM2M_PermutationFunctions { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + if(p_responseStatusCode == int2002) { + f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; @@ -5905,6 +5924,8 @@ module OneM2M_PermutationFunctions { //Postamble + f_cse_updateAcpAuxResource(int63); + f_cse_postamble_deleteResources(); //Tear down @@ -5915,8 +5936,9 @@ module OneM2M_PermutationFunctions { function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ // Local variables var MsgIn v_response; + var charstring v_month; + var charstring v_currentTime; var integer v_aeIndex := -1; - var integer v_acpIndex := -1; var RequestPrimitive v_createRequest; var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); @@ -5929,11 +5951,18 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{"* * * * * 3000"}, omit, omit}}; + v_currentTime := fx_generateTimestamp(); + v_month := f_getMonth(v_currentTime); + if(v_month =="12") { + v_month := "1"; + } else { + v_month := int2char(char2int(v_month) + 1); + } + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & v_month & " *"}, omit, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, -); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -5954,6 +5983,9 @@ module OneM2M_PermutationFunctions { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + if(p_responseStatusCode == int2002) { + f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex); + } } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation"); @@ -5962,6 +5994,8 @@ module OneM2M_PermutationFunctions { //Postamble + f_cse_updateAcpAuxResource(int63); + f_cse_postamble_deleteResources(); //Tear down @@ -6089,7 +6123,6 @@ module OneM2M_PermutationFunctions { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_acpIndex := -1; var RequestPrimitive v_createRequest; var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); @@ -6104,9 +6137,9 @@ module OneM2M_PermutationFunctions { v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE1_ADDRESS)}, omit}, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -6119,6 +6152,9 @@ module OneM2M_PermutationFunctions { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + if(p_responseStatusCode == int2002) { + f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; @@ -6135,6 +6171,8 @@ module OneM2M_PermutationFunctions { //Postamble + f_cse_updateAcpAuxResource(int63); + f_cse_postamble_deleteResources(); //Tear down @@ -6146,7 +6184,6 @@ module OneM2M_PermutationFunctions { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_acpIndex := -1; var RequestPrimitive v_createRequest; var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); @@ -6159,11 +6196,11 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE2_ADDRESS)}, omit}, omit}}; + v_accessControlRule.accessControlContexts_list := {{{}, {{"240.0.0.0"}, omit}, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -6184,6 +6221,9 @@ module OneM2M_PermutationFunctions { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + if(p_responseStatusCode == int2002) { + f_removeElementFromList(vc_resourcesIndexToBeDeleted, v_aeIndex); + } } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation"); @@ -6192,6 +6232,8 @@ module OneM2M_PermutationFunctions { //Postamble + f_cse_updateAcpAuxResource(int63); + f_cse_postamble_deleteResources(); //Tear down diff --git a/OneM2M_TestControl_IN_profile.ttcn b/OneM2M_TestControl_IN_profile.ttcn index be9f03b3b4b9c72cb4cb510f40e4882e31090b49..b092d21801bdbac1d5e5119e079a417d20c7e736 100644 --- a/OneM2M_TestControl_IN_profile.ttcn +++ b/OneM2M_TestControl_IN_profile.ttcn @@ -128,7 +128,6 @@ module OneM2M_TestControl_IN_profile { if(PICS_CNT_MNI and PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL());} if(true) {execute (TC_CSE_DMR_UPD_005());} if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());} if(true) {execute (TC_CSE_DMR_UPD_009_CNT_EXC());} if(true) {execute (TC_CSE_DMR_UPD_010 ());} if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());} @@ -186,7 +185,7 @@ module OneM2M_TestControl_IN_profile { if(PICS_SUB_LBL) {execute (TC_CSE_DMR_UPD_003_SUB_LBL());} if(PICS_SUB_LBL and PICS_SUB_EXC) {execute (TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC());} if(true) {execute (TC_CSE_DMR_UPD_007_SUB_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_SUB_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_SUB_NU());} if(true) {execute (TC_CSE_DMR_UPD_009_SUB_MNI());} if(true) {execute (TC_CSE_DMR_UPD_016_SUB_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_SUB_NU());} @@ -216,9 +215,9 @@ module OneM2M_TestControl_IN_profile { if(true) {execute (TC_CSE_DMR_UPD_001_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_002_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_003_ACP_LBL());} - if(PICS_ACP_AT and PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL());} + if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_ACP_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_ACP_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_ACP_PVS());} if(true) {execute (TC_CSE_DMR_UPD_009_ACP_EXC());} if(true) {execute (TC_CSE_DMR_UPD_016_ACP_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_ACP_PV());} @@ -336,7 +335,7 @@ module OneM2M_TestControl_IN_profile { if(PICS_GRP_GN and PICS_GRP_LBL) {execute (TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL());} if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_UPD_006_GRP_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_GRP_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_GRP_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_GRP_MNM());} if(true) {execute (TC_CSE_DMR_UPD_009_GRP_EXC());} if(true) {execute (TC_CSE_DMR_UPD_016_GRP_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_GRP_MNM());} diff --git a/OneM2M_TestControl_MN_profile.ttcn b/OneM2M_TestControl_MN_profile.ttcn index 4516fc0e594446a45ef0c05fdacc8aeba7bc3fc0..955d385c773d28bbed49ca1345b138951cf53166 100644 --- a/OneM2M_TestControl_MN_profile.ttcn +++ b/OneM2M_TestControl_MN_profile.ttcn @@ -151,7 +151,6 @@ module OneM2M_TestControl_MN_profile { if(PICS_CNT_MNI and PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL());} if(true) {execute (TC_CSE_DMR_UPD_005());} if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());} if(true) {execute (TC_CSE_DMR_UPD_009_CNT_EXC());} if(true) {execute (TC_CSE_DMR_UPD_010());} if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());} @@ -209,7 +208,7 @@ module OneM2M_TestControl_MN_profile { if(PICS_SUB_LBL) {execute (TC_CSE_DMR_UPD_003_SUB_LBL());} if(true) {execute (TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC());} if(true) {execute (TC_CSE_DMR_UPD_007_SUB_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_SUB_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_SUB_NU());} if(true) {execute (TC_CSE_DMR_UPD_009_SUB_MNI());} if(true) {execute (TC_CSE_DMR_UPD_016_SUB_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_SUB_NU());} @@ -239,9 +238,9 @@ module OneM2M_TestControl_MN_profile { if(true) {execute (TC_CSE_DMR_UPD_001_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_002_ACP_LBL());} if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_003_ACP_LBL());} - if(true) {execute (TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL());} + if(PICS_ACP_LBL) {execute (TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_ACP_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_ACP_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_ACP_PVS());} if(true) {execute (TC_CSE_DMR_UPD_009_ACP_EXC());} if(true) {execute (TC_CSE_DMR_UPD_016_ACP_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_ACP_PV());} @@ -358,7 +357,7 @@ module OneM2M_TestControl_MN_profile { if(true) {execute (TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL());} if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_UPD_006_GRP_LBL());} if(true) {execute (TC_CSE_DMR_UPD_007_GRP_CT());} - if(true) {execute (TC_CSE_DMR_UPD_008_GRP_ET());} + if(true) {execute (TC_CSE_DMR_UPD_008_GRP_MNM());} if(true) {execute (TC_CSE_DMR_UPD_009_GRP_EXC());} if(true) {execute (TC_CSE_DMR_UPD_016_GRP_ET());} if(true) {execute (TC_CSE_DMR_UPD_016_GRP_MNM());} diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index dc06935c148d21d095d7ba70534e27fef135f626..9c8941ea85b9da6816983cb9850db3562b8c7fff 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -386,7 +386,7 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; - var charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is allowed to register: " & PX_ALLOWED_C_AE_IDS[0]; + var universal charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is allowed to register: " & PX_ALLOWED_C_AE_IDS[0]; //Test control if(not(PICS_IN_CSE)) { @@ -399,7 +399,7 @@ module OneM2M_Testcases_CSE_Release_1 { //Preamble action(v_action); - f_sleepIgnoreDef(30.0); + f_sleepIgnoreDef(PX_TCONFIG_IUT); //Test Body v_request := valueof(m_createAe(PX_APP_ID, omit, f_getResourceAddress(-1, -, e_spRelative) & "/" & PX_ALLOWED_C_AE_IDS[0])); @@ -435,7 +435,7 @@ module OneM2M_Testcases_CSE_Release_1 { } /** - * @desc Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME of the AE resource + * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned AE_ID of AE-ID-Stem format. * */ testcase TC_CSE_REG_CRE_002() runs on AeSimu system CseSystem { @@ -453,7 +453,7 @@ module OneM2M_Testcases_CSE_Release_1 { //Preamble //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); + v_request := valueof(m_createAe(PX_APP_ID, omit, PX_ALLOWED_C_AE_IDS[0])); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); @@ -513,7 +513,7 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; - var charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is not allowed to register: " & PX_NOT_ALLOWED_C_AE_IDS[0]; + var universal charstring v_action := __SCOPE__ & ": Please, make sure that the following AE-ID is not allowed to register: " & PX_NOT_ALLOWED_C_AE_IDS[0]; //Test control @@ -525,7 +525,7 @@ module OneM2M_Testcases_CSE_Release_1 { //TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule //v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi); action(v_action); - f_sleepIgnoreDef(30.0); + f_sleepIgnoreDef(PX_TCONFIG_IUT); //Test Body //v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); @@ -535,14 +535,20 @@ module OneM2M_Testcases_CSE_Release_1 { mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, creating AE with not allowed AE-ID "); + f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } @@ -562,9 +568,11 @@ module OneM2M_Testcases_CSE_Release_1 { */ testcase TC_CSE_REG_CRE_005() runs on InCseSimu system CseSystem { - var RequestPrimitive v_request; + var MsgIn v_request; + var template RequestPrimitive v_requestPrimitive; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; + var boolean v_handleResponses := false; //Test control @@ -577,26 +585,38 @@ module OneM2M_Testcases_CSE_Release_1 { //Test Body vc_ae1.start(f_cse_sendCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, -, "S", omit))); vc_ae1.done; + + v_requestPrimitive := mw_createAEAnnc(PX_CSE_ID & "/S", -, -, -); + v_requestPrimitive.primitiveContent.aEAnnc.app_ID := PX_APP_ID; tc_ac.start; alt{ - [] mccPortIn.receive(mw_request(mw_createAEAnnc(PX_CSE_ID, f_getResourceAddress(-1,e_hierarchical, e_spRelative) & "/S", -))){ + [] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); + v_handleResponses := true; } - [] mccPortIn.receive(mw_request(mw_createAEAnnc(PX_CSE_ID, f_getResourceAddress(-1,e_hierarchical, e_absolute) & "/S", -))){ + [] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request { tc_ac.stop; - setverdict(pass, __SCOPE__ & ": AE creation redirected."); + setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters"); + v_handleResponses := true; + } + [] mccPortIn.receive(mw_request(?))-> value v_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected message received"); + v_handleResponses := true; } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - - /*vc_cse1.start(f_cse_receiveCreateRequest(mw_createAEAnnc(-, -, -))); - vc_cse1.done;*/ - + // Postamble + if (v_handleResponses) { + vc_ae1.start(f_cse_receiveResponse()); + f_cse_sendResponse(v_request); + vc_ae1.done; + } f_cse_postamble_deleteResourcesCSE(); // Tear down @@ -675,7 +695,7 @@ module OneM2M_Testcases_CSE_Release_1 { mcaPort.send(m_request(f_getCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, "S"),-1))); - vc_cse1.start(f_cse_resourceAnnouncementHandler()); + vc_cse1.start(f_cse_announcementProcedure_createHandler()); vc_cse1.done; //Test Body @@ -731,7 +751,8 @@ module OneM2M_Testcases_CSE_Release_1 { vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE); vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S"))); - vc_ae1.done; + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + //TODO: //v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); @@ -781,7 +802,7 @@ module OneM2M_Testcases_CSE_Release_1 { //Test control if(not(PICS_IN_CSE)) { - setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); + setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case"); stop; } @@ -793,7 +814,7 @@ module OneM2M_Testcases_CSE_Release_1 { vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); //Create AEAnnc - v_aeAnncIndex := f_cse_announceResource(int2, m_createAEAnnc(-, PX_CSE1_ID & "/" & "S", PX_APP_ID, PX_CSE1_ID & "/" & "S")); + v_aeAnncIndex := f_cse_announcementProcedure_announceResource(int2, m_createAEAnnc(-, PX_CSE1_ID & "/" & "S", PX_APP_ID, PX_CSE1_ID & "/" & "S")); //Update AEAnnc to simulate deregistration of AE v_request := f_getUpdateRequestPrimitive(f_getAnnouncedResourceType(int2),v_aeAnncIndex, valueof(m_updateAEAnncBase));//TODO @@ -859,9 +880,9 @@ module OneM2M_Testcases_CSE_Release_1 { vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE)); vc_cse1.done; - v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM")); + v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, PX_ALLOWED_S_AE_IDS[0])); - vc_cse1.start(f_cse_resourceAnnouncementHandler()); + vc_cse1.start(f_cse_announcementProcedure_createHandler()); vc_cse1.done; //TODO Deregister @@ -872,7 +893,7 @@ module OneM2M_Testcases_CSE_Release_1 { //Test Body f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource))); - vc_cse1.start(f_cse_resourceAnnouncementHandler(mw_createAEAnnc(PX_CSE_ID, -, -, -))); + vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc(PX_CSE_ID, -, -, -))); vc_cse1.done; tc_ac.start; @@ -974,7 +995,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_012_AE_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); + var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM); v_create.primitiveContent.aE.labels := {"labels"}; v_ae1.start(f_CSE_REG_CRE_012(v_create)); @@ -983,7 +1004,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_012_AE_APN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); + var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM); v_create.primitiveContent.aE.appName := "AeAppName"; v_ae1.start(f_CSE_REG_CRE_012(v_create)); @@ -992,7 +1013,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_012_AE_POA() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); + var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM); v_create.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS}; v_ae1.start(f_CSE_REG_CRE_012(v_create)); @@ -1070,7 +1091,7 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; - var charstring v_action := __SCOPE__ & ": Please, make sure that the following AppId is not allowed to register: " & PX_APP_ID; + var universal charstring v_action := __SCOPE__ & ": Please, make sure that the following AppId is not allowed to register: " & PX_APP_ID; //Test control @@ -1079,24 +1100,30 @@ module OneM2M_Testcases_CSE_Release_1 { //Preamble action(v_action); - f_sleepIgnoreDef(30.0); + f_sleepIgnoreDef(PX_TCONFIG_IUT); // Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); + v_request := valueof(m_createAe(PX_NOT_ALLOWED_APP_ID, -, PX_AE1_ID_STEM, -, -)); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, creating AE with not allowed APP-ID "); + f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } @@ -1119,7 +1146,7 @@ module OneM2M_Testcases_CSE_Release_1 { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); + var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM); v_createRequest.primitiveContent.aE.app_ID := omit; //Mandatory app_ID field is being set empty @@ -1131,7 +1158,7 @@ module OneM2M_Testcases_CSE_Release_1 { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); + var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM); v_createRequest.primitiveContent.aE.requestReachability := omit; //Mandatory requestReachability field is being set empty @@ -1271,7 +1298,7 @@ module OneM2M_Testcases_CSE_Release_1 { vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE)); vc_cse1.done; - v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); + v_request := valueof(m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM)); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); @@ -1294,7 +1321,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - vc_cse1.start(f_cse_notifyProcedure_updateHandler()); + vc_cse1.start(f_cse_announcementProcedure_updateHandler()); vc_cse1.done; //Test body @@ -1496,7 +1523,7 @@ module OneM2M_Testcases_CSE_Release_1 { // Local variables var ResponsePrimitive v_responsePrimitive; var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with attributes multiplicity equals to 1"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with attributes multiplicity equals to 1"; //Test control if(not(PICS_MN_CSE or PICS_ASN_CSE)) { @@ -1605,7 +1632,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_RN() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute resourceName"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute resourceName"; v_utRequest.primitiveContent.remoteCSE.resourceName := "UNINITIALIZED"; v_request.primitiveContent.remoteCSE.resourceName := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1614,7 +1641,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_ET() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute expirationTime"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute expirationTime"; v_utRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; v_request.primitiveContent.remoteCSE.expirationTime := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1623,7 +1650,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_LBL() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute labels"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute labels"; v_utRequest.primitiveContent.remoteCSE.labels := {"UNINITIALIZED"}; v_request.primitiveContent.remoteCSE.labels := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1632,7 +1659,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_POA() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute pointOfAccess"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute pointOfAccess"; v_utRequest.primitiveContent.remoteCSE.pointOfAccess := {"UNINITIALIZED"}; v_request.primitiveContent.remoteCSE.pointOfAccess := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1641,7 +1668,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_NL() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute nodeLink"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute nodeLink"; v_utRequest.primitiveContent.remoteCSE.nodeLink := "UNINITIALIZED"; v_request.primitiveContent.remoteCSE.nodeLink := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1650,7 +1677,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_CRE_026_CST() runs on CseSimu system CseSystem { var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; var template RequestPrimitive v_request := mw_createRemoteCSE; - var charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute cseType"; + var universal charstring v_action := __SCOPE__ & ": Please, send a CSE registration request with optional attribute cseType"; v_utRequest.primitiveContent.remoteCSE.cseType := int1;//TODO It should be marked as "UNITIALIZED" v_request.primitiveContent.remoteCSE.cseType := ?; f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); @@ -1797,7 +1824,7 @@ module OneM2M_Testcases_CSE_Release_1 { tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse), {"parentID"})) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } @@ -1925,7 +1952,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem { // Local variables var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); + var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM); var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; @@ -1941,7 +1968,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_RET_004_APN() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); + var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.appName := "AeAppName"; @@ -1956,7 +1983,7 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_REG_RET_004_POA() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); + var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS}; @@ -2003,7 +2030,7 @@ module OneM2M_Testcases_CSE_Release_1 { tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse), {"parentID"})) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)"); } @@ -2052,7 +2079,7 @@ module OneM2M_Testcases_CSE_Release_1 { // Test adapter configuration // Preamble - if(PICS_IN_CSE){ + if(PX_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; @@ -2081,7 +2108,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - } else if (PICS_MN_CSE) { + } else if (PX_MN_CSE) { vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; @@ -2216,7 +2243,7 @@ module OneM2M_Testcases_CSE_Release_1 { tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse), {"parentID"})) -> value v_response { tc_ac.stop; if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.supportedResourceType == PX_SRT) { @@ -2269,7 +2296,7 @@ module OneM2M_Testcases_CSE_Release_1 { var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; var template UtTriggerPrimitive v_utRequest; - var charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS; // Test control if(not(PICS_MN_CSE)) { @@ -2332,11 +2359,11 @@ module OneM2M_Testcases_CSE_Release_1 { // Test adapter configuration // Preamble - if (PICS_IN_CSE){ + if (PX_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); } - if (PICS_MN_CSE){ + if (PX_MN_CSE){ vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); } @@ -2615,11 +2642,11 @@ module OneM2M_Testcases_CSE_Release_1 { // Test adapter configuration // Preamble - if (PICS_MN_CSE){ + if (PX_MN_CSE){ vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE); } - if (PICS_IN_CSE){ + if (PX_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); } @@ -2632,10 +2659,12 @@ module OneM2M_Testcases_CSE_Release_1 { [] mccPort.receive(mw_response(mw_responsePrimitive(int2002))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Deletion of <remoteCSE> resource has been accepted"); + f_removeElementFromList(vc_resourcesIndexToBeDeleted, vc_remoteCseIndex); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + f_removeElementFromList(vc_resourcesIndexToBeDeleted, vc_remoteCseIndex); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; @@ -2720,7 +2749,7 @@ module OneM2M_Testcases_CSE_Release_1 { var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; var UtTriggerAckPrimitive v_trigger_response; var integer v_auxInteger; - var charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS; //Test control if(not(PICS_MN_CSE)) { @@ -5007,6 +5036,70 @@ module OneM2M_Testcases_CSE_Release_1 { } } + testcase TC_CSE_DMR_UPD_004_ACP_PVS_PV_LBL() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var SetOfAcrs v_privileges_1 := {accessControlRule_list := {valueof(m_createAcr({"all"}, int63))}}; + var SetOfAcrs v_selfprivileges_2 := {accessControlRule_list := {valueof(m_createAcr({"all"}, int62))}}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for * + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3 + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {};//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfprivileges_2; //Attribute 1 + v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1;//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_ae1.start(f_CSE_DMR_UPD_004(int1, v_createRequest, v_updateRequest, v_nullFields));//AccessControlPolicy + v_ae1.done; + + + + if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + //Check attribute 1 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations, v_selfprivileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") + } + //Check attribute 2 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges, valueof(v_updateRequest.primitiveContent.accessControlPolicy.privileges))){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not added correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + //Check attribute 1 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations, v_selfprivileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") + } + //Check attribute 2 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.privileges, valueof(v_updateRequest.primitiveContent.accessControlPolicy.privileges))){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not added correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + testcase TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; @@ -5410,43 +5503,17 @@ module OneM2M_Testcases_CSE_Release_1 { * @desc Check that the IUT responds with an error when the AE tries to delete a mandatory RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource * */ - testcase TC_CSE_DMR_UPD_008_CNT_ET() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var Timestamp v_expirationTime := "21001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var AttributeAux_list v_nullFields; - var PrimitiveContent v_primitiveContentRetrieveResource; - - v_nullFields := {{"expirationTime", omit}}; - - v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime; - - v_ae1.start(f_CSE_DMR_UPD_008(int3, m_createContainerBase, v_updateRequest, v_nullFields));//Container - v_ae1.done; - - if(getverdict == pass){ - v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); - //Check that the resource has NOT been udpated - if(ischosen(v_primitiveContentRetrieveResource.container)) { - if(v_primitiveContentRetrieveResource.container.expirationTime == v_expirationTime){ - setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") - } - } - } - } - testcase TC_CSE_DMR_UPD_008_GRP_ET() runs on Tester system CseSystem { + testcase TC_CSE_DMR_UPD_008_GRP_MNM() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var Timestamp v_expirationTime := "21001231T012345"; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; - v_nullFields := {{"expirationTime", omit}}; + v_nullFields := {{"maxNrOfMembers", omit}}; - v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime; + v_updateRequest.primitiveContent.group_.maxNrOfMembers := 1; v_ae1.start(f_CSE_DMR_UPD_008(int9, m_createGroupBase, v_updateRequest, v_nullFields));//Group v_ae1.done; @@ -5455,50 +5522,49 @@ module OneM2M_Testcases_CSE_Release_1 { v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.group_)) { - if(v_primitiveContentRetrieveResource.group_.expirationTime == v_expirationTime){ + if(v_primitiveContentRetrieveResource.group_.maxNrOfMembers == 0){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } - testcase TC_CSE_DMR_UPD_008_ACP_ET() runs on Tester system CseSystem { + testcase TC_CSE_DMR_UPD_008_ACP_PVS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var Timestamp v_expirationTime := "21001231T012345"; + var SetOfAcrs v_selfPrivileges:= {{valueof(m_createAcr({"all"}, int63))}}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; - v_nullFields := {{"expirationTime", omit}}; + v_nullFields := {{"selfPrivileges", omit}}; - v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime; + v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges; v_ae1.start(f_CSE_DMR_UPD_008(int1, m_createAcpBase, v_updateRequest, v_nullFields));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); - //Check that the resource has NOT been udpated - if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { - if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime == v_expirationTime){ - setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges == v_selfPrivileges) { + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } - } + } } } - testcase TC_CSE_DMR_UPD_008_SUB_ET() runs on Tester system CseSystem { + testcase TC_CSE_DMR_UPD_008_SUB_NU() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var Timestamp v_expirationTime := "21001231T012345"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; - v_nullFields := {{"expirationTime", omit}}; + v_nullFields := {{"notificationURI", omit}}; - v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime; + v_updateRequest.primitiveContent.subscription.notificationURI := {"NullTarget"}; v_ae1.start(f_CSE_DMR_UPD_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields));//Subscription v_ae1.done; @@ -5507,7 +5573,7 @@ module OneM2M_Testcases_CSE_Release_1 { v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.subscription)) { - if(v_primitiveContentRetrieveResource.subscription.expirationTime == v_expirationTime){ + if(v_primitiveContentRetrieveResource.subscription.notificationURI == {"NullTarget"}){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } @@ -7975,7 +8041,7 @@ module OneM2M_Testcases_CSE_Release_1 { vc_ae2.stop; }; - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body v_notificationRequest := f_getRequestPrimitive(vc_ae2); @@ -8054,7 +8120,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -8129,7 +8195,7 @@ module OneM2M_Testcases_CSE_Release_1 { } }; - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -8205,7 +8271,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); v_notificationRequest := f_getRequestPrimitive(vc_ae2); diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 80ff4cc619d6b080f8092d71de1962e2bd69ee39..cb0220d9e8f4ed27d20d8adbcbb5e9b38d2721a2 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -3380,44 +3380,6 @@ module OneM2M_Testcases_CSE_Release_2 { } // end g_CSE_DMR_UPD_004 - group g_CSE_DMR_UPD_005{ - - /** - * @desc Check that the IUT responds with an error when the AE tries to update an attribute of a TARGET_RESOURCE_ADDRESS resource which does not exist - * - */ - testcase TC_CSE_DMR_UPD_005_SCH_EXC() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_createRequest := m_createScheduleBase; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - - v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; - - v_updateRequest.primitiveContent.schedule_update_invalid.expirationCounter := v_expirationCounter; - - v_ae1.start(f_CSE_DMR_UPD_005(int18, v_createRequest, v_updateRequest));//Schedule - v_ae1.done; - } - - testcase TC_CSE_DMR_UPD_005_PCH_EXC() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_createRequest := m_createPollingChannelBase; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - - v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; - - v_updateRequest.primitiveContent.pollingChannel_update_invalid.expirationCounter := v_expirationCounter; - - v_ae1.start(f_CSE_DMR_UPD_005(int15, v_createRequest, v_updateRequest));//PollingChannel - v_ae1.done; - } - - } // end g_CSE_DMR_UPD_005 - group g_CSE_DMR_UPD_006{ /** @@ -3588,7 +3550,45 @@ module OneM2M_Testcases_CSE_Release_2 { } } - } // end g_CSE_DMR_UPD_008 + } // end g_CSE_DMR_UPD_008 + + group g_CSE_DMR_UPD_009{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to update an attribute of a TARGET_RESOURCE_ADDRESS resource which does not exist + * + */ + testcase TC_CSE_DMR_UPD_009_SCH_EXC() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + + v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; + + v_updateRequest.primitiveContent.schedule_update_invalid.expirationCounter := v_expirationCounter; + + v_ae1.start(f_CSE_DMR_UPD_009(int18, v_createRequest, v_updateRequest));//Schedule + v_ae1.done; + } + + testcase TC_CSE_DMR_UPD_009_PCH_EXC() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + + v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; + + v_updateRequest.primitiveContent.pollingChannel_update_invalid.expirationCounter := v_expirationCounter; + + v_ae1.start(f_CSE_DMR_UPD_009(int15, v_createRequest, v_updateRequest));//PollingChannel + v_ae1.done; + } + + } // end g_CSE_DMR_UPD_009 group g_CSE_DMR_UPD_014 { @@ -5351,7 +5351,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_cf01Up(); - if(PX_IUT_IS_ASN_CSE){ + if(PX_ASN_CSE){ //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(); @@ -5416,7 +5416,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_cf01Up(); - if(PX_IUT_IS_MN_CSE){ + if(PX_MN_CSE){ //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(); @@ -5850,7 +5850,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ @@ -5915,7 +5915,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ @@ -5994,7 +5994,7 @@ module OneM2M_Testcases_CSE_Release_2 { setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6075,7 +6075,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6121,7 +6121,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs @@ -6148,7 +6148,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6205,7 +6205,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); @@ -6233,7 +6233,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6287,7 +6287,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); @@ -6310,7 +6310,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6383,7 +6383,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6448,7 +6448,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6517,7 +6517,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6592,7 +6592,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6671,7 +6671,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6743,7 +6743,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources();