blob: 62e8bb49b48ddd2187ec941bca98c822521ae473 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2017 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
///////////////////////////////////////////////////////////////////////////////
// File: IOT_LGen_Definitions.ttcn
// Description:
// Rev: R1A
// Prodnr: LPA 108 661
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: IOT_LGen_Definitions
//
// Purpose:
// This module contains the definitions for RIoT's load generator component
//
// Detailed comments:
// RIoT is a load generator built on top of the TitanSim load generator framework. It is
// capable of simulating devices using some IoT protocols (CoAP, LwM2M, MQTT, HTTP). RIoT
// (and the TitanSim framework) was created to support non-functional tests, where load generation
// is required like performance, stability, scalability.
//
// Events, TestSteps:
// <IOT_LGen_Steps>
//
// Module Parameters:
// tsp_IOT_LGen_FSMs - <EPTF_LGenBase_FsmTableDeclaratorList> - FSM declarations that can be instantiated for the traffic cases
//
// Module depends on:
// - <EPTF_MQTT_LGen_Definitions>
// - <EPTF_MQTT_LocalTransport_Definitions>
// - <EPTF_COAP_LGen_Definitions>
// - <EPTF_COAP_LocalTransport_Definitions>
// - <EPTF_LwM2M_LGen_Definitions>
// - <EPTF_LwM2M_CoapApplibTransport_Definitions>
// - <EPTF_LwM2M_Object_Definitions>
// - <EPTF_HTTP_Definitions>
// - <EPTF_HTTP_Transport_Definitions>
// - <EPTF_CLL_LGenBase_Definitions>
// - <EPTF_CLL_LGenBase_ConfigDefinitions>
// - <EPTF_CLL_ExecCtrl_Definitions>
//
// Component Diagram:
// (see IOT_App_Definitions.components.jpg)
//
// Related Types:
// - <IOT_App_CT>
// - <IOT_LGen_CT>
// - <EPTF_ExecCtrl_CT>
///////////////////////////////////////////////////////////////
module IOT_LGen_Definitions
{
import from EPTF_MQTT_LGen_Definitions all;
import from EPTF_MQTT_LocalTransport_Definitions all;
import from EPTF_COAP_LGen_Definitions all;
import from EPTF_COAP_LocalTransport_Definitions all;
import from EPTF_LwM2M_LGen_Definitions all;
import from EPTF_LwM2M_CoapApplibTransport_Definitions all;
import from EPTF_LwM2M_Object_Definitions all;
import from EPTF_HTTP_Definitions all;
import from EPTF_HTTP_Transport_Definitions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_LGenBase_ConfigDefinitions all;
import from EPTF_CLL_ExecCtrl_Definitions all;
import from InfluxDB_Definitions all;
///////////////////////////////////////////////////////////
// Module parameter: tsp_IOT_LGen_FSMs
//
// Purpose:
// FSM declarations that can be instantiated for the traffic cases
//
// Type:
// <EPTF_LGenBase_FsmTableDeclaratorList>
///////////////////////////////////////////////////////////
modulepar EPTF_LGenBase_FsmTableDeclaratorList tsp_IOT_LGen_FSMs := {}
///////////////////////////////////////////////////////////
// const: c_IOT_entityType
//
// Purpose:
// Constant for the simulated IoT entity type
///////////////////////////////////////////////////////////
const charstring c_IOT_entityType := "IOT_Entity";
///////////////////////////////////////////////////////////
// const: c_IOT_behaviorType
//
// Purpose:
// Constant for the simulated IoT behavior type
///////////////////////////////////////////////////////////
const charstring c_IOT_behaviorType := "IOT_Behavior";
const integer c_IOT_LGen_Logging_WARNING := 0;
const integer c_IOT_LGen_Logging_DEBUG := 1;
const integer c_IOT_LGen_Logging_DEBUGV := 2;
const integer c_IOT_LGen_Logging_ERROR := 3;
const integer c_FSM_inconclusive := 0;
const integer c_FSM_pass := 1;
const integer c_FSM_fail := 2;
const integer c_FSM_timeout := 3;
///////////////////////////////////////////////////////////
// Type: IOT_LGen_CT
//
// Purpose:
// IoT load generator component
//
// Class:
// (see EPTF_COAP_LGen_Definitions.EPTF_COAP_LGen_CT.jpg)
//
// Extensions:
// - <EPTF_LGenBase_CT>
// - <EPTF_ExecCtrlClient_CT>
// - <EPTF_MQTT_LGen_CT>
// - <EPTF_MQTT_LocalTransport_CT>
// - <EPTF_COAP_LGen_CT>
// - <EPTF_COAP_LocalTransport_CT>
// - <EPTF_LwM2M_LGen_CT>
// - <EPTF_LwM2M_CoapApplibTransport_CT>
// - <EPTF_HTTP_LGen_CT>
// - <EPTF_HTTP_LocalTransport_CT>
// - <InfluxDB_CT>
//
// Variables:
// v_IOT_LGen_name - *charstring* - name of the current load generator instance
// v_IOT_LGen_idx - *integer* - unique index of the current load generator instance
// v_IOT_bIdx - *integer* - id of the IOT behavior defined by RIoT
// v_IOT_LGen_loggingMaskId - *integer* - id for RioT logging functions
//
// Instance databases:
// v_IOT_LGen_DataSamples_DB - <LwM2M_DataSamples_DB> - Storing data samples for LwM2M smart objects
//
// Events, TestSteps:
// <IOT_LGen_Steps>
//
// Related Functions:
// - <f_IOT_LGen_init> (in *charstring* pl_selfName, in *integer* p_idx, in <EPTF_ExecCtrl_CT> pl_ExecCtrlRef)
// - <f_IOT_LGen_initSamples> (in *charstring* p_selfName)
// - <f_IOT_LGen_behavior> (in *charstring* pl_selfName, in *integer* p_idx, in <EPTF_ExecCtrl_CT> pl_ExecCtrlRef)
// - <f_IOT_LGen_Logging_VERBOSE> (in @lazy *charstring* pl_message)
// - <f_IOT_LGen_Logging_DEBUG> (in @lazy *charstring* pl_message)
// - <f_IOT_LGen_Logging_WARNING> (in @lazy *charstring* pl_message)
// - <f_IOT_LGen_Logging_ERROR> (in @lazy *charstring* pl_message)
// - <f_IOT_COAP_LocalTransport_send> (in <EPTF_COAP_PDU> pl_msg)
// - <f_IOT_COAP_LGen_receiveMessage> (in <EPTF_COAP_PDU> pl_message)
// - <f_EPTF_COAP_PDU_to_Influx> ()
///////////////////////////////////////////////////////////
type component IOT_LGen_CT
extends EPTF_LGenBase_CT, EPTF_ExecCtrlClient_CT,
EPTF_MQTT_LGen_CT, EPTF_MQTT_LocalTransport_CT,
EPTF_COAP_LGen_CT, EPTF_COAP_LocalTransport_CT,
EPTF_LwM2M_LGen_CT, EPTF_LwM2M_CoapApplibTransport_CT,
EPTF_HTTP_LGen_CT, EPTF_HTTP_LocalTransport_CT,
InfluxDB_CT
{
var charstring v_IOT_LGen_name;
var integer v_IOT_LGen_idx;
var integer v_IOT_bIdx;
var integer v_IOT_LGen_loggingMaskId;
var LwM2M_DataSamples_DB v_IOT_LGen_DataSamples_DB := c_LwM2M_DataSamples_DB_init;
}
const LwM2M_DataSamples c_DataSamples_Latitude :=
{
name := "Latitude",
values :=
{
{ floatValue := 47.475902 },
{ floatValue := 47.476758 },
{ floatValue := 47.477048 },
{ floatValue := 47.477657 },
{ floatValue := 47.478266 },
{ floatValue := 47.478730 },
{ floatValue := 47.479571 },
{ floatValue := 47.480325 },
{ floatValue := 47.481456 },
{ floatValue := 47.482646 },
{ floatValue := 47.484241 },
{ floatValue := 47.484589 },
{ floatValue := 47.485740 },
{ floatValue := 47.485262 },
{ floatValue := 47.484682 },
{ floatValue := 47.484102 },
{ floatValue := 47.483536 },
{ floatValue := 47.482579 },
{ floatValue := 47.482028 },
{ floatValue := 47.481390 },
{ floatValue := 47.480520 },
{ floatValue := 47.479519 },
{ floatValue := 47.478243 },
{ floatValue := 47.477286 },
{ floatValue := 47.476097 },
{ floatValue := 47.475241 },
{ floatValue := 47.474324 },
{ floatValue := 47.473134 }
}
}
const LwM2M_DataSamples c_DataSamples_Longitude :=
{
name := "Longitude",
values :=
{
{ floatValue := 19.057703 },
{ floatValue := 19.059430 },
{ floatValue := 19.060122 },
{ floatValue := 19.061195 },
{ floatValue := 19.062311 },
{ floatValue := 19.063405 },
{ floatValue := 19.065144 },
{ floatValue := 19.066989 },
{ floatValue := 19.068276 },
{ floatValue := 19.068877 },
{ floatValue := 19.069435 },
{ floatValue := 19.069521 },
{ floatValue := 19.070077 },
{ floatValue := 19.071772 },
{ floatValue := 19.073231 },
{ floatValue := 19.074798 },
{ floatValue := 19.076600 },
{ floatValue := 19.079325 },
{ floatValue := 19.080892 },
{ floatValue := 19.082694 },
{ floatValue := 19.085033 },
{ floatValue := 19.087780 },
{ floatValue := 19.091127 },
{ floatValue := 19.093788 },
{ floatValue := 19.096727 },
{ floatValue := 19.098938 },
{ floatValue := 19.097714 },
{ floatValue := 19.096813 }
}
}
}