Commit 4c86c036 authored by oneM2MTester Develop Team's avatar oneM2MTester Develop Team
Browse files

add new LOC test cases

parent efd1ab62
......@@ -441,6 +441,7 @@ module OneM2M_Functions {
* @verdict
*/
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request, integer p_parentIndex) runs on CseTester return RequestPrimitive {
var integer p_locresourceIndex := p_parentIndex;
p_request.from_ := f_getOriginator(p_parentIndex);
......@@ -452,6 +453,14 @@ module OneM2M_Functions {
if (p_resourceType == int9) {//group
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
}
//@Martin
if(p_resourceType == int3){//container
//when a container is created by hosting cse for storing location information, the container is seen as a location container
if(PX_IS_LOC_CONTAINER){
p_request.primitiveContent.any_1[0].Container_optional.locationID := f_getResourceId(vc_resourcesList[p_locresourceIndex].resource);//resourceID of the locationPolicy
}
}
if (p_resourceType == int15) {//pollingChannel
p_request.from_ := vc_aeAux.aE_ID;
......
......@@ -51,16 +51,23 @@ module OneM2M_Pixits {
modulepar XSD.ID PX_CSE_ID := "in-cse";
modulepar boolean PX_FROM_IS_AE_ID := false;
//@Martin
//for checking whether the locationPolicy creation request is originated from a ASN-AE
//NOTE: Apply to Device-based location request, and this requires Testing System to activate ASN-AE mode to test IUT
modulepar boolean PX_FROM_ASN_AE := false; //default
modulepar boolean PX_IUT_IS_ASN_CSE := false; //default //set it to true when running Device-based location testcases
modulepar boolean PX_FROM_ADN_AE := true; //default
modulepar boolean PX_IUT_IS_MN_CSE := false; //default //set it to true when running Share-based location testcases
//@Martin
//constant parameters for LOC
modulepar LocationSource PX_LOCATION_SOURCE := int1;//network-defined
//constant parameters for LOC
modulepar XSD.Token PX_LOCATION_TARGET_ID := "{LOCATION-TARGET-ID}"; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER
modulepar XSD.AnyURI PX_LOCATION_SERVER_ADDRESS := "{LOCATION-SERVER-ADDRESS}";
modulepar XSD.AnyURI PX_LOCATION_SERVER_ADDRESS := "{LOCATION-SERVER-ADDRESS}";
modulepar charstring PX_LOCATION_UPDATE_PERIOD := "PT10M10S" ;//10 Minute 10 Seconds
modulepar charstring PX_LOCATION_UPDATE_PERIOD_INVALID := "-PT30M10S" ;//duration set to invalid value (minus value)
modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer";
modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer";
modulepar Labels LABELS := {"VALUE_1"};
modulepar Labels LABELS := {"VALUE_1"};
modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information
} // end of module
......@@ -569,14 +569,24 @@ module OneM2M_Templates {
};
//@Martin
template (value) RequestPrimitive m_createLocationPolicy(in template (omit) AcpType p_accessControlPolicyIDs, in template (omit) XSD.Duration locationUpdatePeriod, in template (omit) NodeID locationTargetID, in template (omit) XSD.AnyURI locationServerAddress) modifies m_create := {
requestIdentifier := "m_createLocationPolicy", //the requestIdentifier is supposed to be set similar as "C190XX7T/001" by prepending the AE-ID-Stem and slash(‘/’) in front of it
template (value) RequestPrimitive m_createLocationPolicy(in template (value) LocationSource locationSource, in template (omit) AcpType p_accessControlPolicyIDs, in template (omit) XSD.Duration locationUpdatePeriod, in template (omit) NodeID locationTargetID, in template (omit) XSD.AnyURI locationServerAddress) modifies m_create := {
requestIdentifier := "m_createLocationPolicy" & f_rnd(1, 1000000), //the requestIdentifier is supposed to be set similar as "C190XX7T/001" by prepending the AE-ID-Stem and slash(‘/’) in front of it
resourceType := int10,
primitiveContent := {
any_1 := {{ LocationPolicy_optional := m_contentCreateLocationPolicy(p_accessControlPolicyIDs, locationUpdatePeriod, locationTargetID, locationServerAddress) }}
any_1 := {{ LocationPolicy_optional := m_contentCreateLocationPolicy(locationSource, p_accessControlPolicyIDs, locationUpdatePeriod, locationTargetID, locationServerAddress) }}
},
resultContent := int1//default
};
//@Martin
template (value) RequestPrimitive m_createNotification(in template (value) XSD.AnyType resourcePresentation, in template (omit)NotificationEventType notifEventType, in template (omit) XSD.AnyURI subscriptionReference, in template (omit) XSD.AnyURI notifForwardingURI) modifies m_create := {
requestIdentifier := "m_createNotification" & f_rnd(1, 1000000),
primitiveContent := {
any_1 := {{ Notification_optional := m_contentCreateNotification(resourcePresentation, notifEventType, subscriptionReference, notifForwardingURI)}}
},
resultContent := int1 //default
};
}//end group Create
......@@ -945,30 +955,55 @@ module OneM2M_Templates {
};
//@Martin
template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.Duration locationUpdatePeriod, in template (value) NodeID locationTargetID, in template (value) XSD.AnyURI locationServerAddress) := {
resourceName := c_defaultResourceName, //O
resourceType := omit, //NP
resourceID := omit, //NP
parentID := omit, //NP
creationTime := omit, //NP
lastModifiedTime := omit, //NP
labels := LABELS,//O
template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (value) LocationSource locationSource, in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.Duration locationUpdatePeriod, in template (value) NodeID locationTargetID, in template (value) XSD.AnyURI locationServerAddress) := {
resourceName := c_defaultResourceName, //O
resourceType := omit, //NP
resourceID := omit, //NP
parentID := omit, //NP
creationTime := omit, //NP
lastModifiedTime := omit, //NP
labels := LABELS,//O
accessControlPolicyIDs := p_accessControlPolicyIDs, //O
expirationTime := omit, //O
dynamicAuthorizationConsultationIDs := omit, //O
announceTo := omit, //O
announcedAttribute := omit, //O
locationSource := PX_LOCATION_SOURCE, //M
locationUpdatePeriod := locationUpdatePeriod, //O
locationTargetID := locationTargetID, //O
locationSource := locationSource, //M
locationUpdatePeriod := locationUpdatePeriod, //O
locationTargetID := locationTargetID, //O
locationServer := locationServerAddress,//O
locationContainerID := omit, //NP
locationContainerName := PX_LOCATION_CONTAINER_NAME,//O
locationStatus := omit, //NP
locationStatus := omit, //NP
choice := omit //NP
};
//@Martin
template (value) Notification_optional m_contentCreateNotification (in template (value) XSD.AnyType resourcePresentation,
in template (omit)NotificationEventType notifEventType,
in template (omit) XSD.AnyURI subReference,
in template (omit) XSD.AnyURI notifForwardingURI) :=
{
notificationEvent := {
representation := resourcePresentation,
operationMonitor := {
operation := omit,
originator := omit
},
notificationEventType := notifEventType
},
verificationRequest := omit,
subscriptionDeletion := omit,
subscriptionReference := subReference,
creator := omit,
notificationForwardingURI := notifForwardingURI,
iPEDiscoveryRequest := {
originator := omit,
filterCriteria := omit
}
};
}//end group ContentCreate
group ContentUpdate {
......
......@@ -6924,7 +6924,38 @@ group optionalResourceTypes {
variant (choice.choice_list[-]) "untagged";
};
}
//@Martin
type record Notification_optional
{
record {
XSD.AnyType representation optional,
record {
Operation operation optional,
XSD.ID originator optional
} operationMonitor optional,
NotificationEventType notificationEventType optional
} notificationEvent optional,
XSD.Boolean verificationRequest optional,
XSD.Boolean subscriptionDeletion optional,
XSD.AnyURI subscriptionReference optional,
XSD.ID creator optional,
XSD.AnyURI notificationForwardingURI optional,
record {
XSD.ID originator optional,
FilterCriteria filterCriteria optional
} iPEDiscoveryRequest optional
}
with {
variant "name as 'notification'";
//variant (verificationRequest) "text 'true' as '1'";
//variant (verificationRequest) "text 'false' as '0'";
//variant (subscriptionDeletion) "text 'true' as '1'";
//variant (subscriptionDeletion) "text 'false' as '0'";
variant (iPEDiscoveryRequest) "name as capitalized";
};
}//end group
group invalidTypes {
......@@ -7073,6 +7104,6 @@ with {
encode "XML";
variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
extension "anytype ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid"
extension "anytype ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid, Notification, Notification_optional"
}
......@@ -22,6 +22,7 @@ module OneM2M_TypesAndValues {
const XSD.String c_defaultResourceName := "MyResource";
const XSD.ID c_aeAuxName := "MyAe";
const XSD.String c_acpAuxName := "MyAcp";
const charstring c_invalid_location_update_period := "-PT30M10S" ;//duration set to invalid value (minus value)
//AccessControlOperations
const XSD.Integer c_C := 1;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment