mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Update vendor extension in pipeline
This commit is contained in:
parent
ba86b19b5b
commit
64e898c47e
17 changed files with 206 additions and 206 deletions
|
|
@ -147,7 +147,7 @@ The JSON Plugin V2 operates by parsing the JSON file. Then it checks the parent
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
|
|
||||||
- Device.WiFi.AccessPoint.{i}.Security.X_IOPSYS_EU_KeyPassphrase: This parameter will be extended to the core data model since it does not exist.
|
- Device.WiFi.AccessPoint.{i}.Security.X_IOWRT_EU_KeyPassphrase: This parameter will be extended to the core data model since it does not exist.
|
||||||
- Device.WiFi.AccessPoint.{i}.Security.WEPKey: This parameter will be overwritten in the core data model since it already exists.
|
- Device.WiFi.AccessPoint.{i}.Security.WEPKey: This parameter will be overwritten in the core data model since it already exists.
|
||||||
- Device.WiFi.AccessPoint.{i}.Security.SAEPassphrase: This parameter will be excluded from the core data model since it exists, but the new protocol defined is `none`.
|
- Device.WiFi.AccessPoint.{i}.Security.SAEPassphrase: This parameter will be excluded from the core data model since it exists, but the new protocol defined is `none`.
|
||||||
|
|
||||||
|
|
@ -192,7 +192,7 @@ More example(s):
|
||||||
- **UCI command:** uci show wireless | grep wifi-device
|
- **UCI command:** uci show wireless | grep wifi-device
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
"Device.X_IOPSYS_EU_Radio.{i}.": {
|
"Device.X_IOWRT_EU_Radio.{i}.": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
@ -626,7 +626,7 @@ If we consider multi-instance objects, they are kind of special because we have
|
||||||
## How to have different mappings for get/set:
|
## How to have different mappings for get/set:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Device.X_IOPSYS_EU-UserInterface.": {
|
"Device.X_IOWRT_EU-UserInterface.": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
@ -707,7 +707,7 @@ These are special parameters all with a suffix "NumberOfEntries", which has coun
|
||||||
For multi-instance on ubus mapping, it has to point to an array of objects, so for NumberOfEntries, we need to get the size of that array, which is refered here as `@Count`
|
For multi-instance on ubus mapping, it has to point to an array of objects, so for NumberOfEntries, we need to get the size of that array, which is refered here as `@Count`
|
||||||
```bash
|
```bash
|
||||||
{
|
{
|
||||||
"Device.X_IOPSYS_EU_WiFi.RadioNumberOfEntries": {
|
"Device.X_IOWRT_EU_WiFi.RadioNumberOfEntries": {
|
||||||
"type": "unsignedInt",
|
"type": "unsignedInt",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
@ -734,7 +734,7 @@ For multi-instance on ubus mapping, it has to point to an array of objects, so f
|
||||||
For multi-instance object mapped on uci, it has to point a uci section, so for NumberOfEntries it basically has the count of the sections.
|
For multi-instance object mapped on uci, it has to point a uci section, so for NumberOfEntries it basically has the count of the sections.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Device.X_IOPSYS_EU_DropbearNumberOfEntries": {
|
"Device.X_IOWRT_EU_DropbearNumberOfEntries": {
|
||||||
"type": "unsignedInt",
|
"type": "unsignedInt",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
@ -765,7 +765,7 @@ Multi-instance mapping either maps to array of json objects or uci section, so f
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Device.X_IOPSYS_EU_Dropbear.{i}.": {
|
"Device.X_IOWRT_EU_Dropbear.{i}.": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
@ -847,7 +847,7 @@ Multi-instance mapping either maps to array of json objects or uci section, so f
|
||||||
Ubus example for the same
|
Ubus example for the same
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Device.X_IOPSYS_EU_WiFi.Radio.{i}.": {
|
"Device.X_IOWRT_EU_WiFi.Radio.{i}.": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"protocols": [
|
"protocols": [
|
||||||
"cwmp",
|
"cwmp",
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ function install_libbbf()
|
||||||
COV_LDFLAGS='--coverage'
|
COV_LDFLAGS='--coverage'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VENDOR_PREFIX='X_IOPSYS_EU_'
|
VENDOR_PREFIX='X_IOWRT_EU_'
|
||||||
|
|
||||||
echo "Compiling libbbf"
|
echo "Compiling libbbf"
|
||||||
if [ -d build ]; then
|
if [ -d build ]; then
|
||||||
|
|
@ -100,7 +100,7 @@ function install_wifidmd_as_micro_service()
|
||||||
|
|
||||||
exec_cmd git clone -b devel https://dev.iopsys.eu/bbf/wifidmd.git /opt/dev/wifidmd
|
exec_cmd git clone -b devel https://dev.iopsys.eu/bbf/wifidmd.git /opt/dev/wifidmd
|
||||||
|
|
||||||
exec_cmd make -C /opt/dev/wifidmd/src/ clean && make -C /opt/dev/wifidmd/src/ CFLAGS="-D'BBF_VENDOR_PREFIX=\"X_IOPSYS_EU_\"'" WIFIDMD_WIFI_DATAELEMENTS='y'
|
exec_cmd make -C /opt/dev/wifidmd/src/ clean && make -C /opt/dev/wifidmd/src/ CFLAGS="-D'BBF_VENDOR_PREFIX=\"X_IOWRT_EU_\"'" WIFIDMD_WIFI_DATAELEMENTS='y'
|
||||||
install_ms /opt/dev/wifidmd/src/libwifi.so wifidmd
|
install_ms /opt/dev/wifidmd/src/libwifi.so wifidmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@ function install_sysmngr_as_micro_service()
|
||||||
|
|
||||||
exec_cmd make -C /opt/dev/sysmngr/src/ clean && \
|
exec_cmd make -C /opt/dev/sysmngr/src/ clean && \
|
||||||
exec_cmd make -C /opt/dev/sysmngr/src/ \
|
exec_cmd make -C /opt/dev/sysmngr/src/ \
|
||||||
CFLAGS+="-DBBF_VENDOR_PREFIX=\\\"X_IOPSYS_EU_\\\"" \
|
CFLAGS+="-DBBF_VENDOR_PREFIX=\\\"X_IOWRT_EU_\\\"" \
|
||||||
SYSMNGR_VENDOR_CONFIG_FILE='y' \
|
SYSMNGR_VENDOR_CONFIG_FILE='y' \
|
||||||
SYSMNGR_MEMORY_STATUS='y' \
|
SYSMNGR_MEMORY_STATUS='y' \
|
||||||
SYSMNGR_PROCESS_STATUS='y' \
|
SYSMNGR_PROCESS_STATUS='y' \
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ DM_MAP_OBJ tDynamicObj[] = {
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* ENTRY METHOD
|
* ENTRY METHOD
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
static int browseX_IOPSYS_EU_EventTESTInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
static int browseX_IOWRT_EU_EventTESTInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||||
{
|
{
|
||||||
char *inst = NULL;
|
char *inst = NULL;
|
||||||
|
|
||||||
|
|
@ -44,13 +44,13 @@ static int browseX_IOPSYS_EU_EventTESTInst(struct dmctx *dmctx, DMNODE *parent_n
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* GET & SET PARAM
|
* GET & SET PARAM
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
static int get_X_IOPSYS_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_X_IOWRT_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
dmuci_get_option_value_string("system", "@system[0]", "log_ip", value);
|
dmuci_get_option_value_string("system", "@system[0]", "log_ip", value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_X_IOPSYS_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
static int set_X_IOWRT_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case VALUECHECK:
|
case VALUECHECK:
|
||||||
|
|
@ -62,13 +62,13 @@ static int set_X_IOPSYS_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_X_IOPSYS_EU_Syslog_ServerPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_X_IOWRT_EU_Syslog_ServerPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "log_port", "514");
|
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "log_port", "514");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_X_IOPSYS_EU_Syslog_ServerPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
static int set_X_IOWRT_EU_Syslog_ServerPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case VALUECHECK:
|
case VALUECHECK:
|
||||||
|
|
@ -80,13 +80,13 @@ static int set_X_IOPSYS_EU_Syslog_ServerPort(char *refparam, struct dmctx *ctx,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_X_IOPSYS_EU_Syslog_ConsoleLogLevel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_X_IOWRT_EU_Syslog_ConsoleLogLevel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "conloglevel", "7");
|
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "conloglevel", "7");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_X_IOPSYS_EU_Syslog_ConsoleLogLevel(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
static int set_X_IOWRT_EU_Syslog_ConsoleLogLevel(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case VALUECHECK:
|
case VALUECHECK:
|
||||||
|
|
@ -101,7 +101,7 @@ static int set_X_IOPSYS_EU_Syslog_ConsoleLogLevel(char *refparam, struct dmctx *
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* OPERATE COMMANDS
|
* OPERATE COMMANDS
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
static int operate_Device_X_IOPSYS_EU_Reboot(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
static int operate_Device_X_IOWRT_EU_Reboot(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||||
{
|
{
|
||||||
TRACE("Reboot sync operate called");
|
TRACE("Reboot sync operate called");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -221,38 +221,38 @@ static int event_XIOPSYSEUEventTEST_Test(char *refparam, struct dmctx *ctx, void
|
||||||
/* *** Device. *** */
|
/* *** Device. *** */
|
||||||
DMOBJ tDynamicDeviceObj[] = {
|
DMOBJ tDynamicDeviceObj[] = {
|
||||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||||
{"X_IOPSYS_EU_Syslog", &DMREAD, NULL, NULL, "file:/etc/config/system", NULL, NULL, NULL, NULL, tX_IOPSYS_EU_SyslogParam, NULL, BBFDM_BOTH},
|
{"X_IOWRT_EU_Syslog", &DMREAD, NULL, NULL, "file:/etc/config/system", NULL, NULL, NULL, NULL, tX_IOWRT_EU_SyslogParam, NULL, BBFDM_BOTH},
|
||||||
{"X_IOPSYS_EU_PingTEST", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tX_IOPSYS_EU_PingTESTParam, NULL, BBFDM_BOTH},
|
{"X_IOWRT_EU_PingTEST", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tX_IOWRT_EU_PingTESTParam, NULL, BBFDM_BOTH},
|
||||||
{"X_IOPSYS_EU_EventTEST", &DMREAD, NULL, NULL, NULL, browseX_IOPSYS_EU_EventTESTInst, NULL, NULL, NULL, tX_IOPSYS_EU_EventTESTParam, NULL, BBFDM_BOTH},
|
{"X_IOWRT_EU_EventTEST", &DMREAD, NULL, NULL, NULL, browseX_IOWRT_EU_EventTESTInst, NULL, NULL, NULL, tX_IOWRT_EU_EventTESTParam, NULL, BBFDM_BOTH},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
DMLEAF tDynamicDeviceParams[] = {
|
DMLEAF tDynamicDeviceParams[] = {
|
||||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||||
{"X_IOPSYS_EU_Reboot()", &DMSYNC, DMT_COMMAND, NULL, operate_Device_X_IOPSYS_EU_Reboot, BBFDM_USP},
|
{"X_IOWRT_EU_Reboot()", &DMSYNC, DMT_COMMAND, NULL, operate_Device_X_IOWRT_EU_Reboot, BBFDM_USP},
|
||||||
{"X_IOPSYS_EU_Boot!", &DMREAD, DMT_EVENT, get_event_args_XIOPSYSEU_Boot, NULL, BBFDM_USP},
|
{"X_IOWRT_EU_Boot!", &DMREAD, DMT_EVENT, get_event_args_XIOPSYSEU_Boot, NULL, BBFDM_USP},
|
||||||
{"X_IOPSYS_EU_WakeUp!", &DMREAD, DMT_EVENT, NULL, NULL, BBFDM_USP},
|
{"X_IOWRT_EU_WakeUp!", &DMREAD, DMT_EVENT, NULL, NULL, BBFDM_USP},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*** Device.X_IOPSYS_EU_Syslog. ***/
|
/*** Device.X_IOWRT_EU_Syslog. ***/
|
||||||
DMLEAF tX_IOPSYS_EU_SyslogParam[] = {
|
DMLEAF tX_IOWRT_EU_SyslogParam[] = {
|
||||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||||
{"ServerIPAddress", &DMWRITE, DMT_STRING, get_X_IOPSYS_EU_Syslog_ServerIPAddress, set_X_IOPSYS_EU_Syslog_ServerIPAddress, BBFDM_BOTH},
|
{"ServerIPAddress", &DMWRITE, DMT_STRING, get_X_IOWRT_EU_Syslog_ServerIPAddress, set_X_IOWRT_EU_Syslog_ServerIPAddress, BBFDM_BOTH},
|
||||||
{"ServerPort", &DMWRITE, DMT_UNINT, get_X_IOPSYS_EU_Syslog_ServerPort, set_X_IOPSYS_EU_Syslog_ServerPort, BBFDM_BOTH},
|
{"ServerPort", &DMWRITE, DMT_UNINT, get_X_IOWRT_EU_Syslog_ServerPort, set_X_IOWRT_EU_Syslog_ServerPort, BBFDM_BOTH},
|
||||||
{"ConsoleLogLevel", &DMWRITE, DMT_UNINT, get_X_IOPSYS_EU_Syslog_ConsoleLogLevel, set_X_IOPSYS_EU_Syslog_ConsoleLogLevel, BBFDM_BOTH},
|
{"ConsoleLogLevel", &DMWRITE, DMT_UNINT, get_X_IOWRT_EU_Syslog_ConsoleLogLevel, set_X_IOWRT_EU_Syslog_ConsoleLogLevel, BBFDM_BOTH},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*** Device.X_IOPSYS_EU_PingTEST. ***/
|
/*** Device.X_IOWRT_EU_PingTEST. ***/
|
||||||
DMLEAF tX_IOPSYS_EU_PingTESTParam[] = {
|
DMLEAF tX_IOWRT_EU_PingTESTParam[] = {
|
||||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||||
{"Run()", &DMASYNC, DMT_COMMAND, get_operate_args_XIOPSYSEUPingTEST_Run, operate_DeviceXIOPSYSEUPingTEST_Run, BBFDM_USP},
|
{"Run()", &DMASYNC, DMT_COMMAND, get_operate_args_XIOPSYSEUPingTEST_Run, operate_DeviceXIOPSYSEUPingTEST_Run, BBFDM_USP},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*** Device.X_IOPSYS_EU_EventTEST. ***/
|
/*** Device.X_IOWRT_EU_EventTEST. ***/
|
||||||
DMLEAF tX_IOPSYS_EU_EventTESTParam[] = {
|
DMLEAF tX_IOWRT_EU_EventTESTParam[] = {
|
||||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||||
{"Test!", &DMREAD, DMT_EVENT, get_event_args_XIOPSYSEUEventTEST_Test, event_XIOPSYSEUEventTEST_Test, BBFDM_USP},
|
{"Test!", &DMREAD, DMT_EVENT, get_event_args_XIOPSYSEUEventTEST_Test, event_XIOPSYSEUEventTEST_Test, BBFDM_USP},
|
||||||
{0}
|
{0}
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@
|
||||||
|
|
||||||
extern DMOBJ tDynamicDeviceObj[];
|
extern DMOBJ tDynamicDeviceObj[];
|
||||||
extern DMLEAF tDynamicDeviceParams[];
|
extern DMLEAF tDynamicDeviceParams[];
|
||||||
extern DMLEAF tX_IOPSYS_EU_SyslogParam[];
|
extern DMLEAF tX_IOWRT_EU_SyslogParam[];
|
||||||
extern DMLEAF tX_IOPSYS_EU_PingTESTParam[];
|
extern DMLEAF tX_IOWRT_EU_PingTESTParam[];
|
||||||
extern DMLEAF tX_IOPSYS_EU_EventTESTParam[];
|
extern DMLEAF tX_IOWRT_EU_EventTESTParam[];
|
||||||
|
|
||||||
#endif //__LIBBBFD_TEST_H
|
#endif //__LIBBBFD_TEST_H
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,44 +125,44 @@ static void test_api_bbfdm_get_set_json_parameter(void **state)
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_WiFi.Radio.1.Noise";
|
ctx->in_param = "Device.X_IOWRT_EU_WiFi.Radio.1.Noise";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter : name, type, value
|
// validate parameter : name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_WiFi.Radio.1.Noise", "-87", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_WiFi.Radio.1.Noise", "-87", "xsd:int");
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_WiFi.Radio.2.Noise";
|
ctx->in_param = "Device.X_IOWRT_EU_WiFi.Radio.2.Noise";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter : name, type, value
|
// validate parameter : name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_WiFi.Radio.2.Noise", "-85", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_WiFi.Radio.2.Noise", "-85", "xsd:int");
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_WiFi.Radio.2.Band";
|
ctx->in_param = "Device.X_IOWRT_EU_WiFi.Radio.2.Band";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter : name, type, value
|
// validate parameter : name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_WiFi.Radio.2.Band", "2.4GHz", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_WiFi.Radio.2.Band", "2.4GHz", "xsd:string");
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_WiFi.Radio.1.Stats.BytesSent";
|
ctx->in_param = "Device.X_IOWRT_EU_WiFi.Radio.1.Stats.BytesSent";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter : name, type, value
|
// validate parameter : name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_WiFi.Radio.1.Stats.BytesSent", "14418177", "xsd:unsignedInt");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_WiFi.Radio.1.Stats.BytesSent", "14418177", "xsd:unsignedInt");
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_WiFi.Radio.2.Stats.BytesSent";
|
ctx->in_param = "Device.X_IOWRT_EU_WiFi.Radio.2.Stats.BytesSent";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter : name, type, value
|
// validate parameter : name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_WiFi.Radio.2.Stats.BytesSent", "14417451", "xsd:unsignedInt");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_WiFi.Radio.2.Stats.BytesSent", "14417451", "xsd:unsignedInt");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_api_bbfdm_get_set_json_v1_parameter(void **state)
|
static void test_api_bbfdm_get_set_json_v1_parameter(void **state)
|
||||||
|
|
@ -428,592 +428,592 @@ static void test_api_bbfdm_input_value_validation_json_parameter(void **state)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Enable";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Enable";
|
||||||
ctx->in_value = "64t";
|
ctx->in_value = "64t";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Enable";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Enable";
|
||||||
ctx->in_value = "truee";
|
ctx->in_value = "truee";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Enable";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Enable";
|
||||||
ctx->in_value = "true";
|
ctx->in_value = "true";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Enable";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Enable";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Enable", "1", "xsd:boolean");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Enable", "1", "xsd:boolean");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate unsignedInt parameters
|
* Validate unsignedInt parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_Retries";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_Retries";
|
||||||
ctx->in_value = "64t";
|
ctx->in_value = "64t";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_Retries";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_Retries";
|
||||||
ctx->in_value = "15600";
|
ctx->in_value = "15600";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_Retries";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_Retries";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Nbr_Retries", "15600", "xsd:unsignedInt");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Nbr_Retries", "15600", "xsd:unsignedInt");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Port";
|
||||||
ctx->in_value = "1050";
|
ctx->in_value = "1050";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [0-1000] ==> expected "0" error
|
// Mapping with range: set value in the first range [0-1000] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Port";
|
||||||
ctx->in_value = "1000";
|
ctx->in_value = "1000";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Port";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Port", "1000", "xsd:unsignedInt");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Port", "1000", "xsd:unsignedInt");
|
||||||
|
|
||||||
// Mapping with range: set value in the second range [15000-65535] ==> expected "0" error
|
// Mapping with range: set value in the second range [15000-65535] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Port";
|
||||||
ctx->in_value = "20546";
|
ctx->in_value = "20546";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Port";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Port", "20546", "xsd:unsignedInt");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Port", "20546", "xsd:unsignedInt");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate int parameters
|
* Validate int parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Mapping with range (only min): Set Wrong Value ==> expected "9007" error
|
// Mapping with range (only min): Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Min_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Min_value";
|
||||||
ctx->in_value = "-300";
|
ctx->in_value = "-300";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Min_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Min_value";
|
||||||
ctx->in_value = "-273";
|
ctx->in_value = "-273";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Min_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Min_value";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Min_value", "-273", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Min_value", "-273", "xsd:int");
|
||||||
|
|
||||||
// Mapping with range (only max): Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range (only max): Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Max_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Max_value";
|
||||||
ctx->in_value = "280";
|
ctx->in_value = "280";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [0-1000] ==> expected "0" error
|
// Mapping with range: set value in the first range [0-1000] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Max_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Max_value";
|
||||||
ctx->in_value = "274";
|
ctx->in_value = "274";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Max_value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Max_value";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Max_value", "274", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Max_value", "274", "xsd:int");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Value";
|
||||||
ctx->in_value = "-3";
|
ctx->in_value = "-3";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [-10:-5] ==> expected "0" error
|
// Mapping with range: set value in the first range [-10:-5] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Value";
|
||||||
ctx->in_value = "-7";
|
ctx->in_value = "-7";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Value";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Value", "-7", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Value", "-7", "xsd:int");
|
||||||
|
|
||||||
// Mapping with range: set value in the second range [-1:10] ==> expected "0" error
|
// Mapping with range: set value in the second range [-1:10] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Value";
|
||||||
ctx->in_value = "1";
|
ctx->in_value = "1";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Value";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Value";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Value", "1", "xsd:int");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Value", "1", "xsd:int");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate unsignedLong parameters
|
* Validate unsignedLong parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_bytes";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_bytes";
|
||||||
ctx->in_value = "64t";
|
ctx->in_value = "64t";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_bytes";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_bytes";
|
||||||
ctx->in_value = "15600";
|
ctx->in_value = "15600";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_bytes";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_bytes";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Nbr_bytes", "15600", "xsd:unsignedLong");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Nbr_bytes", "15600", "xsd:unsignedLong");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_packets";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_packets";
|
||||||
ctx->in_value = "499";
|
ctx->in_value = "499";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [0-100] ==> expected "0" error
|
// Mapping with range: set value in the first range [0-100] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_packets";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_packets";
|
||||||
ctx->in_value = "99";
|
ctx->in_value = "99";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_packets";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_packets";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Nbr_packets", "99", "xsd:unsignedLong");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Nbr_packets", "99", "xsd:unsignedLong");
|
||||||
|
|
||||||
// Mapping with range: set value in the second range [500-3010] ==> expected "0" error
|
// Mapping with range: set value in the second range [500-3010] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_packets";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_packets";
|
||||||
ctx->in_value = "1024";
|
ctx->in_value = "1024";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Nbr_packets";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Nbr_packets";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Nbr_packets", "1024", "xsd:unsignedLong");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Nbr_packets", "1024", "xsd:unsignedLong");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate long parameters
|
* Validate long parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.MaxTxPower";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.MaxTxPower";
|
||||||
ctx->in_value = "-300t";
|
ctx->in_value = "-300t";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.MaxTxPower";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.MaxTxPower";
|
||||||
ctx->in_value = "-273";
|
ctx->in_value = "-273";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.MaxTxPower";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.MaxTxPower";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.MaxTxPower", "-273", "xsd:long");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.MaxTxPower", "-273", "xsd:long");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
ctx->in_value = "-91";
|
ctx->in_value = "-91";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [-90:36] ==> expected "0" error
|
// Mapping with range: set value in the first range [-90:36] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
ctx->in_value = "274";
|
ctx->in_value = "274";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit", "274", "xsd:long");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit", "274", "xsd:long");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
ctx->in_value = "37";
|
ctx->in_value = "37";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [70:360] ==> expected "0" error
|
// Mapping with range: set value in the first range [70:360] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
ctx->in_value = "70";
|
ctx->in_value = "70";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.TransmitPowerLimit", "70", "xsd:long");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.TransmitPowerLimit", "70", "xsd:long");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate dateTime parameters
|
* Validate dateTime parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.AssociationTime";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.AssociationTime";
|
||||||
ctx->in_value = "2030-01-01T11:22:33.2Z";
|
ctx->in_value = "2030-01-01T11:22:33.2Z";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.AssociationTime";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.AssociationTime";
|
||||||
ctx->in_value = "2022-01-01T12:20:22.2222Z";
|
ctx->in_value = "2022-01-01T12:20:22.2222Z";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.AssociationTime";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.AssociationTime";
|
||||||
ctx->in_value = "2022-01-01T12:20:22Z";
|
ctx->in_value = "2022-01-01T12:20:22Z";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.AssociationTime";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.AssociationTime";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.AssociationTime", "2022-01-01T12:20:22Z", "xsd:dateTime");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.AssociationTime", "2022-01-01T12:20:22Z", "xsd:dateTime");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate hexBinary parameters
|
* Validate hexBinary parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.ButtonColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.ButtonColor";
|
||||||
ctx->in_value = "64t";
|
ctx->in_value = "64t";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.ButtonColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.ButtonColor";
|
||||||
ctx->in_value = "64ab78cef12";
|
ctx->in_value = "64ab78cef12";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.ButtonColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.ButtonColor";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.ButtonColor", "64ab78cef12", "xsd:hexBinary");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.ButtonColor", "64ab78cef12", "xsd:hexBinary");
|
||||||
|
|
||||||
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
// Mapping with range: Set Wrong Value out of range ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TextColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TextColor";
|
||||||
ctx->in_value = "am123";
|
ctx->in_value = "am123";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Mapping with range: set value in the first range [3-3] ==> expected "0" error
|
// Mapping with range: set value in the first range [3-3] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TextColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TextColor";
|
||||||
ctx->in_value = "123abc";
|
ctx->in_value = "123abc";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TextColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TextColor";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.TextColor", "123abc", "xsd:hexBinary");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.TextColor", "123abc", "xsd:hexBinary");
|
||||||
|
|
||||||
// Mapping with range: set value in the second range [5-5] ==> expected "0" error
|
// Mapping with range: set value in the second range [5-5] ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TextColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TextColor";
|
||||||
ctx->in_value = "12345abcde";
|
ctx->in_value = "12345abcde";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TextColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TextColor";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.TextColor", "12345abcde", "xsd:hexBinary");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.TextColor", "12345abcde", "xsd:hexBinary");
|
||||||
|
|
||||||
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
// Mapping without range: Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.BackgroundColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.BackgroundColor";
|
||||||
ctx->in_value = "12345abce";
|
ctx->in_value = "12345abce";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.BackgroundColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.BackgroundColor";
|
||||||
ctx->in_value = "45a1bd";
|
ctx->in_value = "45a1bd";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.BackgroundColor";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.BackgroundColor";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.BackgroundColor", "45a1bd", "xsd:hexBinary");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.BackgroundColor", "45a1bd", "xsd:hexBinary");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate string parameters
|
* Validate string parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Interface";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Interface";
|
||||||
ctx->in_value = "64";
|
ctx->in_value = "64";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Interface";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Interface";
|
||||||
ctx->in_value = "wan";
|
ctx->in_value = "wan";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Interface";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Interface";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Interface", "wan", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Interface", "wan", "xsd:string");
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.IPAddr";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.IPAddr";
|
||||||
ctx->in_value = "192.168.1.789";
|
ctx->in_value = "192.168.1.789";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set value ==> expected "0" error
|
// Set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.IPAddr";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.IPAddr";
|
||||||
ctx->in_value = "192.168.117.45";
|
ctx->in_value = "192.168.117.45";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.IPAddr";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.IPAddr";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.IPAddr", "192.168.117.45", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.IPAddr", "192.168.117.45", "xsd:string");
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Protocol";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Protocol";
|
||||||
ctx->in_value = "OMA-D";
|
ctx->in_value = "OMA-D";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Protocol";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Protocol";
|
||||||
ctx->in_value = "OMA-DM";
|
ctx->in_value = "OMA-DM";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Protocol";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Protocol";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Protocol", "OMA-DM", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Protocol", "OMA-DM", "xsd:string");
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Description";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Description";
|
||||||
ctx->in_value = "bbf validate test";
|
ctx->in_value = "bbf validate test";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Description";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Description";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.Description", "bbf validate test", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.Description", "bbf validate test", "xsd:string");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate list string parameters
|
* Validate list string parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.FailureReasons";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.FailureReasons";
|
||||||
ctx->in_value = "te,be,re,yu";
|
ctx->in_value = "te,be,re,yu";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.FailureReasons";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.FailureReasons";
|
||||||
ctx->in_value = "ExcessiveDelay,InsufficientBuffers";
|
ctx->in_value = "ExcessiveDelay,InsufficientBuffers";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.FailureReasons";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.FailureReasons";
|
||||||
ctx->in_value = "LowRate,Other";
|
ctx->in_value = "LowRate,Other";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.FailureReasons";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.FailureReasons";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.FailureReasons", "LowRate,Other", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.FailureReasons", "LowRate,Other", "xsd:string");
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
||||||
ctx->in_value = "200MHz,10MHz";
|
ctx->in_value = "200MHz,10MHz";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
||||||
ctx->in_value = "ExcessiveDelay,InsufficientBuffers";
|
ctx->in_value = "ExcessiveDelay,InsufficientBuffers";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
||||||
ctx->in_value = "40MHz,80+80MHz";
|
ctx->in_value = "40MHz,80+80MHz";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.SupportedOperatingChannelBandwidths";
|
||||||
ctx->in_value = "";
|
ctx->in_value = "";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
ctx->in_param = "";
|
ctx->in_param = "";
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.SupportedOperatingChannelBandwidths", "40MHz,80+80MHz", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.SupportedOperatingChannelBandwidths", "40MHz,80+80MHz", "xsd:string");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate list int parameters
|
* Validate list int parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerSupported";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerSupported";
|
||||||
ctx->in_value = "-5,-3,99,120";
|
ctx->in_value = "-5,-3,99,120";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerSupported";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerSupported";
|
||||||
ctx->in_value = "-1,9,990";
|
ctx->in_value = "-1,9,990";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerSupported";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerSupported";
|
||||||
ctx->in_value = "-1,9,100";
|
ctx->in_value = "-1,9,100";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.TransmitPowerSupported";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.TransmitPowerSupported";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.TransmitPowerSupported", "-1,9,100", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.TransmitPowerSupported", "-1,9,100", "xsd:string");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate list unsignedInt parameters
|
* Validate list unsignedInt parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.PriorityRegeneration";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.PriorityRegeneration";
|
||||||
ctx->in_value = "8,1,2,3";
|
ctx->in_value = "8,1,2,3";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// Set Wrong Value ==> expected "9007" error
|
// Set Wrong Value ==> expected "9007" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.PriorityRegeneration";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.PriorityRegeneration";
|
||||||
ctx->in_value = "1,2,3,4,5,6,7,8";
|
ctx->in_value = "1,2,3,4,5,6,7,8";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, FAULT_9007);
|
assert_int_equal(fault, FAULT_9007);
|
||||||
|
|
||||||
// set value ==> expected "0" error
|
// set value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.PriorityRegeneration";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.PriorityRegeneration";
|
||||||
ctx->in_value = "0,1,2,3,4,5,6,7";
|
ctx->in_value = "0,1,2,3,4,5,6,7";
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// get value ==> expected "0" error
|
// get value ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.PriorityRegeneration";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.PriorityRegeneration";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// validate parameter after setting to true: name, type, value
|
// validate parameter after setting to true: name, type, value
|
||||||
validate_parameter(ctx, "Device.X_IOPSYS_EU_TEST.1.PriorityRegeneration", "0,1,2,3,4,5,6,7", "xsd:string");
|
validate_parameter(ctx, "Device.X_IOWRT_EU_TEST.1.PriorityRegeneration", "0,1,2,3,4,5,6,7", "xsd:string");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_api_bbfdm_add_del_standard_object(void **state)
|
static void test_api_bbfdm_add_del_standard_object(void **state)
|
||||||
|
|
@ -1059,13 +1059,13 @@ static void test_api_bbfdm_add_del_json_object(void **state)
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
// Get name object ==> expected "0" error
|
// Get name object ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
ctx->nextlevel = true;
|
ctx->nextlevel = true;
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// add object ==> expected "0" error
|
// add object ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
|
|
@ -1074,18 +1074,18 @@ static void test_api_bbfdm_add_del_json_object(void **state)
|
||||||
assert_string_equal(ctx->addobj_instance, "2");
|
assert_string_equal(ctx->addobj_instance, "2");
|
||||||
|
|
||||||
// delete object ==> expected "0" error
|
// delete object ==> expected "0" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.2.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.2.";
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
// Get name object after deleting instance 2 ==> expected "9005" error
|
// Get name object after deleting instance 2 ==> expected "9005" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.2.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.2.";
|
||||||
ctx->nextlevel = true;
|
ctx->nextlevel = true;
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
||||||
// delete all object ==> expected "9005" error
|
// delete all object ==> expected "9005" error
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
}
|
}
|
||||||
|
|
@ -1341,7 +1341,7 @@ static void test_api_bbfdm_valid_library_operate(void **state)
|
||||||
size_t rem = 0;
|
size_t rem = 0;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_PingTEST.Run()";
|
ctx->in_param = "Device.X_IOWRT_EU_PingTEST.Run()";
|
||||||
ctx->in_value = "{\"Host\":\"iopsys.eu\"}";
|
ctx->in_value = "{\"Host\":\"iopsys.eu\"}";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
||||||
|
|
@ -1399,14 +1399,14 @@ static void test_api_bbfdm_valid_library_list_operate(void **state)
|
||||||
struct blob_attr *command_in = tb[3];
|
struct blob_attr *command_in = tb[3];
|
||||||
struct blob_attr *command_out = tb[4];
|
struct blob_attr *command_out = tb[4];
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_Reboot()") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_Reboot()") == 0) {
|
||||||
assert_string_equal(type, "xsd:command");
|
assert_string_equal(type, "xsd:command");
|
||||||
assert_string_equal(data, "sync");
|
assert_string_equal(data, "sync");
|
||||||
assert_null(command_in);
|
assert_null(command_in);
|
||||||
assert_null(command_out);
|
assert_null(command_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_PingTEST.Run()") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_PingTEST.Run()") == 0) {
|
||||||
assert_string_equal(type, "xsd:command");
|
assert_string_equal(type, "xsd:command");
|
||||||
assert_string_equal(data, "async");
|
assert_string_equal(data, "async");
|
||||||
assert_non_null(command_in);
|
assert_non_null(command_in);
|
||||||
|
|
@ -1460,7 +1460,7 @@ static void test_api_bbfdm_valid_json_operate(void **state)
|
||||||
size_t rem = 0;
|
size_t rem = 0;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.1.Status()";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.1.Status()";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -1520,7 +1520,7 @@ static void test_api_bbfdm_valid_json_list_operate(void **state)
|
||||||
struct blob_attr *command_in = tb[3];
|
struct blob_attr *command_in = tb[3];
|
||||||
struct blob_attr *command_out = tb[4];
|
struct blob_attr *command_out = tb[4];
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_TEST.{i}.Status()") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_TEST.{i}.Status()") == 0) {
|
||||||
assert_string_equal(type, "xsd:command");
|
assert_string_equal(type, "xsd:command");
|
||||||
assert_string_equal(data, "async");
|
assert_string_equal(data, "async");
|
||||||
assert_non_null(command_in);
|
assert_non_null(command_in);
|
||||||
|
|
@ -1708,12 +1708,12 @@ static void test_api_bbfdm_valid_library_event(void **state)
|
||||||
char *type = blobmsg_get_string(tb[2]);
|
char *type = blobmsg_get_string(tb[2]);
|
||||||
struct blob_attr *event_in = tb[3];
|
struct blob_attr *event_in = tb[3];
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_WakeUp!") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_WakeUp!") == 0) {
|
||||||
assert_string_equal(type, "xsd:event");
|
assert_string_equal(type, "xsd:event");
|
||||||
assert_null(data);
|
assert_null(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_Boot!") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_Boot!") == 0) {
|
||||||
assert_string_equal(type, "xsd:event");
|
assert_string_equal(type, "xsd:event");
|
||||||
assert_non_null(event_in);
|
assert_non_null(event_in);
|
||||||
|
|
||||||
|
|
@ -1781,12 +1781,12 @@ static void test_api_bbfdm_valid_json_event(void **state)
|
||||||
char *type = blobmsg_get_string(tb[2]);
|
char *type = blobmsg_get_string(tb[2]);
|
||||||
struct blob_attr *event_in = tb[3];
|
struct blob_attr *event_in = tb[3];
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_TEST.{i}.Periodic!") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_TEST.{i}.Periodic!") == 0) {
|
||||||
assert_string_equal(type, "xsd:event");
|
assert_string_equal(type, "xsd:event");
|
||||||
assert_null(data);
|
assert_null(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DM_STRCMP(name, "Device.X_IOPSYS_EU_TEST.{i}.Push!") == 0) {
|
if (DM_STRCMP(name, "Device.X_IOWRT_EU_TEST.{i}.Push!") == 0) {
|
||||||
assert_string_equal(type, "xsd:event");
|
assert_string_equal(type, "xsd:event");
|
||||||
assert_non_null(event_in);
|
assert_non_null(event_in);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ static void test_api_bbfdm_get_value_parameter(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.Alias";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.Alias";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -148,7 +148,7 @@ static void test_api_bbfdm_get_name_parameter(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.Verbose";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.Verbose";
|
||||||
ctx->nextlevel = false;
|
ctx->nextlevel = false;
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
fault = bbf_entry_method(ctx, BBF_GET_NAME);
|
||||||
|
|
@ -190,7 +190,7 @@ static void test_api_bbfdm_set_value_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
ctx->in_value = "test";
|
ctx->in_value = "test";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
|
|
@ -202,7 +202,7 @@ static void test_api_bbfdm_set_value_parameter(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.BannerFile";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.BannerFile";
|
||||||
ctx->in_value = "test";
|
ctx->in_value = "test";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
|
|
@ -226,7 +226,7 @@ static void test_api_bbfdm_set_value_wrong_parameter_path(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.Port";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.Port";
|
||||||
ctx->in_value = "test";
|
ctx->in_value = "test";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
|
|
@ -250,7 +250,7 @@ static void test_api_bbfdm_set_value_parameter_wrong_value(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.RootLogin";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.RootLogin";
|
||||||
ctx->in_value = "truee";
|
ctx->in_value = "truee";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_SET_VALUE);
|
||||||
|
|
@ -262,7 +262,7 @@ static void test_api_bbfdm_add_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -276,7 +276,7 @@ static void test_api_bbfdm_add_wrong_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.Users.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.Users.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
@ -315,7 +315,7 @@ static void test_api_bbfdm_delete_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -326,7 +326,7 @@ static void test_api_bbfdm_delete_object_all_instances(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
@ -337,7 +337,7 @@ static void test_api_bbfdm_delete_wrong_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
@ -371,7 +371,7 @@ static void test_api_bbfdm_valid_operate(void **state)
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->dm_type = BBFDM_USP;
|
ctx->dm_type = BBFDM_USP;
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Reboot()";
|
ctx->in_param = "Device.X_IOWRT_EU_Reboot()";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
fault = bbf_entry_method(ctx, BBF_OPERATE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -476,7 +476,7 @@ static void test_api_bbfdm_get_instances_without_next_level(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
ctx->nextlevel = false;
|
ctx->nextlevel = false;
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_INSTANCES);
|
fault = bbf_entry_method(ctx, BBF_INSTANCES);
|
||||||
|
|
@ -493,7 +493,7 @@ static void test_api_bbfdm_json_get_value(void **state)
|
||||||
/*
|
/*
|
||||||
* Test of JSON Object Path
|
* Test of JSON Object Path
|
||||||
*/
|
*/
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
|
|
@ -505,7 +505,7 @@ static void test_api_bbfdm_json_get_value(void **state)
|
||||||
/*
|
/*
|
||||||
* Test of JSON Parameter Path
|
* Test of JSON Parameter Path
|
||||||
*/
|
*/
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.Alias";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.Alias";
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
|
|
@ -517,7 +517,7 @@ static void test_api_bbfdm_json_add_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -531,12 +531,12 @@ static void test_api_bbfdm_json_delete_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.1.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.1.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_Dropbear.";
|
ctx->in_param = "Device.X_IOWRT_EU_Dropbear.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
@ -547,7 +547,7 @@ static void test_api_bbfdm_library_get_value(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
fault = bbf_entry_method(ctx, BBF_GET_VALUE);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -570,7 +570,7 @@ static void test_api_bbfdm_library_add_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_ADD_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
@ -584,12 +584,12 @@ static void test_api_bbfdm_library_delete_object(void **state)
|
||||||
struct dmctx *ctx = (struct dmctx *) *state;
|
struct dmctx *ctx = (struct dmctx *) *state;
|
||||||
int fault = 0;
|
int fault = 0;
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.2.";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.2.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, 0);
|
assert_int_equal(fault, 0);
|
||||||
|
|
||||||
ctx->in_param = "Device.X_IOPSYS_EU_TEST.";
|
ctx->in_param = "Device.X_IOWRT_EU_TEST.";
|
||||||
|
|
||||||
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
fault = bbf_entry_method(ctx, BBF_DEL_OBJECT);
|
||||||
assert_int_equal(fault, FAULT_9005);
|
assert_int_equal(fault, FAULT_9005);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
DMOBJ tTEST_DeviceObj[] = {
|
DMOBJ tTEST_DeviceObj[] = {
|
||||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||||
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, BBFDM_NONE},
|
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, BBFDM_NONE},
|
||||||
{"X_IOPSYS_EU_Dropbear", &DMWRITE, add_dropbear_instance, delete_dropbear_instance, "file:/etc/config/dropbear", browse_dropbear_instance, NULL, NULL, NULL, X_TEST_COM_DropbearParams, NULL, BBFDM_BOTH},
|
{"X_IOWRT_EU_Dropbear", &DMWRITE, add_dropbear_instance, delete_dropbear_instance, "file:/etc/config/dropbear", browse_dropbear_instance, NULL, NULL, NULL, X_TEST_COM_DropbearParams, NULL, BBFDM_BOTH},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ DMLEAF tTEST_EthernetRMONStatsParams[] = {
|
||||||
|
|
||||||
DM_MAP_OBJ tDynamicObj[] = {
|
DM_MAP_OBJ tDynamicObj[] = {
|
||||||
/* parentobj, nextobject, parameter */
|
/* parentobj, nextobject, parameter */
|
||||||
{"Device.", tTEST_DeviceObj, NULL}, // Overwrite 'X_IOPSYS_EU_Dropbear' && Exclude 'USB'
|
{"Device.", tTEST_DeviceObj, NULL}, // Overwrite 'X_IOWRT_EU_Dropbear' && Exclude 'USB'
|
||||||
{"Device.Firewall.Chain.{i}.Rule.{i}.", tTEST_FirewallChainRuleObj, tTEST_FirewallChainRuleParams}, // Extend 'X_TEST_COM_TimeSpan', etc.. && Overwrite 'ExpiryDate'
|
{"Device.Firewall.Chain.{i}.Rule.{i}.", tTEST_FirewallChainRuleObj, tTEST_FirewallChainRuleParams}, // Extend 'X_TEST_COM_TimeSpan', etc.. && Overwrite 'ExpiryDate'
|
||||||
{"Device.DeviceInfo.", tTEST_DeviceInfoObj, tTEST_DeviceInfoParams}, // Overwrite 'Manufacturer' && Exclude 'VendorConfigFile' from the tree
|
{"Device.DeviceInfo.", tTEST_DeviceInfoObj, tTEST_DeviceInfoParams}, // Overwrite 'Manufacturer' && Exclude 'VendorConfigFile' from the tree
|
||||||
{"Device.DSL.Channel.{i}.", tTEST_DSLChannelObj, NULL}, // Exclude 'Stats' from the tree
|
{"Device.DSL.Channel.{i}.", tTEST_DSLChannelObj, NULL}, // Exclude 'Stats' from the tree
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ Examples:
|
||||||
This tool helps in validating the json schema, which is very helpful in the development of a JSON based plugins.
|
This tool helps in validating the json schema, which is very helpful in the development of a JSON based plugins.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./tools/validate_json_plugin.py test/files/etc/bbfdm/json/X_IOPSYS_EU_TEST.json
|
$ ./tools/validate_json_plugin.py test/files/etc/bbfdm/json/TEST.json
|
||||||
$ ./tools/validate_json_plugin.py tools/datamodel.json
|
$ ./tools/validate_json_plugin.py tools/datamodel.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ The parameters/keys used in tools_input.json file are mostly self-explanatory bu
|
||||||
| model_name | The model name, e.g., "DG400PRIME-A" |
|
| model_name | The model name, e.g., "DG400PRIME-A" |
|
||||||
| software_version | The software version, e.g., "1.2.3.4" |
|
| software_version | The software version, e.g., "1.2.3.4" |
|
||||||
| dm_json_files | This should contain the list of json file path, where each file contains the definition of DM objects/parameters |
|
| dm_json_files | This should contain the list of json file path, where each file contains the definition of DM objects/parameters |
|
||||||
| vendor_prefix | The prefix used by vendor for vendor extension in DM objects/parameters, e.g., "X_IOPSYS_EU_" |
|
| vendor_prefix | The prefix used by vendor for vendor extension in DM objects/parameters, e.g., "X_IOWRT_EU_" |
|
||||||
| plugins | A list of plugins with associated repositories and data model files |
|
| plugins | A list of plugins with associated repositories and data model files |
|
||||||
| | repo: The path of the plugin repository. Could be 'URL' or 'folder_path' |
|
| | repo: The path of the plugin repository. Could be 'URL' or 'folder_path' |
|
||||||
| | proto: The protocol of the plugin repository. Could be 'git' or 'local' |
|
| | proto: The protocol of the plugin repository. Could be 'git' or 'local' |
|
||||||
|
|
@ -168,7 +168,7 @@ The input json file should be defined as follow:
|
||||||
"dm_json_files": [
|
"dm_json_files": [
|
||||||
"tools/datamodel.json"
|
"tools/datamodel.json"
|
||||||
]
|
]
|
||||||
"vendor_prefix": "X_IOPSYS_EU_",
|
"vendor_prefix": "X_IOWRT_EU_",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"repo": "https://dev.iopsys.eu/bbf/mydatamodel.git",
|
"repo": "https://dev.iopsys.eu/bbf/mydatamodel.git",
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ def generate_shared_library(dm_name, source_files, vendor_prefix,
|
||||||
if vendor_prefix is not None:
|
if vendor_prefix is not None:
|
||||||
VENDOR_PREFIX = vendor_prefix
|
VENDOR_PREFIX = vendor_prefix
|
||||||
else:
|
else:
|
||||||
VENDOR_PREFIX = "X_IOPSYS_EU_"
|
VENDOR_PREFIX = "X_IOWRT_EU_"
|
||||||
|
|
||||||
# Ensure that the source files exist
|
# Ensure that the source files exist
|
||||||
for source_file in source_files:
|
for source_file in source_files:
|
||||||
|
|
@ -191,7 +191,7 @@ def build_and_install_bbfdm(vendor_prefix):
|
||||||
if vendor_prefix is not None:
|
if vendor_prefix is not None:
|
||||||
VENDOR_PREFIX = vendor_prefix
|
VENDOR_PREFIX = vendor_prefix
|
||||||
else:
|
else:
|
||||||
VENDOR_PREFIX = "X_IOPSYS_EU_"
|
VENDOR_PREFIX = "X_IOWRT_EU_"
|
||||||
|
|
||||||
# Build and install bbfdm
|
# Build and install bbfdm
|
||||||
cmake_command = [
|
cmake_command = [
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,8 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-p', '--vendor-prefix',
|
'-p', '--vendor-prefix',
|
||||||
default = 'X_IOPSYS_EU_',
|
default = 'X_IOWRT_EU_',
|
||||||
metavar = 'X_IOPSYS_EU_',
|
metavar = 'X_IOWRT_EU_',
|
||||||
help = 'Generate data model tree using provided vendor prefix for vendor defined objects'
|
help = 'Generate data model tree using provided vendor prefix for vendor defined objects'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,8 @@ def get_info_from_json(data, dm_json_files=None):
|
||||||
if i != (len(list_data) - 1) and list_data[i + 1] == list_data[i] + "{i}.":
|
if i != (len(list_data) - 1) and list_data[i + 1] == list_data[i] + "{i}.":
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
if str(list_data[i]).find("X_IOPSYS_EU_") != -1:
|
if str(list_data[i]).find("X_IOWRT_EU_") != -1:
|
||||||
param = str(list_data[i]).replace("X_IOPSYS_EU_", "{BBF_VENDOR_PREFIX}")
|
param = str(list_data[i]).replace("X_IOWRT_EU_", "{BBF_VENDOR_PREFIX}")
|
||||||
else:
|
else:
|
||||||
param = str(list_data[i])
|
param = str(list_data[i])
|
||||||
|
|
||||||
|
|
@ -392,8 +392,8 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-p', '--vendor-prefix',
|
'-p', '--vendor-prefix',
|
||||||
default = 'X_IOPSYS_EU_',
|
default = 'X_IOWRT_EU_',
|
||||||
metavar = 'X_IOPSYS_EU_',
|
metavar = 'X_IOWRT_EU_',
|
||||||
help = 'Generate data model tree using provided vendor prefix for vendor defined objects.'
|
help = 'Generate data model tree using provided vendor prefix for vendor defined objects.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
"-DSYSMNGR_NETWORK_PROPERTIES",
|
"-DSYSMNGR_NETWORK_PROPERTIES",
|
||||||
"-DSYSMNGR_VENDOR_EXTENSIONS",
|
"-DSYSMNGR_VENDOR_EXTENSIONS",
|
||||||
"-DSYSMNGR_TEMPERATURE_STATUS",
|
"-DSYSMNGR_TEMPERATURE_STATUS",
|
||||||
"-DCUSTOM_PREFIX=\\\"X_IOPSYS_EU_\\\""
|
"-DCUSTOM_PREFIX=\\\"X_IOWRT_EU_\\\""
|
||||||
],
|
],
|
||||||
"dm_files": [
|
"dm_files": [
|
||||||
"src/deviceinfo.c",
|
"src/deviceinfo.c",
|
||||||
|
|
@ -170,7 +170,7 @@
|
||||||
"version": "devel",
|
"version": "devel",
|
||||||
"extra_dependencies": [
|
"extra_dependencies": [
|
||||||
"-DHAS_VENDOR_EXT",
|
"-DHAS_VENDOR_EXT",
|
||||||
"-DCUSTOM_PREFIX=\\\"X_IOPSYS_EU_\\\""
|
"-DCUSTOM_PREFIX=\\\"X_IOWRT_EU_\\\""
|
||||||
],
|
],
|
||||||
"dm_files": [
|
"dm_files": [
|
||||||
"src/bbf_plugin/hosts_ext.c"
|
"src/bbf_plugin/hosts_ext.c"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue