Initial contribution TST-2016-0054R02-TS-0019_TTCN-3_Test_cases

parents
/**
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_AbstractData.ttcn $
* $Id: LibCommon_AbstractData.ttcn 46 2014-01-16 10:23:16Z filatov $
* @desc A collection of functions for abstract data types which may be
* useful in the implementation of any TTCN-3 test suite.
* @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.
*/
module LibCommon_AbstractData {
import from LibCommon_BasicTypesAndValues { type UInt } ;
group stringStack {
type record StringStack {
UInt stackSize,
StringItems stringItems
}
type record of charstring StringItems;
/**
* @desc Constant which can be used to initialize a
* string stack. A string stack can be intialized by
* assigning this value in the variable declariation.
* An alternative is to call the initlialization function.
* @see LibCommon_AbstractData.f_initStringStack
* @remark Note that an initlialized stack stack is not
* necessarily the same as an empty string stack.
* An empty tring stack as 0 zero elements but may
* have a non empty list of (empty) items.
*/
const StringStack c_initStringStack := { 0, {} }
/**
* @desc The invocation of this function will initialize
* a string stack to an empty string stack.
* An alternative is to initlialize a stack using a
* constant value.
* @see LibCommon_AbstractData.c_initStringStack
* @param p_stack String stack to be initialized.
*/
function f_initStringStack ( inout StringStack p_stack ) {
p_stack := c_initStringStack
}
/**
* @desc This function checks if a string stack is empty.
* @param p_stack String stack to be checked.
* @return true if empty, false if not empty
*/
function f_isStringStackEmpty ( inout StringStack p_stack )
return boolean {
if ( p_stack.stackSize == 0 ) {return true}
else {return false}
}
/**
* @desc This function checks if a given string is on the
* string stack.
* @param p_stack String stack where the string item
* is to be looked for.
* @param p_item String to be checked for.
* @return true if found, false if not found
*/
function f_isItemOnStringStack ( inout StringStack p_stack,
in charstring p_item )
return boolean {
var integer i;
for (i := 0; i < p_stack.stackSize; i := i+1 ) {
if ( p_stack.stringItems[i] == p_item ) {
return true;
}
}
return false;
}
/**
* @desc This function checks if a given string is on the
* string stack.
* @param p_stack String stack where the string item
* is to be looked for.
* @param p_item String item on top of the stack.
* @return false if stack is empty, true otherwise
*/
function f_peekStringStackTop ( inout StringStack p_stack,
out charstring p_item)
return boolean {
if (p_stack.stackSize == 0) {
p_item := "f_peekTopStringStack: String stack is empty!";
return false;
}
p_item := valueof(p_stack.stringItems[p_stack.stackSize-1]);
return true;
}
/**
* @desc This function puts a string to the top of a
* string stack.
* @param p_stack String stack to which the string item
* is to be added.
* @param p_item String to be added.
*/
function f_pushStringStack ( inout StringStack p_stack,
in charstring p_item ) {
p_stack.stringItems[p_stack.stackSize] := p_item;
p_stack.stackSize := p_stack.stackSize + 1;
}
/**
* @desc This function removes the string from the top of a
* string stack. If the stack is empty nothing is done
* @param p_stack String stack from which the top string item
* is to be removed.
*/
function f_popStringStack ( inout StringStack p_stack ) {
if ( p_stack.stackSize > 0 ) {
p_stack.stackSize := p_stack.stackSize-1;
// "delete" top stack item to be safe
// Note: due to record of index the "old top" is size-1!
p_stack.stringItems[p_stack.stackSize] := "";
}
}
} // end group stringStack
} // end module LibCommon_AbstractData
This diff is collapsed.
/**
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_DataStrings.ttcn $
* $Id: LibCommon_DataStrings.ttcn 58 2014-10-03 06:04:49Z garciay $
* @desc A collection of data string type and value definitions which
* may be useful in the implementation of any TTCN-3 test
* suite. "Data string" refers to TTCN-3 hexstring, octetstring
* and bitstring types.
* @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.
*/
module LibCommon_DataStrings {
/**
* @remark Number in name indicates string length in number of
* _bits_
*/
group bitStringSubTypes {
type bitstring Bit1 length(1) with {encode "length(1)"};
type bitstring Bit2 length(2) with {encode "length(2)"};
type bitstring Bit3 length(3) with {encode "length(3)"};
type bitstring Bit4 length(4) with {encode "length(4)"};
type bitstring Bit5 length(5) with {encode "length(5)"};
type bitstring Bit6 length(6) with {encode "length(6)"};
type bitstring Bit7 length(7) with {encode "length(7)"};
type bitstring Bit8 length(8) with {encode "length(8)"};
type bitstring Bit9 length(9) with {encode "length(9)"};
type bitstring Bit10 length(10) with {encode "length(10)"};
type bitstring Bit11 length(11) with {encode "length(11)"};
type bitstring Bit12 length(12) with {encode "length(12)"};
type bitstring Bit13 length(13) with {encode "length(13)"};
type bitstring Bit14 length(14) with {encode "length(14)"};
type bitstring Bit15 length(15) with {encode "length(15)"};
type bitstring Bit16 length(16) with {encode "length(16)"};
type bitstring Bit17 length(17) with {encode "length(17)"};
type bitstring Bit18 length(18) with {encode "length(18)"};
type bitstring Bit19 length(19) with {encode "length(19)"};
type bitstring Bit20 length(20) with {encode "length(20)"};
type bitstring Bit21 length(21) with {encode "length(21)"};
type bitstring Bit22 length(22) with {encode "length(22)"};
type bitstring Bit23 length(23) with {encode "length(23)"};
type bitstring Bit24 length(24) with {encode "length(24)"};
type bitstring Bit25 length(25) with {encode "length(25)"};
type bitstring Bit26 length(26) with {encode "length(26)"};
type bitstring Bit27 length(27) with {encode "length(27)"};
type bitstring Bit28 length(28) with {encode "length(28)"};
type bitstring Bit29 length(29) with {encode "length(29)"};
type bitstring Bit30 length(30) with {encode "length(30)"};
type bitstring Bit31 length(31) with {encode "length(31)"};
type bitstring Bit32 length(32) with {encode "length(32)"};
type bitstring Bit40 length(40) with {encode "length(40)"};
type bitstring Bit48 length(48) with {encode "length(48)"};
type bitstring Bit64 length(64) with {encode "length(64)"};
type bitstring Bit72 length(72) with {encode "length(72)"};
type bitstring Bit128 length(128) with {encode "length(128)"};
type bitstring Bit144 length(144) with {encode "length(144)"};
} // end group bitStringSubTypes
group zeroedBits {
const Bit1 c_1ZeroBit := int2bit(0,1);
const Bit2 c_2ZeroBits := int2bit(0,2);
const Bit4 c_4ZeroBits := int2bit(0,4);
const Bit5 c_5ZeroBits := int2bit(0,5);
const Bit6 c_6ZeroBits := int2bit(0,6);
const Bit8 c_8ZeroBits := int2bit(0,8);
const Bit14 c_14ZeroBits := int2bit(0,14);
const Bit64 c_64ZeroBits := int2bit(0,64);
}//end group zeroedBits
/**
* @remark Number in name indicates string length in number of
* _octets_
*/
group octetStringSubTypes {
type octetstring Oct1 length(1) with {encode "length(1)"};
type octetstring Oct2 length(2) with {encode "length(2)"};
type octetstring Oct3 length(3) with {encode "length(3)"};
type octetstring Oct4 length(4) with {encode "length(4)"};
type octetstring Oct5 length(5) with {encode "length(5)"};
type octetstring Oct6 length(6) with {encode "length(6)"};
type octetstring Oct7 length(7) with {encode "length(7)"};
type octetstring Oct8 length(8) with {encode "length(8)"};
type octetstring Oct9 length(9) with {encode "length(9)"};
type octetstring Oct10 length(10) with {encode "length(10)"};
type octetstring Oct11 length(11) with {encode "length(11)"};
type octetstring Oct12 length(12) with {encode "length(12)"};
type octetstring Oct13 length(13) with {encode "length(13)"};
type octetstring Oct14 length(14) with {encode "length(14)"};
type octetstring Oct15 length(15) with {encode "length(15)"};
type octetstring Oct16 length(16) with {encode "length(16)"};
type octetstring Oct32 length(32) with {encode "length(32)"};
type octetstring Oct20 length(20) with {encode "length(20)"};
type octetstring Oct64 length(64) with {encode "length(64)"};
type octetstring Oct80 length(80) with {encode "length(80)"};
type octetstring Oct128 length(128) with {encode "length(128)"};
type octetstring Oct160 length(160) with {encode "length(160)"};
type octetstring Oct320 length(320) with {encode "length(320)"};
type octetstring Oct640 length(640) with {encode "length(640)"};
type octetstring Oct1280 length(1280) with {encode "length(1280)"};
type octetstring Oct1380 length(1380) with {encode "length(1380)"};
type octetstring Oct0to3 length(0..3) with {encode "length(0..3)"};
type octetstring Oct0to8 length(0..16) with {encode "length(0..8)"};
type octetstring Oct0to12 length(0..12) with {encode "length(0..12)"};
type octetstring Oct0to16 length(0..16) with {encode "length(0..16)"};
type octetstring Oct0to31 length(0..31) with {encode "length(0..31)"};
type octetstring Oct0to20 length(0..20) with {encode "length(0..20)"};
type octetstring Oct0to30 length(0..20) with {encode "length(0..30)"};
type octetstring Oct0to127 length(0..127) with {encode "length(0..127)"};
type octetstring Oct0to255 length(0..255) with {encode "length(0..255)"};
type octetstring Oct1to15 length(1..15) with {encode "length(1..15)"};
type octetstring Oct1to31 length(1..31) with {encode "length(1..31)"};
type octetstring Oct1to128 length(1..128) with {encode "length(1..128)"};
type octetstring Oct1to254 length(1..254) with {encode "length(1..254)"};
type octetstring Oct1to255 length(1..255) with {encode "length(1..255)"};
type octetstring Oct4to16 length(4..16) with {encode "length(4..16)"};
type octetstring Oct6to15 length(6..15) with {encode "length(6..15)"};
} // end group octetStringSubTypes
group zeroedBytes {
const Oct1 c_1ZeroByte := int2oct(0,1);
const Oct2 c_2ZeroBytes := int2oct(0,2);
const Oct4 c_4ZeroBytes := int2oct(0,4);
const Oct6 c_6ZeroBytes := int2oct(0,6);
const Oct8 c_8ZeroBytes := int2oct(0,8);
const Oct9 c_9ZeroBytes := int2oct(0,9);
const Oct12 c_12ZeroBytes := int2oct(0,12);
const Oct16 c_16ZeroBytes := int2oct(0,16);
const Oct20 c_20ZeroBytes := int2oct(0,20);
const Oct80 c_80ZeroBytes := int2oct(0,80);
const Oct160 c_160ZeroBytes := int2oct(0,160);
const Oct320 c_320ZeroBytes := int2oct(0,320);
const Oct640 c_640ZeroBytes := int2oct(0,640);
const Oct1280 c_1280ZeroBytes := int2oct(0,1280);
const Oct1380 c_1380ZeroBytes := int2oct(0,1380);
const octetstring c_256ZeroBytes := int2oct(0,256);
const octetstring c_1KZeroBytes := int2oct(0,1024);
const octetstring c_4KZeroBytes := int2oct(0,4096);
const octetstring c_16KZeroBytes := int2oct(0,16384);
const octetstring c_64KZeroBytes := int2oct(0,65536);
const octetstring c_128KZeroBytes := int2oct(0,131072);
}//end group zeroedBytes
} // end module LibCommon_DataStrings
This diff is collapsed.
/**
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_TextStrings.ttcn $
* $Id: LibCommon_TextStrings.ttcn 46 2014-01-16 10:23:16Z filatov $
* @desc A collection of text string type and value definitions which
* may be useful in the implementation of any TTCN-3 test
* suite. "Text string" refers to TTCN-3 charstring and universal
* charstring types.
* @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.
*/
module LibCommon_TextStrings {
/**
* @desc These constants can be used to add special characters into
* TTCN-3 text strings by using the concatenation operator.
* Example use:
* var charstring v_text := "Hi!" & c_CRLF & "Hello!";
*/
group usefulConstants {
const charstring c_NUL := oct2char('00'O);
const charstring c_SOH := oct2char('01'O);
const charstring c_STX := oct2char('02'O);
const charstring c_ETX := oct2char('03'O);
const charstring c_EOT := oct2char('04'O);
const charstring c_ENQ := oct2char('05'O);
const charstring c_ACK := oct2char('06'O);
const charstring c_BEL := oct2char('07'O);
const charstring c_BS := oct2char('08'O);
const charstring c_TAB := oct2char('09'O);
const charstring c_LF := oct2char('0A'O);
const charstring c_VT := oct2char('0B'O);
const charstring c_FF := oct2char('0C'O);
const charstring c_CR := oct2char('0D'O);
const charstring c_SO := oct2char('0E'O);
const charstring c_SI := oct2char('0F'O);
const charstring c_DLE := oct2char('10'O);
const charstring c_DC1 := oct2char('11'O);
const charstring c_DC2 := oct2char('12'O);
const charstring c_DC3 := oct2char('13'O);
const charstring c_DC4 := oct2char('14'O);
const charstring c_NAK := oct2char('15'O);
const charstring c_SYN := oct2char('16'O);
const charstring c_ETB := oct2char('17'O);
const charstring c_CAN := oct2char('18'O);
const charstring c_EM := oct2char('19'O);
const charstring c_SUB := oct2char('1A'O);
const charstring c_ESC := oct2char('1B'O);
const charstring c_FS := oct2char('1C'O);
const charstring c_GS := oct2char('1D'O);
const charstring c_RS := oct2char('1E'O);
const charstring c_US := oct2char('1F'O);
const charstring c_DEL := oct2char('7F'O);
const charstring c_CRLF := oct2char('0D'O) & oct2char('0A'O);
} // end group usefulConstants
/**
* @remark Number in name indicates string length in number of
* _characters_
*/
group textStringSubTypes {
type charstring String1 length(1) with { encode "length(1)"};
type charstring String2 length(2) with { encode "length(2)"};
type charstring String3 length(3) with { encode "length(3)"};
type charstring String4 length(4) with { encode "length(4)"};
type charstring String5 length(5) with { encode "length(5)"};
type charstring String6 length(6) with { encode "length(6)"};
type charstring String7 length(7) with { encode "length(7)"};
type charstring String8 length(8) with { encode "length(8)"};
type charstring String9 length(9) with { encode "length(9)"};
type charstring String10 length(10) with { encode "length(10)"};
type charstring String11 length(11) with { encode "length(11)"};
type charstring String12 length(12) with { encode "length(12)"};
type charstring String13 length(13) with { encode "length(13)"};
type charstring String14 length(14) with { encode "length(14)"};
type charstring String15 length(15) with { encode "length(15)"};
type charstring String16 length(16) with { encode "length(16)"};
type charstring String1To13 length(1..13) with {encode "length(1..13)"};
type charstring String1To63 length(1..63) with {encode "length(1..63)"};
type charstring String1To64 length(1..64) with {encode "length(1..64)"};
type charstring String1To127 length(1..127) with {encode "length(1..127)"};
type charstring String1To128 length(1..128) with {encode "length(1..128)"};
type charstring String1to255 length(1..255) with {encode "length(1..255)"};
type charstring String5to253 length (5..253) with {encode "length(5..253)"};
} // end stringSubTypes
group usefulTextStringTypes {
type universal charstring UnicodeText;
type universal charstring UnicodeText1to255 length(1..255)
with {encode "length(1..255)"};
/**
* @desc Subtyping can not be used in this type definition to ensure
* values of this type are really alphanumeric.
* Instead either codecs or a template have
* to be used for this purpose. The type is kept here to ensure
* backward compatibility.
* @see LibCommon_TextStrings.mw_isAlphaNum
*/
type charstring AlphaNum with { encode "alphanumeric"};
type AlphaNum AlphaNum2 length(2) with { encode "alphanumeric;length(2)"};
type AlphaNum AlphaNum1To32 length(1..32) with {encode "alphanumeric;length(1..32)"};
} // end group usefulTextStringTypes
group usefulTextStringTemplates {
template charstring mw_isAlphaNum := pattern "([0-9]|[a-z]|[A-Z])+";
} // end group usefulTextStringTemplates
} // end module LibCommon_TextStrings
/**
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Time.ttcn $
* $Id: LibCommon_Time.ttcn 46 2014-01-16 10:23:16Z filatov $
* @desc A collection of time handling functions which may be useful in
* the implementation of any TTCN-3 test suite.
* @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.
*/
module LibCommon_Time {
group timeLibModuleParameters {
/**
* @desc Time to control PTC.stop
* @remark PICS/PIXIT Reference: XXX
*/
modulepar float PX_TDONE := 120.0;
/**
* @desc Time to control the reception of a message
* @remark PICS/PIXIT Reference: XXX
*/
modulepar float PX_TAC := 30.0;
/**
* @desc Time to control that IUT sends nothing
* @remark PICS/PIXIT Reference: XXX
*/
modulepar float PX_TNOAC := 10.0;
/**
* @desc Time to control that IUT reacts prior to Upper Tester action
* @remark PICS/PIXIT Reference: XXX
*/
modulepar float PX_TWAIT := 120.0;
/**
* @desc Time to control sending in loops
* @remark PICS/PIXIT Reference: XXX
*/
modulepar float PX_LOOP := 1.0;
} // end group timeLibModuleParameters
group sleeping {
/**
* @desc The invocation of this function will cause a test component
* to sleep (or wait) for a specified amount of time.
* Defaults may interrupt this sleep if activated.
* @see LibCommon_Time.f_sleepIgnoreDef
* @param p_duration Amount of time that the test component should wait.
*/
function f_sleep ( in float p_duration ) {
timer t;
if (p_duration <= 0.0) {return}
t.start( p_duration );
t.timeout;
}
/**
* @desc The invocation of this function will cause a test component
* to sleep (or wait) for a specified amount of time.
* This function ignores any active defaults, i.e., the function
* will always wait the specified amount of time.
* @param p_duration Amount of time that the test component should wait.
*/
function f_sleepIgnoreDef ( in float p_duration ) {
timer t;
if (p_duration <= 0.0) {return}
t.start( p_duration );
alt {
[] t.timeout {}
[else] {repeat}
} // end alt
}
} // end group sleeping
} // end module LibCommon_Time
/**
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_VerdictControl.ttcn $
* $Id: LibCommon_VerdictControl.ttcn 46 2014-01-16 10:23:16Z filatov $
* @desc Contains generic functions which set test component verdicts
* based on generic function return codes according to established
* test implementation practice. These functions should only be called
* from test case functions (see reusable t3 code methodology) only.
* @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.
*/
module LibCommon_VerdictControl {
/**
* @desc Collection of all possible function return codes.
* This type should be used as a return parameter type
* in all TTCN-3 function definitions (except for
* functions invoked from in TTCN-3 start statements).
* This return value should be used to communicate a
* verdict to the caller _instead of_ literally setting
* a verdict in the function! This warrants a higher
* degree of reuse for the function.
*/
type enumerated FncRetCode {
e_success(0),
// error codes
e_error(1),
e_timeout(2)
}
/**
* @desc This function should be used for verdict
* setting after completion of, e.g., the test body
* execution.
* Sets verdicts are INCONC in case of a timeout, FAIL
* in case of an error, and PASS otherwise.
* @param p_ret Current execution status
*/
function f_setVerdict ( FncRetCode p_ret ) {
if ( p_ret == e_success ) {
setverdict(pass);
} else if ( p_ret == e_timeout ) {
setverdict(inconc);
} else {
setverdict(fail);
}
} // end function f_setVerdict
/**
* @desc This function should be used for verdict
* setting after completion of a preamble
* execution.
* Sets verdicts are INCONC in case of a timeout or
* an error, and PASS otherwise.
* @param p_ret Preamble execution status
*/
function f_setVerdictPreamble ( FncRetCode p_ret ) {
log("f_setVerdictPreamble: This function is deprecated. Use f_setVerdictPreOrPostamble instead. ");
f_setVerdictPreOrPostamble(p_ret);
} // end function f_setVerdictPreamble
/**
* @desc This function should be used for verdict
* setting after completion of a postamble
* execution.
* Sets verdicts are INCONC in case of a timeout or
* an error, and PASS otherwise.
* @param p_ret Postamble execution status
*/
function f_setVerdictPostamble ( FncRetCode p_ret ) {
log("f_setVerdictPostamble: This function is deprecated. Use f_setVerdictPreOrPostamble instead. ");
f_setVerdictPreOrPostamble(p_ret);
} // end function f_setVerdictPostamble
/**
* @desc This function should be used for verdict
* setting outside the test body.
* Sets verdicts are INCONC in case of a timeout or
* an error
* @param p_ret Postamble execution status
*/
function f_setVerdictPreOrPostamble ( FncRetCode p_ret ) {
if ( p_ret != e_success ) {
setverdict(inconc);
}
} // end function f_setVerdictPreOrPostamble
} // end module LibCommon_VerdictControl
/**
* Copyright Notification
* No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
* All rights reserved.
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 23 2016-03-17 10:02:44Z reinaortega $
* @desc Module containing functions for oneM2M
*
*/
module OneM2M_Functions {
import from LibCommon_Time {modulepar all;}
import from XSD all;
import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID};
import from OneM2M_TypesAndValues all;
import from OneM2M_TestSystem all;
import from OneM2M_Pixits all;
// import from OneM2M_AdditionalTypes all;
group configFunctions {
/**
@desc
*/
function f_cf01Up() runs on M2M {
// Variables
// Map
map(self:mcaPort, system:mcaPort);
activate(a_default());
// Connect
//Initialze the IUT
} // end f_cf01Up
}//end group configFunctions
group preambleFunctions {
function f_preamble_registerAe(in template (value) XSD.String p_name, in template (value) AccessControlOperations p_allowedOperations) runs on M2M {
var RequestPrimitive v_request;
var M2MResponsePrimitive v_response;
var XSD.ID v_acpId;
v_acpId := f_createAccessControlPolicyAux("MyAcp", p_allowedOperations);
mcaPort.send(m_request(m_createAeAux(p_name, {v_acpId})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
log("Preamble: Application registered successfuly");
if(ischosen(v_response.responsePrimitive_.content.any_1[0].AE)) {
vc_ae := v_response.responsePrimitive_.content.any_1[0].AE;
}
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(inconc, "Preamble: Error while registering application");
stop;
}
[] mcaPort.receive {
tc_ac.stop;
setverdict(inconc, "Preamble: Unexpected message received");
stop;
}
[] tc_ac.timeout {
setverdict(inconc, "Preamble: No answer while registering resource");
stop;
}
}
}
}//end group preambleFunctions
group postambleFunctions {
function f_postamble_deleteResources(in template (value) XSD.String p_aeName) runs on M2M {
var M2MResponsePrimitive v_response;
if (PX_RUN_POSTAMBLE) {
mcaPort.send(m_request(m_deleteAe("/" & PX_CSE_NAME & "/" & valueof(p_aeName))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
log("Postamble: AE Resource deleted");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
log("Postamble: Error while deleting resource");
}
[] tc_ac.timeout {
log("Postamble: No answer while deleting resource");
}
}
mcaPort.send(m_request(m_deleteAcp("/" & PX_CSE_NAME & "/MyAcp")));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
log("Postamble: ACP Resource deleted");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
log("Postamble: Error while deleting resource");
}
[] tc_ac.timeout {
log("Postamble: No answer while deleting resource");
}
}
}
f_postamble_default();
}
function f_postamble_default() runs on M2M {
unmap(self:mcaPort, system:mcaPort);
stop;
}
}//end group postambleFunctions
group altstepFunctions {
/**
* @desc Default altstep
*/
altstep a_default() runs on M2M {
[] mcaPort.receive {
log("a_default: WARNING: Unexpected message received");
repeat;
}
[] tc_wait.timeout {
setverdict(inconc,"a_default: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action");
}
[] tc_ac.timeout {
setverdict(inconc,"a_default: ERROR: Timeout while awaiting the reception of a message");
}
}
}//end group altstepFunctions
group getSetFunctions {
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, XSD.ID p_aeResourceAddress, in template (omit) XSD.String p_name, in template (omit) AccessControlOperations p_allowedOperations, template RequestPrimitive p_request) runs on M2M return RequestPrimitive {
p_request.to_ := p_aeResourceAddress;
p_request.name := p_name;
if (p_resourceType == int1) {//AccessControlPolicy
if(isvalue(p_allowedOperations)){
p_request.content.any_1[0].ACP_create := valueof(m_contentCreateAcp (p_allowedOperations));
}