:orphan: .. index:: pair: group; Test parameters .. _doxid-group__te__ts__tapi__test__param: Test parameters =============== .. toctree:: :hidden: enum_sapi_buf_size.rst enum_test_ethdev_state.rst struct_tapi_test_expected_result.rst 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). :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef enum :ref:`sapi_buf_size` :ref:`sapi_buf_size`; typedef struct :ref:`tapi_test_expected_result` :ref:`tapi_test_expected_result`; // enums enum :ref:`sapi_buf_size`; enum :ref:`test_ethdev_state`; // structs struct :ref:`tapi_test_expected_result`; // global variables unsigned int :ref:`te_test_id` = :ref:`TE_LOG_ID_UNDEFINED`; // global functions const char* :ref:`test_get_opt_string_param`(int argc, char** argv, const char* name); :ref:`te_optional_uint_t` :ref:`test_get_opt_uint_param`(int argc, char** argv, const char* name); :ref:`te_optional_uintmax_t` :ref:`test_get_opt_uint64_param`(int argc, char** argv, const char* name); :ref:`te_optional_double_t` :ref:`test_get_opt_double_param`(int argc, char** argv, const char* name); :ref:`te_optional_double_t` :ref:`test_get_opt_value_unit_param`(int argc, char** argv, const char* name); :ref:`te_optional_uintmax_t` :ref:`test_get_opt_value_bin_unit_param`(int argc, char** argv, const char* name); bool :ref:`te_sigusr2_caught`(void); const char* :ref:`test_find_param`(int argc, char* argv[], const char* name); const char* :ref:`test_get_param`(int argc, char* argv[], const char* name); int :ref:`test_map_param_value`(const char* var_name, const struct :ref:`param_map_entry`* maps, const char* str_val, int* num_val); uint8_t* :ref:`test_get_octet_string_param`(const char* str_val, size_t len); int :ref:`test_get_enum_param`(int argc, char** argv, const char* name, const struct :ref:`param_map_entry`* maps); const char* :ref:`test_get_string_param`(int argc, char** argv, const char* name); char* :ref:`test_get_filename_param`(int argc, char** argv, const char* name); int :ref:`test_get_int_param`(int argc, char** argv, const char* name); unsigned int :ref:`test_get_test_id`(int argc, char** argv); unsigned int :ref:`test_get_uint_param`(int argc, char** argv, const char* name); int64_t :ref:`test_get_int64_param`(int argc, char** argv, const char* name); uint64_t :ref:`test_get_uint64_param`(int argc, char** argv, const char* name); double :ref:`test_get_double_param`(int argc, char** argv, const char* name); char* :ref:`test_get_default_string_param`(const char* test_name, const char* param_name); uint64_t :ref:`test_get_default_uint64_param`(const char* test_name, const char* param_name); double :ref:`test_get_default_double_param`(const char* test_name, const char* param_name); double :ref:`test_get_value_unit_param`(int argc, char** argv, const char* name); uintmax_t :ref:`test_get_value_bin_unit_param`(int argc, char** argv, const char* name); bool :ref:`tapi_test_check_expected_result`(const :ref:`tapi_test_expected_result`* expected, :ref:`te_errno` rc, const char* output); bool :ref:`tapi_test_check_expected_int_result`(const :ref:`tapi_test_expected_result`* expected, :ref:`te_errno` rc, intmax_t ival); :ref:`tapi_test_expected_result` :ref:`test_get_expected_result_param`(int argc, char** argv, const char* name); const char* :ref:`print_octet_string`(const uint8_t* oct_string, size_t len); int :ref:`test_split_param_list`(const char* list, char sep, char*** array_p); :ref:`te_errno` :ref:`tapi_asn_param_value_parse`(char* pwd, char** s, const :ref:`asn_type`* type, :ref:`asn_value`** parsed_val, int* parsed_syms, char* ns); :ref:`te_errno` :ref:`tapi_asn_params_get`(int argc, char** argv, const char* conf_prefix, const :ref:`asn_type`* conf_type, :ref:`asn_value`* conf_value); :ref:`te_errno` :ref:`tapi_test_args2kvpairs`(int argc, char* argv[], te_kvpair_h* args); void :ref:`test_octet_strings2list`(const char* str, unsigned int str_len, uint8_t*** oct_str_list, unsigned int* list_len); // macros #define :ref:`BOOL3_MAPPING_LIST` #define :ref:`BOOL_MAPPING_LIST` #define :ref:`BUF_SIZE_MAPPING_LIST` #define :ref:`ETHDEV_STATE_MAPPING_LIST` #define :ref:`FILTER_TYPE_MAPPING_LIST` #define :ref:`TEST_DEFAULT_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_DEFAULT_UINT64_PARAM`(var_name_) #define :ref:`TEST_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_ENUM_PARAM`(var_name_, maps_...) #define :ref:`TEST_EXPECTED_RESULT_PARAM`(var_name_) #define :ref:`TEST_FILENAME_PARAM`(var_name_) #define :ref:`TEST_GET_BIT_MASK_PARAM`(var_name_, maps_...) #define :ref:`TEST_GET_BOOL3_PARAM`(var_name_) #define :ref:`TEST_GET_BOOL_PARAM`(var_name_) #define :ref:`TEST_GET_BUFF_SIZE`(var_name_) #define :ref:`TEST_GET_DEFAULT_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_GET_DEFAULT_UINT64_PARAM`(var_name_) #define :ref:`TEST_GET_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_GET_ENUM_PARAM`(var_name_, maps_...) #define :ref:`TEST_GET_ETHDEV_STATE`(var_name_) #define :ref:`TEST_GET_EXPECTED_RESULT_PARAM`(var_name_) #define :ref:`TEST_GET_FILENAME_PARAM`(var_name_) #define :ref:`TEST_GET_FILTER_TYPE`(var_name_) #define :ref:`TEST_GET_INT64_PARAM`(var_name_) #define :ref:`TEST_GET_INT_LIST_PARAM`(var_name_, var_len_) #define :ref:`TEST_GET_INT_PARAM`(var_name_) #define :ref:`TEST_GET_IP4_PARAM`(var_name_) #define :ref:`TEST_GET_OCTET_STRING_LIST_PARAM`(var_name_, var_list_len_, var_str_len_) #define :ref:`TEST_GET_OCTET_STRING_PARAM`(var_name_, var_len_) #define :ref:`TEST_GET_OPT_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_GET_OPT_STRING_PARAM`(var_name_) #define :ref:`TEST_GET_OPT_UINT64_PARAM`(var_name_) #define :ref:`TEST_GET_OPT_UINT_PARAM`(var_name_) #define :ref:`TEST_GET_OPT_VALUE_BIN_UNIT_PARAM`(var_name_) #define :ref:`TEST_GET_OPT_VALUE_UNIT_PARAM`(var_name_) #define :ref:`TEST_GET_PARAMS_VECTOR`(var_name_, accessor_, ...) #define :ref:`TEST_GET_STRING_LIST_PARAM`(var_name_, var_len_) #define :ref:`TEST_GET_STRING_PARAM`(var_name_) #define :ref:`TEST_GET_TUNNEL_TYPE`(var_name_) #define :ref:`TEST_GET_UINT64_PARAM`(var_name_) #define :ref:`TEST_GET_UINT_PARAM`(_parameter) #define :ref:`TEST_GET_VALUE_BIN_UNIT_PARAM`(var_name_) #define :ref:`TEST_GET_VALUE_UNIT_PARAM`(var_name_) #define :ref:`TEST_HAS_PARAM`(var_name_) #define :ref:`TEST_INT64_PARAM`(var_name_) #define :ref:`TEST_INT_PARAM`(var_name_) #define :ref:`TEST_LIST_PARAM_SEPARATOR` #define :ref:`TEST_OPT_DOUBLE_PARAM`(var_name_) #define :ref:`TEST_OPT_STRING_PARAM`(var_name_) #define :ref:`TEST_OPT_UINT64_PARAM`(var_name_) #define :ref:`TEST_OPT_UINT_PARAM`(var_name_) #define :ref:`TEST_OPT_VALUE_BIN_UNIT_PARAM`(var_name_) #define :ref:`TEST_OPT_VALUE_UNIT_PARAM`(var_name_) #define :ref:`TEST_STRING_PARAM`(var_name_) #define :ref:`TEST_UINT64_PARAM`(var_name_) #define :ref:`TEST_UINT_PARAM`(var_name_) #define :ref:`TEST_VALUE_BIN_UNIT_PARAM`(var_name_) #define :ref:`TEST_VALUE_UNIT_PARAM`(var_name_) #define :ref:`TUNNEL_TYPE_MAPPING_LIST` .. _details-group__te__ts__tapi__test__param: 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 :ref:`test_get_param() `. It gets parameter name as an argument value and returns string value associated with that parameter. Apart from base function :ref:`test_get_param() ` there are a number of macros that process type-specific parameters: * :ref:`TEST_GET_ENUM_PARAM() `; * :ref:`TEST_GET_STRING_PARAM() `; * :ref:`TEST_GET_INT_PARAM() `; * :ref:`TEST_GET_INT64_PARAM() `; * :ref:`TEST_GET_DOUBLE_PARAM() `; * :ref:`TEST_GET_OCTET_STRING_PARAM() `; * :ref:`TEST_GET_STRING_LIST_PARAM() `; * :ref:`TEST_GET_INT_LIST_PARAM() `; * :ref:`TEST_GET_BOOL_PARAM() `; * :ref:`TEST_GET_FILENAME_PARAM() `; * :ref:`TEST_GET_BUFF_SIZE() `. For example for the following test run (from ``package.xml``): .. ref-code-block:: cpp