blob: 07943256d2cfb164e7847faa899d74f108463f64 [file] [log] [blame]
---
Author: József Gyürüsi
Version: 18/198 17-CNL 113 512, Rev. F
Date: 2016-06-13
---
= EPTF CLL Variable, User Guide
:author: József Gyürüsi
:revnumber: 18/198 17-CNL 113 512, Rev. F
:revdate: 2016-06-13
:toc:
== About This Document
=== How to Read This Document
This is the User Guide for the Variable feature of the Ericsson Performance Test Framework (TitanSim), Core Library (CLL). EPTF CLL is developed for the TTCN-3 <<_1, [1]>> Toolset with TITAN <<_2, [2]>>. This document should be read together with the Function Description of the Variable feature <<_5, [5]>>. For more information on the EPTF CLL, consult the Users Guide <<_4, [4]>> and the Function Specification <<_3, [3]>> of the TitanSim.
== System Requirements
In order to use the Variable feature the system requirements listed in EPTF CLL User Guide <<_4, [4]>> should be fulfilled.
= Variable
== Overview
The EPTF CLL Variable component is a fundamental component providing an enhanced implementation for variables in a TTCN-3 test environment. It has been developed specifically for load test requirements, but can be used in other application areas, as well.
[[description_of_files_in_this_feature]]
== Description of Files In This Feature
The EPTF CLL Variable API includes the following files:
* Variable
** __EPTF_CLL_Variable_Definitions.ttcn__ - This TTCN-3 module contains common type definitions that should be used in all Variable Components.
** __EPTF_CLL_Variable_Functions.ttcn__ - This TTCN-3 module contains the implementation of Variable functions.
** __EPTF_CLL_Variable_ExternalFunctions.cc__ - This TTCN-3 module contains the c++ implementation of external functions of Variable.
[[description_of_required_files_from_other_features]]
== Description of Required Files From Other Features
The Variable feature is part of the TitanSim EPTF Core Load Library (CLL). It relies on several features of the CLL. The user has to obtain the products/files to be found under the respective feature names:
* `Base`
* `Common`
* `Hashmap`
* `FreeBusyQueue`
* `TCCUsefulFunctions`
== Installation
Since EPTF CLL Variable is used as a part of the TTCN-3 test environment this requires TTCN-3 Test Executor to be installed before any operation of these functions.
If not otherwise noted in the respective sections, the following are needed to use `EPTF_CLL_Variable`:
* Copy the files listed in section <<description_of_files_in_this_feature, Description of Files In This Feature>> and <<description_of_required_files_from_other_features, Description of Files In This Feature>> to the directory of the test suite or create symbolic links to them.
* Import the Variable demo or write your own application using Variable.
* Create _Makefile_ or modify the existing one.
* Edit the config file according to your needs.
== Configuration
The executable test program behavior is determined via the run-time configuration file. This is a simple text file, which contains various sections. The usual suffix of configuration files is _.cfg_.
Actual values of these parameters when there is no default value or a different from the default actual value to be used shall be given in the `[MODULE_PARAMETERS]` section of the configuration file.
The EPTF Variable feature defines the following module parameters:
* boolean `EPTF_CLL_Variable_Definitions.tsp_debugVerbose_PoolMgmt`
+
This module parameter can be used to enable debugging of the pool of booleans used for handling blocking situations.
+
Default: `_false_`.
* float `tsp_EPTF_Var_SyncInterval`
+
This module parameter sets the period in seconds for refreshing the buffered subscribers (`timeLine`, `sampled`, `sampledAtSync` subscription modes).
+
Default: `_10.0_`
* boolean `tsp_EPTF_Var_enableName2Id`
+
Enables the `hashMap` used for finding variables by name.
+
Default: `false`
* boolean `tsp_EPTF_Var_enableCompRef2Id`
+
Enables the `hashMap` used for finding variables by component reference.
+
Default: `false`
* boolean `tsp_EPTF_Var_enableEmptyTimeLine`
+
By default the heartbeat message that is sent to all remote components where there are subscribers is disabled. This module parameter can be used to enable this heartbeat. It is not recommended to enable this module parameter because the heartbeat messages can generate a lot of internal messages.
+
Default: `_false_`
* charstring `tsp_EPTF_Var_snapshotFilename`
+
The default name of the snapshot file without the timestamp used by the function `f_EPTF_Var_save`.
+
Its default value is `_"EPTF_Var_SnapshotFile"_`.
* charstring `tsp_EPTF_Var_snapshotTimestamp`
+
The default timestamp of the snapshot file used by the function `f_EPTF_Var_save`.
+
Its default value is `_"__%Y-%m-%d__%H.%M.%S.cfg"_`.
* float `tsp_EPTF_Var_maxWaitTimeForByeAck`
+
The maximum waiting time for `ByeAck` messages during cleanup.
+
Its default value is `_240.0_` sec.
== Usage
To use the EPTF Variable feature
* extend your component with the `EPTF_Var_CT` component.
* call the init function of the Variable to initialize the feature
* use its public functions to create/adjust/subscribe for variables
NOTE: The init function activates the main altstep of the Variable, so it is not necessary to call it explicitly in any of your altsteps.
Do not access the component variables in `EPTF_Var_CT` directly! Use the API functions instead.
To create EPTF Variables use the `f_EPTF_Var_new`* functions. To modify their values use `f_EPTF_Var_adjust__`. To set a new value without invoking the refresh mechanism (notifying the subscribers) call `f_EPTF_Var_set__`. For subscribing to variables in remote PTC-s use `f_EPTF_var_subscribe`*.
NOTE: When you create referenced EPTF Variables do not modify the referred variables afterwards (do not add new elements to arrays, record of-s). This is especially true if you are assigning referenced EPTF Variables to elements of *record of* types. Adding new elements may result in memory reallocation and that will make the stored references in the EPTF Variables unusable.
Guard functions can be used to validate new values before setting them into the EPTF Variables.
`CalcFn` function can be used to automatically calculate the value of an EPTF Variable from other EPTF Variables.
`PostProc` functions can be used to perform some tasks after the value of the EPTF Variable was set, but before the subscribers were notified.
The unsubscribe notify functions are useful to get call-back if the variable was unsubscribed from its provider.
The adjust handler (argument of the adjust function) can be used to perform some task after the adjust response is received, but without blocking the execution of the process calling the adjust function.
It is possible to register callback functions for the sync-event for any refresh rate (the event when the update of `timelined`, `sampled` etc. subscribers takes place for a given refresh rate) by the `f_EPTF_Var_addSyncCallBackFn` function. All registered callbacks are called in order of registration before/after the updates are sent to the subscribers.
It is also possible to snapshot the value of all EPTF Variables registered to save by the function `f_EPTF_Var_registerVarToSave` with the help of the function `f_EPTF_Var_save`. It saves the value of EPTF Variables in a module parameter format. To load the saved data call `f_EPTF_Var_loadVarsFromCfg`.
NOTE: The saved file should be included into the runtime configuration file and the module parameter in it shall be defined in a TTCN-3 module.
= Error Messages
NOTE: Besides the below described error messages, error messages shown in ‎<<_2, [2]>> or those of other used features or product may also appear.
`*EPTF_Var[<idx>] content is not and <type>Type reference*`
The `f_EPTF_Var_get<type>Value` function is called for a referenced content EPTF Variable with a different type.
`*EPTF_Var[<idx>] has invalid content*`
One of the `f_EPTF_Var_get<some type>Value` functions was called for a variable that has invalid content
`*EPTF_Var[<idx>] is not a referenced variable*`
The `f_EPTF_Var_getValueRef` function was called for a variable which is not a referenced content variable
`*Cannot set local provider for EPTF_Var[<idx>]. It has already a provider*`
The function `f_EPTF_Var_subscribeLocal` was called for a variable which already has a provider
`*Cannot adjust the content of the EPTF_Var[<idx>]. It has a local provider! <the data of the variable>*`
The `f_EPTF_Var_adjustContent` function was called for a variable that has a local provider. These kinds of variables cannot be adjusted.
`*Cannot adjust the content of the EPTF_Var[<idx>]. It has a local top-provider! <the data of the variable>*`
The `f_EPTF_Var_adjustContent` function was called for a variable that is a subscriber of a remote variable, but the top level provider is a calculated variable.
`*New EPTF Variable name is not unique: <name> Already defined by EPTF_Var[<idx>]: <the data of the variable>*`
When a new EPTF Variable was created the name specified is already in use by an existing variable
`*Cannot convert invalid content to direct content <directContent>.*`
The content of the EPTF Variable to be converted is invalid
`*Cannot convert direct content <directContent> to direct content <content> Types are incompatible*`
Cannot set the given `directContent` into the EPTF Variable. It has a different content type.
`*Cannot convert direct content <directContent> to string.*`
The given content cannot be converted to string.
`*Variable <subscriberVarName> on component < provider.compRef> does not exist. Subscribe failed by the subscriber: <subscriber>*`
Subscribe failed. The variable with the given name does not exist on the specified component.
`*Auto-generated name <autoName> for subscriber EPTF_Var[<subscriber.idx>] is not unique. Already defined by EPTF_Var[<idx>]: <Variable data>*`
The local name for the subscriber variable was not specified, so it was auto-generated. But the auto-generated name already exists.
`*Callback function for AdjustRemoteContentResp handler not found. Database error!*`
This is an internal error. Internal database of call-back functions is corrupt.
`*SyncBuffer does not contain data for component <remoteCompRef>*`
The syncBuffer database is corrupt.
`*Cannot adjust the content of the EPTF_Var[<idx>]. It has a local provider! <variable data> EPTF_Var_Msg_AdjustContent message dropped.*`
An adjust request is received for a variable that cannot be adjusted. This is an internal error. This message should not have been sent.
`*Callback function not found. Database error!*`
Internal error.
`*Unexpected message received from <senderComp>: <msg data>*`
Unexpected message received on the Variable internal interface.
`*<some text> Assertion failed! <some text>*`
Internal error.
= Warning Messages
NOTE: Besides the below described warning messages, warning messages shown in ‎<<_2, [2]>> or those of other used features or product may also appear.
`*Already subscribed for <remoteCompRef>:<remoteProviderVarName> by v_EPTF_Vars[<idx>]: <variable data>*`
The subscription already exists.
`*No response received for subscribe data: <idx> <remoteCompRef> <remoteProviderVarName> <subscriptionMode> <blockingFlagIdx>*`
The provider component does not respond for subscribe. The subscribe function timeouts, and the created variable is not properly subscribed. This may cause errors later.
`*The guard function #<i> (<guardFn>]) of EPTF_Var[<idx>] does not accept the new value: <newContent>*`
There was a failed attempt to modify the value of the EPTF Variable
`*Unexpected message received from <senderComp> during cleanup. Message dropped: <msg data>*`
Cleanup is in progress. Most of the messages are dropped (e.gno more subscriptions allowed, etc.).
`*–VAR CLEANUP TIMEOUT– Not all responses received for bye messages.*`
The cleanup is not properly performed. One ore more connected Variable components did not respond in time. The execution of the current component is forced to terminate. This may result in errors in other components afterwards. The maximum waiting time can be adjusted via the module parameter `tsp_EPTF_Var_maxWaitTimeForByeAck` or by calling the function `f_EPTF_Var_setMaxWaitTimeForByeAck`.
`*Cannot forward adjustcontentNack to variable <variable>. Not a subscriber of EPTF_Var[<idx>].*`
The subscriber variable that was adjusted unsubscribed from its provider before the response to the adjust request is received. The response is dropped.
`*EPTF_Var_Msg_GetRemoteContent is received for a nonexistent EPTF Variable: <name>*`
The component which sent the `getRemote` message exited before it was answered.
`*EPTF_Var_Msg_AdjustRemoteContent is received for a nonexistent EPTF Variable: <name>*`
The component which sent the `adjustRemote` message exited before it was answered.
`*EPTF_Var_Msg_AdjustRemoteContent received for an EPTF Variable with local top-provider: <idx>*`
There was a failed attempt to adjust the variable without subscription.
`*Cannot load Variable <name> from config: Variable does not exist.*`
The variable that should be loaded from the configuration data does not exist.
`*f_EPTF_Var_save: cannot open file <filename>: <reason>*`
The specified file could not be opened.
`*f_EPTF_Var_save: cannot save EPTF_Variable data to file <filename>: <reason>*`
A write error encountered. Saving data to the specified file failed.
= Examples
The "demo" directory of the deliverable contains the following examples:
* _main.cfg_
* __EPTF_Variable_test.ttcn__
== Configuration File
The used configuration file (_main.cfg_) is for the Variable example is placed in the demo directory.
== Demo Module
The demo module __EPTF_Variable_test.ttcn__illustrates a typical usage of the Variable feature.
There are two main demo configurations. The first configuration uses one component and the second uses several components. The basic behavior of the Variable feature is demonstrated on these test configurations
See Basic Configuration in the figure below:
image:images/Basic_Configuration.png[alt]
The left box shows the component variables which are used to create a referenced EPTF Variable. The left column in the right box shows the EPTF Variable names created (auto refers to auto-generated names), and the subscription relation between them. On the right the index of the variables are shown together with the name of the component variable that stores the index.
=== Terminology
*Core Library (CLL):* +
It is that part of the TitanSim software that is totally project independent. (i.e., which is not protocol-, or application-dependent). The Core Library is to be supplied and supported by the TCC organization. Any Core Library development is to be funded centrally by Ericsson.
*Variables:* +
It contain values, that can be accessed from remote components.
=== Abbreviations
CLL:: Core Library
EPTF:: Ericsson Performance Test Framework
TitanSim:: New synonym for the EPTF Framework
TTCN-3:: Testing and Test Control Notation version 3 <<_1, [1]>>.
= References
[[_1]]
[1] ETSI ES 201 873-1 v3.2.1 (2007-02) +
The Testing and Test Control Notation version 3. http://www.etsi.org/deliver/etsi_es/201800_201899/20187301/03.02.01_60/es_20187301v030201p.pdf[Part 1: Core Language]
[[_2]]
[2] User Guide for the TITAN TTCN-3 Test Executor
[[_3]]
[3] EPTF CLL for TTCN-3 toolset with TITAN, Function Specification
[[_4]]
[4] EPTF CLL for TTCN-3 toolset with TITAN, User Guide
[[_5]]
[5] EPTF CLL Variable Function Description
[[_6]]
[6] TitanSim CLL for TTCN-3 toolset with TITAN +
http://ttcn.ericsson.se/TCC_Releases/Libraries/EPTF_Core_Library_CNL113512/doc/apidoc/html/index.html[Reference Guide]