Test parameters

Overview

If you need to pass a parameter to a test scenarion you need to specify that parameter in te_engine_tester configuration file (package description file). More…

// typedefs

typedef enum sapi_buf_size sapi_buf_size;
typedef struct tapi_test_expected_result tapi_test_expected_result;

// enums

enum sapi_buf_size;
enum test_ethdev_state;

// structs

struct tapi_test_expected_result;

// global variables

unsigned int te_test_id = TE_LOG_ID_UNDEFINED;

// global functions

const char* test_get_opt_string_param(int argc, char** argv, const char* name);
te_optional_uint_t test_get_opt_uint_param(int argc, char** argv, const char* name);
te_optional_uintmax_t test_get_opt_uint64_param(int argc, char** argv, const char* name);
te_optional_double_t test_get_opt_double_param(int argc, char** argv, const char* name);
te_optional_double_t test_get_opt_value_unit_param(int argc, char** argv, const char* name);
te_optional_uintmax_t test_get_opt_value_bin_unit_param(int argc, char** argv, const char* name);
te_bool te_sigusr2_caught(void);
const char* test_find_param(int argc, char* argv[], const char* name);
const char* test_get_param(int argc, char* argv[], const char* name);
int test_map_param_value(const char* var_name, const struct param_map_entry* maps, const char* str_val, int* num_val);
uint8_t* test_get_octet_string_param(const char* str_val, size_t len);
int test_get_enum_param(int argc, char** argv, const char* name, const struct param_map_entry* maps);
const char* test_get_string_param(int argc, char** argv, const char* name);
char* test_get_filename_param(int argc, char** argv, const char* name);
int test_get_int_param(int argc, char** argv, const char* name);
unsigned int test_get_test_id(int argc, char** argv);
unsigned int test_get_uint_param(int argc, char** argv, const char* name);
int64_t test_get_int64_param(int argc, char** argv, const char* name);
uint64_t test_get_uint64_param(int argc, char** argv, const char* name);
double test_get_double_param(int argc, char** argv, const char* name);
char* test_get_default_string_param(const char* test_name, const char* param_name);
uint64_t test_get_default_uint64_param(const char* test_name, const char* param_name);
double test_get_default_double_param(const char* test_name, const char* param_name);
double test_get_value_unit_param(int argc, char** argv, const char* name);
uintmax_t test_get_value_bin_unit_param(int argc, char** argv, const char* name);
te_bool tapi_test_check_expected_result(const tapi_test_expected_result* expected, te_errno rc, const char* output);
te_bool tapi_test_check_expected_int_result(const tapi_test_expected_result* expected, te_errno rc, intmax_t ival);
tapi_test_expected_result test_get_expected_result_param(int argc, char** argv, const char* name);
const char* print_octet_string(const uint8_t* oct_string, size_t len);
int test_split_param_list(const char* list, char sep, char*** array_p);
te_errno tapi_asn_param_value_parse(char* pwd, char** s, const asn_type* type, asn_value** parsed_val, int* parsed_syms, char* ns);
te_errno tapi_asn_params_get(int argc, char** argv, const char* conf_prefix, const asn_type* conf_type, asn_value* conf_value);
te_errno tapi_test_args2kvpairs(int argc, char* argv[], te_kvpair_h* args);
void test_octet_strings2list(const char* str, unsigned int str_len, uint8_t*** oct_str_list, unsigned int* list_len);

// macros

#define BOOL3_MAPPING_LIST
#define BOOL_MAPPING_LIST
#define BUF_SIZE_MAPPING_LIST
#define ETHDEV_STATE_MAPPING_LIST
#define FILTER_TYPE_MAPPING_LIST
#define TEST_DEFAULT_DOUBLE_PARAM(var_name_)
#define TEST_DEFAULT_UINT64_PARAM(var_name_)
#define TEST_DOUBLE_PARAM(var_name_)
#define TEST_ENUM_PARAM(var_name_, maps_...)
#define TEST_EXPECTED_RESULT_PARAM(var_name_)
#define TEST_FILENAME_PARAM(var_name_)
#define TEST_GET_BIT_MASK_PARAM(var_name_, maps_...)
#define TEST_GET_BOOL3_PARAM(var_name_)
#define TEST_GET_BOOL_PARAM(var_name_)
#define TEST_GET_BUFF_SIZE(var_name_)
#define TEST_GET_DEFAULT_DOUBLE_PARAM(var_name_)
#define TEST_GET_DEFAULT_UINT64_PARAM(var_name_)
#define TEST_GET_DOUBLE_PARAM(var_name_)
#define TEST_GET_ENUM_PARAM(var_name_, maps_...)
#define TEST_GET_ETHDEV_STATE(var_name_)
#define TEST_GET_EXPECTED_RESULT_PARAM(var_name_)
#define TEST_GET_FILENAME_PARAM(var_name_)
#define TEST_GET_FILTER_TYPE(var_name_)
#define TEST_GET_INT64_PARAM(var_name_)
#define TEST_GET_INT_LIST_PARAM(var_name_, var_len_)
#define TEST_GET_INT_PARAM(var_name_)
#define TEST_GET_IP4_PARAM(var_name_)
#define TEST_GET_OCTET_STRING_LIST_PARAM(var_name_, var_list_len_, var_str_len_)
#define TEST_GET_OCTET_STRING_PARAM(var_name_, var_len_)
#define TEST_GET_OPT_DOUBLE_PARAM(var_name_)
#define TEST_GET_OPT_STRING_PARAM(var_name_)
#define TEST_GET_OPT_UINT64_PARAM(var_name_)
#define TEST_GET_OPT_UINT_PARAM(var_name_)
#define TEST_GET_OPT_VALUE_BIN_UNIT_PARAM(var_name_)
#define TEST_GET_OPT_VALUE_UNIT_PARAM(var_name_)
#define TEST_GET_STRING_LIST_PARAM(var_name_, var_len_)
#define TEST_GET_STRING_PARAM(var_name_)
#define TEST_GET_TUNNEL_TYPE(var_name_)
#define TEST_GET_UINT64_PARAM(var_name_)
#define TEST_GET_UINT_PARAM(_parameter)
#define TEST_GET_VALUE_BIN_UNIT_PARAM(var_name_)
#define TEST_GET_VALUE_UNIT_PARAM(var_name_)
#define TEST_HAS_PARAM(var_name_)
#define TEST_INT64_PARAM(var_name_)
#define TEST_INT_PARAM(var_name_)
#define TEST_LIST_PARAM_SEPARATOR
#define TEST_OPT_DOUBLE_PARAM(var_name_)
#define TEST_OPT_STRING_PARAM(var_name_)
#define TEST_OPT_UINT64_PARAM(var_name_)
#define TEST_OPT_UINT_PARAM(var_name_)
#define TEST_OPT_VALUE_BIN_UNIT_PARAM(var_name_)
#define TEST_OPT_VALUE_UNIT_PARAM(var_name_)
#define TEST_STRING_PARAM(var_name_)
#define TEST_UINT64_PARAM(var_name_)
#define TEST_UINT_PARAM(var_name_)
#define TEST_VALUE_BIN_UNIT_PARAM(var_name_)
#define TEST_VALUE_UNIT_PARAM(var_name_)
#define TUNNEL_TYPE_MAPPING_LIST

Detailed Documentation

If you need to pass a parameter to a test scenarion you need to specify that parameter in te_engine_tester configuration file (package description file). Each parameter is associated with symbolic name that should be used as the key while getting parameter value in test scenario context.

The main function to process test parameters in test scenario context is test_get_param(). It gets parameter name as an argument value and returns string value associated with that parameter.

Apart from base function test_get_param() there are a number of macros that process type-specific parameters:

For example for the following test run (from package.xml):

<run>
  <script name="comm_sender"/>
    <arg name="size">
      <value>1</value>
      <value>100</value>
    </arg>
    <arg name="oob">
      <value>TRUE</value>
      <value>FALSE</value>
    </arg>
    <arg name="msg">
      <value>Test message</value>
    </arg>
</run>

we can have the following test scenario:

int main(int argc, char **argv)
{
    int      size;
    te_bool  oob;
    char    *msg;

    TEST_START;

    TEST_GET_INT_PARAM(size);
    TEST_GET_BOOL_PARAM(oob);
    TEST_GET_STRING_PARAM(msg);
    ...
}

Please note that variable name passed to TEST_GET_xxx_PARAM() macro shall be the same as expected parameter name.

Test suite can also define parameters of enumeration type. For this kind of parameters you will need to define a macro based on TEST_GET_ENUM_PARAM().

For example if you want to specify something like the following in your package.xml files:

<enum name="ledtype">
  <value>POWER</value>
  <value>USB</value>
  <value>ETHERNET</value>
  <value>WIFI</value>
</enum>

<run>
  <script name="led_test"/>
    <arg name="led" type="ledtype"/>
</run>

You can define something like this in your test suite header file (test_suite.h):

enum ts_led {
    TS_LED_POWER,
    TS_LED_USB,
    TS_LED_ETH,
    TS_LED_WIFI,
};
#define LEDTYPE_MAPPING_LIST \
           { "POWER", (int)TS_LED_POWER },  \
           { "USB", (int)TS_LED_USB },      \
           { "ETHERNET", (int)TS_LED_ETH }, \
           { "WIFI", (int)TS_LED_WIFI }

#define TEST_GET_LED_PARAM(var_name_) \
            TEST_GET_ENUM_PARAM(var_name_, LEDTYPE_MAPPING_LIST)

Then in your test scenario you can write the following:

int main(int argc, char **argv)
{
    enum ts_led led;

    TEST_START;

    TEST_GET_LED_PARAM(led);
    ...
    switch (led)
    {
        case TS_LED_POWER:
    ...
    }
    ...
}

Typedefs

typedef enum sapi_buf_size sapi_buf_size

Abstaract enum to ‘buf_size’ parameter

typedef struct tapi_test_expected_result tapi_test_expected_result

The description of an expected result.

The structure should be considered opaque and only handled by dedicated functions such as test_get_expected_result_param(), TEST_EXPECTED_RESULT_PARAM(), TEST_GET_EXPECTED_RESULT_PARAM(), tapi_test_check_expected_result(), tapi_test_check_expected_int_result().

The values of this type may be freely copied, they do not contain any dynamically-allocated resources.

Global Variables

unsigned int te_test_id = TE_LOG_ID_UNDEFINED

See description in tapi_test.h

Global Functions

const char* test_get_opt_string_param(int argc, char** argv, const char* name)

Same as test_get_string_param(), but returns NULL if the parameter value is blank.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

parameter value or NULL

te_optional_uint_t test_get_opt_uint_param(int argc, char** argv, const char* name)

Same as test_get_uint_param(), but the return type is optional.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

an optional unsigned value

See also:

te_optional_uint_t

te_optional_uintmax_t test_get_opt_uint64_param(int argc, char** argv, const char* name)

Same as test_get_uint64_param(), but the return type is optional.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

an optional long unsigned value

See also:

te_optional_uintmax_t

te_optional_double_t test_get_opt_double_param(int argc, char** argv, const char* name)

Same as test_get_double_param() but the return type is optional.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

an optional double value

See also:

te_optional_double_t

te_optional_double_t test_get_opt_value_unit_param(int argc, char** argv, const char* name)

Same as test_get_value_unit_param() but the return type is optional.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

an optional double value

See also:

te_optional_double_t

te_optional_uintmax_t test_get_opt_value_bin_unit_param(int argc, char** argv, const char* name)

Same as test_get_value_bin_unit_param() but the return type is optional.

Parameters:

argc

count of arguments

argv

list of arguments

name

name of parameter

Returns:

an optional long unsigned value

See also:

te_optional_uintmax_t

te_bool te_sigusr2_caught(void)

Check whether SIGUSR2 signal has ever been caught

Parameters:

FALSE

No signal has been caught

TRUE

Signal(-s) has(-ve) been caught.

const char* test_find_param(int argc, char* argv[], const char* name)

Finds a particular parameter in the list of parameters

Parameters:

argc

number of parameters

argv

Array of parameters in form “<param name>=<param value>”

name

Parameter name whose value we want to obtain

NULL

if parameter is not in the list of parameters

Returns:

Pointer to the parameter

const char* test_get_param(int argc, char* argv[], const char* name)

Finds value of particular parameter in the list of parameters

Parameters:

argc

number of parameters

argv

Array of parameters in form “<param name>=<param value>”

name

Parameter name whose value we want to obtain

Returns:

Pointer to the value of the parameter

int test_map_param_value(const char* var_name, const struct param_map_entry* maps, const char* str_val, int* num_val)

Maps all possible values of some variable from string to numberical representation.

Parameters:

var_name

Variable name whose value is being converted

maps

Structure with mappings “str” -> num

str_val

String value that should be mapped

num_val

Mapped value (OUT)

0

Mapping is successfully done

-1

Mapping fails (in this case the procedure generates ERROR message that describes the problem found during the procedure)

Returns:

Status of the operation

uint8_t* test_get_octet_string_param(const char* str_val, size_t len)

Transform string value to octet string value.

Octet string returned by this function should be deallocated with free() call.

Parameters:

str_val

String value (each byte is in hex format and delimeter is ‘:’ character

len

Expected octet string value length

Returns:

Octet string value or NULL int case of failure.

int test_get_enum_param(int argc, char** argv, const char* name, const struct param_map_entry* maps)

Generic way to return mapped value of a parameter: string -> enum

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

maps

An array of mappings: string -> enum

const char* test_get_string_param(int argc, char** argv, const char* name)

Return parameters of type ‘char *’, i.e. not parsed string value of the parameter

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

char* test_get_filename_param(int argc, char** argv, const char* name)

Return parameters of type char * with full filename which is the result of test location and file name concatenation.

Parameters:

argc

Count of arguments

argv

List of arguments

name

Returns:

String allocated from heap which should be freed by caller

int test_get_int_param(int argc, char** argv, const char* name)

Return parameters of type ‘int’

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

unsigned int test_get_test_id(int argc, char** argv)

Dedicated function to get te_test_id before any jump points installed (since logging of jump point setup requires te_test_id to associate the log message with the test).

Parameters:

argc

Count of arguments

argv

List of arguments

Returns:

TE test ID

unsigned int test_get_uint_param(int argc, char** argv, const char* name)

Return parameters of type ‘uint’

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

int64_t test_get_int64_param(int argc, char** argv, const char* name)

Return parameters of type ‘long long int’

Parameters:

argc

Count of arguments

argc

List of arguments

name

Name of parameter

uint64_t test_get_uint64_param(int argc, char** argv, const char* name)

Return parameters of type ‘unsigned long long int’

Parameters:

argc

count of arguments

argv

list of arguments

name

parameter name

Returns:

the value of a parameter name

double test_get_double_param(int argc, char** argv, const char* name)

Return parameters of type ‘double’

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

char* test_get_default_string_param(const char* test_name, const char* param_name)

Get default value of string parameter from local subtree.

Function allocates memory with malloc(), which should be freed with free() by the caller.

Parameters:

test_name

Name of test the parameter belongs.

param_name

Parameter name.

Returns:

Default value of param_name.

uint64_t test_get_default_uint64_param(const char* test_name, const char* param_name)

Get default value of uint64 parameter from local subtree.

Parameters:

test_name

Name of test the parameter belongs.

param_name

Parameter name.

Returns:

Default value of param_name.

double test_get_default_double_param(const char* test_name, const char* param_name)

Get default value of double parameter from local subtree.

Parameters:

test_name

Name of test the parameter belongs.

param_name

Parameter name.

Returns:

Default value of param_name.

double test_get_value_unit_param(int argc, char** argv, const char* name)

Return parameters of type ‘value-unit’ (‘double’)

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

uintmax_t test_get_value_bin_unit_param(int argc, char** argv, const char* name)

Return parameters of type ‘value-unit’ (unsigned).

Unlike test_get_value_unit_param(), the function uses binary base prefixes (i.e. 1024, not 1000).

Bug The function uses doubles internally for unit conversion, and a double cannot hold all range of 64-bit integral values, so very large values (greater than approx. 4.5e15 or 4P) may be represented imprecisely.

Parameters:

argc

Count of arguments

argv

List of arguments

name

Name of parameter

te_bool tapi_test_check_expected_result(const tapi_test_expected_result* expected, te_errno rc, const char* output)

Check whether the actual result matches the expected one.

The function will log details in case of a result mismatch, but it won’t automatically fail the test.

Parameters:

expected

the description of the expected result

rc

actual status code

output

actual output

Returns:

TRUE if the actual result matches the expected one.

te_bool tapi_test_check_expected_int_result(const tapi_test_expected_result* expected, te_errno rc, intmax_t ival)

Check whether the actual integral result matches the expected one.

The expected output in expected must be a string representing an integral value; otherwise the function will fail the test.

If expected contains NULL expected output, ival is not checked at all.

Parameters:

expected

the description of the expected result

rc

actual status code

ival

actual integral result

Returns:

TRUE if the actual result matches the expected one.

tapi_test_expected_result test_get_expected_result_param(int argc, char** argv, const char* name)

Get a parameter representing some expected result.

The value has one of the following two forms:

[[MODULE_CODE "-" ] ERROR_CODE [ ":" EXPECTED_OUTPUT ]
[ "OK:" ] EXPECTED_OUTPUT

The module code and the error code correspond to names of members of te_module and te_errno_codes without the TE_ prefix.

If EXPECTED_OUTPUT is not provided, it is taken to be NULL.

For example:

  • OK:This is the output

  • This is the output

  • This is the output: it contains colons

  • OK:ENOENT:This is the output ENOENT here is part of the output.

  • ENOENT the output is expected to be @ NULL

  • TAPI-ENOENT

  • TAPI-ENOENT:Expected error message

Also see suites/selftest/ts/minimal/parameters.c fore more examples.

Parameters:

argc

number of arguments

argv

list of arguments

name

name of the parameter

Returns:

the expected result description

const char* print_octet_string(const uint8_t* oct_string, size_t len)

Print octet string.

Parameters:

oct_string

Octet string

len

Octet string lentgh

Returns:

Buffer with string representation of octet string

int test_split_param_list(const char* list, char sep, char*** array_p)

Split parameter string into array of string, using specified separator. This function creates a duplicate parameter string to avoid changing the real parameter.

Parameters:

list

String to parse

sep

Separator to split string

array_p

Array to return

Returns:

Length of the list or 0 on error

te_errno tapi_asn_param_value_parse(char* pwd, char** s, const asn_type* type, asn_value** parsed_val, int* parsed_syms, char* ns)

Function parses value and converts it to ASN value. It also handles cfg links.

Parameters:

ns

Preallocated buffer for updated value

te_errno tapi_asn_params_get(int argc, char** argv, const char* conf_prefix, const asn_type* conf_type, asn_value* conf_value)

Parse test ASN parameters.

Parameters:

argc

Amount of test parameters

argv

Test parameters array

conf_prefix

Test ASN parameters prefix

conf_type

Test ASN parameters aggregation type

conf_value

Resulted ASN parameters aggregation value

Returns:

0 if success, or corresponding error otherwise

te_errno tapi_test_args2kvpairs(int argc, char* argv[], te_kvpair_h* args)

Add test arguments to the list of test parameters

void test_octet_strings2list(const char* str, unsigned int str_len, uint8_t*** oct_str_list, unsigned int* list_len)

Convert the string with several octet strings separated by commas to array of octet strings

Parameters:

str

String with octet strings

str_len

Octet string lentgh

oct_str_list

Array with octet strings (OUT)

list_len

Length of the array (OUT)

Macros

#define BOOL3_MAPPING_LIST

The list of values allowed for parameter of type ‘te_bool3’

#define BOOL_MAPPING_LIST

The list of values allowed for parameter of type ‘te_bool’

#define BUF_SIZE_MAPPING_LIST

The list of values allowed for parameter of type ‘sapi_buf_size’

#define ETHDEV_STATE_MAPPING_LIST

The list of values allowed for parameter of type ‘test_ethdev_state’

#define FILTER_TYPE_MAPPING_LIST

The list of values allowed for parameter of type ‘tarpc_rte_filter_type’

#define TEST_DEFAULT_DOUBLE_PARAM(var_name_)

The macro to return default value of ‘double’ parameter from local subtree.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value.

Returns:

double value.

#define TEST_DEFAULT_UINT64_PARAM(var_name_)

The macro to return default value of ‘uint64’ parameter from local subtree.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value.

Returns:

uint64 value.

#define TEST_DOUBLE_PARAM(var_name_)

The macro to return parameters of type ‘double’ (‘float’ also may be used)

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

Returns:

double value

#define TEST_ENUM_PARAM(var_name_, maps_...)

Generic way to return mapped value of a parameter: string -> enum

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

maps_

An array of mappings: string -> enum

Returns:

mapped value

#define TEST_EXPECTED_RESULT_PARAM(var_name_)

The macro to get a parameter representing some expected result.

See test_get_expected_result_param() for the parameter value syntax.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

tapi_test_expected_result value

#define TEST_FILENAME_PARAM(var_name_)

The macro to return parameters of type char * with a full filename which is the result of test location and file name concatenation.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

NULL

If relative path is empty

Returns:

full filename allocated from heap and should be freed by caller

#define TEST_GET_BIT_MASK_PARAM(var_name_, maps_...)

The macro to get parameter of bit mask type.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

maps_

An array of mappings: string -> enum of each entry of a bitmask

#define TEST_GET_BOOL3_PARAM(var_name_)

Get the value of parameter of type ‘te_bool3’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘te_bool3’ (OUT)

#define TEST_GET_BOOL_PARAM(var_name_)

Get the value of parameter of type ‘te_bool’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘te_bool’ (OUT)

#define TEST_GET_BUFF_SIZE(var_name_)

Get the value of parameter of type ‘sapi_buf_size’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘sapi_buf_size’ (OUT)

#define TEST_GET_DEFAULT_DOUBLE_PARAM(var_name_)

The macro to get default value of ‘double’ parameter from local subtree.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value.

#define TEST_GET_DEFAULT_UINT64_PARAM(var_name_)

The macro to get default value of ‘uint64’ parameter from local subtree.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value.

#define TEST_GET_DOUBLE_PARAM(var_name_)

The macro to get parameters of type ‘double’ (‘float’ also may be used)

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_ENUM_PARAM(var_name_, maps_...)

Generic way to get mapped value of a parameter: string -> enum

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

maps_

An array of mappings: string -> enum

#define TEST_GET_ETHDEV_STATE(var_name_)

Get the value of parameter of type ‘test_ethdev_state’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘test_ethdev_state’ (OUT)

#define TEST_GET_EXPECTED_RESULT_PARAM(var_name_)

The macro to assign a parameter representing some expected result.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_FILENAME_PARAM(var_name_)

The macro to get parameters of type char * with a full filename and assign it to the variable with corresponding name.

Full filename is a concatation of the running test location and relative path specified in an argument with matching name.

NULL is assigned if relative path is empty.

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_FILTER_TYPE(var_name_)

Get the value of parameter of type ‘tarpc_rte_filter_type’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘tarpc_rte_filter_type’ (OUT)

#define TEST_GET_INT64_PARAM(var_name_)

The macro to get parameters of type ‘int64’

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_INT_LIST_PARAM(var_name_, var_len_)

The macro to get parameter of type ‘int []’, i.e. array of numbers

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_INT_PARAM(var_name_)

The macro to get parameters of type ‘int’

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_IP4_PARAM(var_name_)

Get the value of parameter that represents IPv4 address.

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘in_addr_t’ (OUT)

#define TEST_GET_OCTET_STRING_LIST_PARAM(var_name_, var_list_len_, var_str_len_)

The macro to get parameter of type ‘octet string[]’, i.e. array of octet strings

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

var_str_len_

Octet string lentgh

var_list_len_

Variable for length of the list

#define TEST_GET_OCTET_STRING_PARAM(var_name_, var_len_)

The macro to get parameter of type ‘octet string’

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

var_len_

TODO

#define TEST_GET_OPT_DOUBLE_PARAM(var_name_)

Same as TEST_GET_DOUBLE_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_OPT_STRING_PARAM(var_name_)

Same as TEST_GET_STRING_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_OPT_UINT64_PARAM(var_name_)

Same as TEST_GET_UINT64_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_OPT_UINT_PARAM(var_name_)

Same as TEST_GET_UINT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_OPT_VALUE_BIN_UNIT_PARAM(var_name_)

Same as TEST_GET_VALUE_BIN_UNIT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_OPT_VALUE_UNIT_PARAM(var_name_)

Same as TEST_GET_VALUE_UNIT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_STRING_LIST_PARAM(var_name_, var_len_)

The macro to get parameter of type ‘char *[]’, i.e. array of string values

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_STRING_PARAM(var_name_)

The macro to get parameters of type ‘char *’, i.e. not parsed string value of the parameter

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_GET_TUNNEL_TYPE(var_name_)

Get parameter value of ‘tarpc_rte_eth_tunnel_type’ type

Parameters:

var_name_

Variable name used to get “var_name_” parameter value of ‘tarpc_rte_eth_tunnel_type’ type (OUT)

#define TEST_GET_UINT64_PARAM(var_name_)

The macro to get parameters of type ‘uint64’

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_UINT_PARAM(_parameter)

Obtain the value of an ‘unsigned int’ parameter

Parameters:

_parameter

The name to denote both the target ‘unsigned int’ variable and the parameter of interest

#define TEST_GET_VALUE_BIN_UNIT_PARAM(var_name_)

The macro to get binary-scaled parameters (unsigned with unit prefix).

Unlike TEST_GET_VALUE_UNIT_PARAM(), the macro uses binary prefixes (i.e. 1024, not 1000).

Parameters:

var_name_

variable with the same name as the name of the desired parameter

#define TEST_GET_VALUE_UNIT_PARAM(var_name_)

The macro to get parameters of type ‘value-unit’ (double with unit prefix)

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

#define TEST_HAS_PARAM(var_name_)

Check if the parameter identified by the given name is available

Parameters:

var_name_

Parameter name for check

Returns:

result of check

#define TEST_INT64_PARAM(var_name_)

The macro to return parameters of type ‘int64’

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

Returns:

int64 value

#define TEST_INT_PARAM(var_name_)

The macro to return parameters of type ‘int’

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

Returns:

int value

#define TEST_LIST_PARAM_SEPARATOR

Default separator for argument list

#define TEST_OPT_DOUBLE_PARAM(var_name_)

Same as TEST_DOUBLE_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

optional double value

#define TEST_OPT_STRING_PARAM(var_name_)

Same as TEST_STRING_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

string value (NULL if “missing”)

#define TEST_OPT_UINT64_PARAM(var_name_)

Same as TEST_UINT64_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

optional long unsigned value

#define TEST_OPT_UINT_PARAM(var_name_)

Same as TEST_UINT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

optional unsigned value

#define TEST_OPT_VALUE_BIN_UNIT_PARAM(var_name_)

Same as TEST_VALUE_BIN_UNIT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

optional long unsigned value

#define TEST_OPT_VALUE_UNIT_PARAM(var_name_)

Same as TEST_VALUE_UNIT_PARAM() but for optional parameters.

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

optional double value

#define TEST_STRING_PARAM(var_name_)

The macro to return parameters of type ‘char *’, i.e. not parsed string value of the parameter

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

Returns:

string value

#define TEST_UINT64_PARAM(var_name_)

The macro to return parameters of type ‘uint64’

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

uint64 value

#define TEST_UINT_PARAM(var_name_)

Obtain the value of an ‘unsigned int’ parameter

Parameters:

var_name_

The name to denote both the target ‘unsigned int’ variable and the parameter of interest

Returns:

unsigned int parameter

#define TEST_VALUE_BIN_UNIT_PARAM(var_name_)

The macro to get binary-scaled parameters (unsigned with unit prefix).

Unlike TEST_VALUE_UNIT_PARAM(), the macro uses binary prefixes (i.e. 1024, not 1000).

Parameters:

var_name_

variable with the same name as the name of the desired parameter

Returns:

unsigned value

#define TEST_VALUE_UNIT_PARAM(var_name_)

The macro to get parameters of type ‘value-unit’ (double with unit prefix)

Parameters:

var_name_

Variable whose name is the same as the name of parameter we get the value

Returns:

double value

#define TUNNEL_TYPE_MAPPING_LIST

List of values allowed for parameter of ‘tarpc_rte_eth_tunnel_type’ type