CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
test_dynamic.c File Reference

This file contains the definitions that dynamically test CDI functionality. This may include features such as enabling/disabling connections, reconfigurating statistics gathering, changing payload configurations, exercising corner cases and injecting error conditions. More...

#include "test_dynamic.h"
#include "cdi_logger_api.h"
#include "cdi_test.h"

Data Structures

struct  StatsData
 Structure used to hold state data for the dynamic statistics reconfiguration test used by TestDynamicStatsReconfigure(). More...
 
struct  EndpointData
 Structure used to hold state data for the dynamic statistics reconfiguration test used by TestDynamicStatsReconfigure(). More...
 
struct  TestDynamicState
 Structure used to hold state data for dynamic tests. More...
 

Macros

#define STATS_RECONFIGURE_INTERVAL_FACTOR   (4)
 For statistics configuration changes, this is the number of configured interval periods that must expire before applying a configuration change.
 
#define STATS_PERIOD_MULT_FACTOR   (2)
 For statistics configuration changes, this is how much to increase the configured interval period when performing the change interval test.
 
#define ENDPOINT_ENABLED_TIME_MS   (5000)
 For endpoint configuration changes, this is the number of milliseconds that the endpoint will be enabled.
 
#define ENDPOINT_DISABLED_TIME_MS   (1000)
 For endpoint configuration changes, this is the number of milliseconds that the endpoint will be disabled.
 

Enumerations

enum  TestStatsState { kStatsModeChangeInterval , kStatsModeDisable , kStatsModeSetOriginalSettings , kStateModeLast }
 Enums used to indicate configuration change states. More...
 
enum  TestEndpointState { kEndpointEnabled , kEndpointDisabled , kEndpointLast }
 Enums used to indicate configuration change states. More...
 

Functions

static bool StatisticsReconfigure (TestDynamicHandle handle)
 
bool TestDynamicCreate (TestConnectionInfo *connection_info_ptr, TestDynamicHandle *return_handle_ptr)
 
void TestDynamicDestroy (TestDynamicHandle handle)
 
bool TestDynamicPollStatsReconfigure (TestDynamicHandle handle)
 
bool TestDynamicEndpoints (TestDynamicHandle handle)
 
bool TestDynamicIsEndpointEnabled (TestDynamicHandle handle, int stream_index)
 

Detailed Description

This file contains the definitions that dynamically test CDI functionality. This may include features such as enabling/disabling connections, reconfigurating statistics gathering, changing payload configurations, exercising corner cases and injecting error conditions.

Enumeration Type Documentation

◆ TestEndpointState

Enums used to indicate configuration change states.

Enumerator
kEndpointEnabled 

Endpoint is enabled.

kEndpointDisabled 

Endpoint is disabled.

kEndpointLast 

Used for range checking. Do not remove.

◆ TestStatsState

Enums used to indicate configuration change states.

Enumerator
kStatsModeChangeInterval 

Change interval period (see STATS_INTERVAL_MULT_FACTOR)

kStatsModeDisable 

Disable stats gathering.

kStatsModeSetOriginalSettings 

Set original settings.

kStateModeLast 

Used for range checking. Do not remove.

Function Documentation

◆ StatisticsReconfigure()

static bool StatisticsReconfigure ( TestDynamicHandle handle)
static

Apply statistics reconfiguration, based on current test state.

Parameters
handleHandle of the test dynamic component.
Returns
true if successful, otherwise false is returned.

◆ TestDynamicCreate()

bool TestDynamicCreate ( TestConnectionInfo * connection_info_ptr,
TestDynamicHandle * return_handle_ptr )

Create an instance of the test dynamic component for the specified connection.

Parameters
connection_info_ptrPointer to connection state data.
return_handle_ptrAddress where to write returned handle.
Returns
true if successful, otherwise false is returned.

◆ TestDynamicDestroy()

void TestDynamicDestroy ( TestDynamicHandle handle)

Free all resources related to the specified test dynamic component.

Parameters
handleHandle of the test dynamic component.

◆ TestDynamicEndpoints()

bool TestDynamicEndpoints ( TestDynamicHandle handle)

Dynamically test endpoint creation/destruction by using the SDK CdiAvmTxStreamEndpointCreate() and CdiAvmStreamEndpointDestroy() APIs.

Parameters
handleHandle of the test dynamic component.
Returns
true if successful, otherwise false is returned.

◆ TestDynamicIsEndpointEnabled()

bool TestDynamicIsEndpointEnabled ( TestDynamicHandle handle,
int stream_index )

Determine if dynamic endpoint is enabled or not.

Parameters
handleHandle of the test dynamic component.
stream_indexZero-based index of the stream to check.
Returns
true If enabled is enabled, otherwise false is returned.

◆ TestDynamicPollStatsReconfigure()

bool TestDynamicPollStatsReconfigure ( TestDynamicHandle handle)

Dynamically test statistics configuration changes by using the SDK CdiCoreStatsReconfigure() API function.

Parameters
handleHandle of the test dynamic component.
Returns
true if successful, otherwise false is returned.