mirror of
https://github.com/emqx/neuron.git
synced 2026-10-29 23:19:18 +08:00
Compare commits
30
Commits
2.12.1
...
2.7.0-alpha2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffdf1c747d | ||
|
|
c81dbbad20 | ||
|
|
1366631690 | ||
|
|
8fd4ce669b | ||
|
|
ed6233cf77 | ||
|
|
53174ac6b2 | ||
|
|
21ff7aea65 | ||
|
|
58cc696e5e | ||
|
|
76ea51be2b | ||
|
|
b91b2ef55d | ||
|
|
8fc783e679 | ||
|
|
36e66e1521 | ||
|
|
2ad3c5e87c | ||
|
|
d51ef29568 | ||
|
|
b3d88977bf | ||
|
|
330a58f825 | ||
|
|
c779d86da2 | ||
|
|
0b3075e94d | ||
|
|
33d317551c | ||
|
|
1f019eb02b | ||
|
|
2e407c3e6e | ||
|
|
a4fb604db7 | ||
|
|
090650c5c4 | ||
|
|
d6c0c04feb | ||
|
|
bf548c974f | ||
|
|
54aa2a15b3 | ||
|
|
e3040ea184 | ||
|
|
9d02f1faec | ||
|
|
34f64c832f | ||
|
|
93b488a02c |
@@ -41,7 +41,7 @@ jobs:
|
||||
|
||||
ut:
|
||||
runs-on: ubuntu-20.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.7
|
||||
|
||||
|
||||
steps:
|
||||
@@ -74,17 +74,9 @@ jobs:
|
||||
build/result/index.html
|
||||
build/neuron.log
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
gcov: true
|
||||
fail_ci_if_error: true
|
||||
gcov_include: include plugins src
|
||||
gcov_ignore: tests simulator
|
||||
|
||||
ft:
|
||||
runs-on: ubuntu-20.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.7
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -115,16 +107,9 @@ jobs:
|
||||
ft/reports/report.html
|
||||
build/neuron.log
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
gcov: true
|
||||
gcov_include: include plugins src
|
||||
gcov_ignore: tests simulator
|
||||
|
||||
pft:
|
||||
runs-on: ubuntu-20.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.7
|
||||
strategy:
|
||||
matrix:
|
||||
plugin: [core, modbus, mqtt, metrics]
|
||||
@@ -163,17 +148,3 @@ jobs:
|
||||
else
|
||||
pytest -s -v tests/ft/metrics/"test_metrics.py"
|
||||
fi
|
||||
|
||||
- name: create cov report
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install lcov
|
||||
mkdir -p cov_report
|
||||
./create_cov_report.sh ${{ matrix.plugin }}
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
verbose: true
|
||||
directory: ./cov_report/
|
||||
files: cov-${{ matrix.plugin }}.info
|
||||
|
||||
@@ -9,8 +9,8 @@ on:
|
||||
|
||||
env:
|
||||
VERSION: 2.7.0
|
||||
UI_VERSION: 2.6.1
|
||||
BRANCH: main
|
||||
UI_VERSION: 2.6.3
|
||||
BRANCH: v2.7
|
||||
|
||||
jobs:
|
||||
cross-build:
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- [aarch64-linux-gnu, aarch64, arm64]
|
||||
- [arm-linux-gnueabihf, armv4, armhf]
|
||||
- [x86_64-linux-gnu, x86_64, amd64]
|
||||
container: ghcr.io/neugates/build:${{ matrix.arch[1] }}-main
|
||||
container: ghcr.io/neugates/build:${{ matrix.arch[1] }}-v2.7
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
matrix:
|
||||
arch:
|
||||
- [x86_64-linux-gnu, x86_64, amd64]
|
||||
container: ghcr.io/neugates/build:${{ matrix.arch[1] }}-main
|
||||
container: ghcr.io/neugates/build:${{ matrix.arch[1] }}-v2.7
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(COMPILER_PREFIX aarch64-linux-gnu)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
set(LIBRARY_DIR /home/neuron/main/libs)
|
||||
set(LIBRARY_DIR /home/neuron/v2.7/libs)
|
||||
|
||||
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(COMPILER_PREFIX arm-linux-gnueabi)
|
||||
set(CMAKE_SYSTEM_PROCESSOR armv5tejl)
|
||||
set(LIBRARY_DIR /home/neuron/main/libs)
|
||||
set(LIBRARY_DIR /home/neuron/v2.7/libs)
|
||||
|
||||
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(COMPILER_PREFIX arm-linux-gnueabihf)
|
||||
set(CMAKE_SYSTEM_PROCESSOR armv7l)
|
||||
set(LIBRARY_DIR /home/neuron/main/libs)
|
||||
set(LIBRARY_DIR /home/neuron/v2.7/libs)
|
||||
|
||||
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(COMPILER_PREFIX x86_64-linux-gnu)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
set(LIBRARY_DIR /home/neuron/main/libs)
|
||||
set(LIBRARY_DIR /home/neuron/v2.7/libs)
|
||||
|
||||
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ Add different types of tags to the group, it should return success
|
||||
Add a list of tags with errors, it should return the number of successful additions.
|
||||
${res}= Add Tags modbus-node group ${tag1},${tag2},${tag3},${tag4}
|
||||
|
||||
Check Response Status ${res} 200
|
||||
Check Response Status ${res} 409
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_NAME_CONFLICT}
|
||||
Should Be Equal As Integers ${res}[index] 0
|
||||
|
||||
@@ -139,7 +139,7 @@ Delete tag from non-existent group, it should return success
|
||||
Update non-existent tag, it should return failure.
|
||||
${res}= Update Tags modbus-node group ${tag4}
|
||||
|
||||
Check Response Status ${res} 200
|
||||
Check Response Status ${res} 404
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_NOT_EXIST}
|
||||
|
||||
${res}= Get Tags modbus-node group
|
||||
|
||||
+4
-4
@@ -96,7 +96,7 @@ Create a template with invalid tag type, it should fail.
|
||||
${groups} = Create List ${group}
|
||||
|
||||
${res} = Add Template ${g_template} ${g_plugin} ${groups}
|
||||
Check Response Status ${res} 206
|
||||
Check Response Status ${res} 400
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_TYPE_NOT_SUPPORT}
|
||||
|
||||
[Teardown] Del Template ${g_template}
|
||||
@@ -108,7 +108,7 @@ Create a template with invalid tag address, it should fail.
|
||||
${groups} = Create List ${group}
|
||||
|
||||
${res} = Add Template ${g_template} ${g_plugin} ${groups}
|
||||
Check Response Status ${res} 206
|
||||
Check Response Status ${res} 400
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_ADDRESS_FORMAT_INVALID}
|
||||
|
||||
[Teardown] Del Template ${g_template}
|
||||
@@ -802,7 +802,7 @@ Add tag with too long name to existing template group, it should fail.
|
||||
|
||||
&{tag} = New Tag From ${g_tag1} name=${g_long_str}
|
||||
${res} = Add Template Tags ${g_template} ${g_group1}[name] ${tag}
|
||||
Check Response Status ${res} 206
|
||||
Check Response Status ${res} 400
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_NAME_TOO_LONG}
|
||||
|
||||
[Teardown] Del Template ${g_template}
|
||||
@@ -1026,7 +1026,7 @@ Update tag name to invalid value, it should fail.
|
||||
|
||||
&{tag} = New Tag From ${g_tag1} name=${g_long_str}
|
||||
${res} = Put Template Tags ${g_template} ${g_group1}[name] ${tag}
|
||||
Check Response Status ${res} 206
|
||||
Check Response Status ${res} 400
|
||||
Check Error Code ${res} ${NEU_ERR_TAG_NAME_TOO_LONG}
|
||||
|
||||
[Teardown] Del Template ${g_template}
|
||||
|
||||
@@ -98,6 +98,7 @@ typedef enum {
|
||||
NEU_ERR_LIBRARY_MODULE_VERSION_NOT_MATCH = 2314,
|
||||
NEU_ERR_LIBRARY_NAME_NOT_CONFORM = 2315,
|
||||
NEU_ERR_LIBRARY_CLIB_NOT_MATCH = 2316,
|
||||
NEU_ERR_LIBRARY_UPDATE_FAIL = 2317,
|
||||
|
||||
NEU_ERR_LICENSE_NOT_FOUND = 2400,
|
||||
NEU_ERR_LICENSE_INVALID = 2401,
|
||||
|
||||
@@ -92,7 +92,8 @@ void handle_add_tags_resp(nng_aio *aio, neu_resp_add_tag_t *resp)
|
||||
|
||||
neu_json_encode_by_fn(&res, neu_json_encode_au_tags_resp, &result);
|
||||
|
||||
neu_http_ok(aio, result);
|
||||
NEU_JSON_RESPONSE_ERROR(resp->error,
|
||||
{ neu_http_response(aio, resp->error, result); });
|
||||
free(result);
|
||||
}
|
||||
|
||||
@@ -183,8 +184,8 @@ void handle_add_gtags_resp(nng_aio *aio, neu_resp_add_tag_t *resp)
|
||||
res.index = resp->index;
|
||||
|
||||
neu_json_encode_by_fn(&res, neu_json_encode_au_gtags_resp, &result);
|
||||
|
||||
neu_http_ok(aio, result);
|
||||
NEU_JSON_RESPONSE_ERROR(resp->error,
|
||||
{ neu_http_response(aio, resp->error, result); });
|
||||
free(result);
|
||||
}
|
||||
|
||||
|
||||
+103
-54
@@ -58,6 +58,13 @@ static int adapter_update_metric(neu_adapter_t *adapter,
|
||||
inline static void reply(neu_adapter_t *adapter, neu_reqresp_head_t *header,
|
||||
void *data);
|
||||
|
||||
int validate_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp);
|
||||
int try_add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp);
|
||||
int add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp);
|
||||
|
||||
static const adapter_callbacks_t callback_funs = {
|
||||
.command = adapter_command,
|
||||
.response = adapter_response,
|
||||
@@ -1033,65 +1040,21 @@ static int adapter_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
case NEU_REQ_ADD_GTAG: {
|
||||
neu_req_add_gtag_t *cmd = (neu_req_add_gtag_t *) &header[1];
|
||||
neu_resp_add_tag_t resp = { 0 };
|
||||
if (adapter->module->type == NEU_NA_TYPE_DRIVER) {
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
for (int j = 0; j < cmd->groups[i].n_tag; j++) {
|
||||
int ret = neu_adapter_driver_validate_tag(
|
||||
(neu_adapter_driver_t *) adapter, cmd->groups[i].group,
|
||||
&cmd->groups[i].tags[j]);
|
||||
if (ret == 0) {
|
||||
resp.index += 1;
|
||||
} else {
|
||||
resp.error = ret;
|
||||
resp.index = 0;
|
||||
i = cmd->n_group;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if (adapter->module->type != NEU_NA_TYPE_DRIVER) {
|
||||
resp.error = NEU_ERR_GROUP_NOT_ALLOW;
|
||||
}
|
||||
if (resp.index > 0) {
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
int ret = neu_adapter_driver_try_add_tag(
|
||||
(neu_adapter_driver_t *) adapter, cmd->groups[i].group,
|
||||
cmd->groups[i].tags, cmd->groups[i].n_tag);
|
||||
if (ret != 0) {
|
||||
resp.index = 0;
|
||||
resp.error = ret;
|
||||
break;
|
||||
} else {
|
||||
if (validate_gtags(adapter, cmd, &resp) == 0 &&
|
||||
try_add_gtags(adapter, cmd, &resp) == 0 &&
|
||||
add_gtags(adapter, cmd, &resp) == 0) {
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
adapter_storage_add_tags(cmd->driver, cmd->groups[i].group,
|
||||
cmd->groups[i].tags,
|
||||
cmd->groups[i].n_tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resp.index > 0) {
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
for (int j = 0; j < cmd->groups[i].n_tag; j++) {
|
||||
int ret = neu_adapter_driver_add_tag(
|
||||
(neu_adapter_driver_t *) adapter, cmd->groups[i].group,
|
||||
&cmd->groups[i].tags[j], cmd->groups[i].interval);
|
||||
if (ret != 0) {
|
||||
neu_adapter_driver_try_del_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[i].n_tag - j);
|
||||
resp.index = 0;
|
||||
i = cmd->n_group;
|
||||
resp.error = ret;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resp.index) {
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
adapter_storage_add_tags(cmd->driver, cmd->groups[i].group,
|
||||
cmd->groups[i].tags,
|
||||
cmd->groups[i].n_tag);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < cmd->n_group; i++) {
|
||||
for (int j = 0; j < cmd->groups[i].n_tag; j++) {
|
||||
neu_tag_fini(&cmd->groups[i].tags[j]);
|
||||
@@ -1258,6 +1221,92 @@ static int adapter_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int validate_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp)
|
||||
{
|
||||
for (int group_index = 0; group_index < cmd->n_group; group_index++) {
|
||||
for (int tag_index = 0; tag_index < cmd->groups[group_index].n_tag;
|
||||
tag_index++) {
|
||||
int validation_result = neu_adapter_driver_validate_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[group_index].group,
|
||||
&cmd->groups[group_index].tags[tag_index]);
|
||||
if (validation_result == 0) {
|
||||
resp->index += 1;
|
||||
} else {
|
||||
resp->error = validation_result;
|
||||
resp->index = 0;
|
||||
return validation_result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int try_add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp)
|
||||
{
|
||||
for (int group_index = 0; group_index < cmd->n_group; group_index++) {
|
||||
int add_result = neu_adapter_driver_try_add_tag(
|
||||
(neu_adapter_driver_t *) adapter, cmd->groups[group_index].group,
|
||||
cmd->groups[group_index].tags, cmd->groups[group_index].n_tag);
|
||||
if (add_result != 0) {
|
||||
for (int added_groups_count = 0; added_groups_count < group_index;
|
||||
added_groups_count++) {
|
||||
neu_adapter_driver_try_del_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[added_groups_count].n_tag);
|
||||
}
|
||||
resp->index = 0;
|
||||
resp->error = add_result;
|
||||
return add_result;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
|
||||
neu_resp_add_tag_t *resp)
|
||||
{
|
||||
for (int group_index = 0; group_index < cmd->n_group; group_index++) {
|
||||
for (int tag_index = 0; tag_index < cmd->groups[group_index].n_tag;
|
||||
tag_index++) {
|
||||
int add_tag_result = neu_adapter_driver_add_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[group_index].group,
|
||||
&cmd->groups[group_index].tags[tag_index],
|
||||
cmd->groups[group_index].interval);
|
||||
|
||||
if (add_tag_result != 0) {
|
||||
for (int added_group_index = 0; added_group_index < group_index;
|
||||
added_group_index++) {
|
||||
for (int added_tag_index = 0; added_tag_index <=
|
||||
cmd->groups[added_group_index].n_tag;
|
||||
added_tag_index++) {
|
||||
neu_adapter_driver_del_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[added_group_index].group,
|
||||
cmd->groups[added_group_index]
|
||||
.tags[added_tag_index]
|
||||
.name);
|
||||
}
|
||||
}
|
||||
for (int added_tag_index = 0; added_tag_index < tag_index;
|
||||
added_tag_index++) {
|
||||
neu_adapter_driver_del_tag(
|
||||
(neu_adapter_driver_t *) adapter,
|
||||
cmd->groups[group_index].group,
|
||||
cmd->groups[group_index].tags[added_tag_index].name);
|
||||
}
|
||||
resp->index = 0;
|
||||
resp->error = add_tag_result;
|
||||
return add_tag_result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void neu_adapter_destroy(neu_adapter_t *adapter)
|
||||
{
|
||||
nlog_notice("adapter %s destroy", adapter->name);
|
||||
|
||||
@@ -574,20 +574,62 @@ static void cal_decimal(neu_type_e tag_type, neu_type_e value_type,
|
||||
{
|
||||
switch (tag_type) {
|
||||
case NEU_TYPE_INT8:
|
||||
case NEU_TYPE_UINT8:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->i8 = (int8_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->i8 = (int8_t) round(value->i64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_INT16:
|
||||
case NEU_TYPE_UINT16:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->i16 = (int16_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->i16 = (int16_t) round(value->i64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_INT32:
|
||||
case NEU_TYPE_UINT32:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->i32 = (int32_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->i32 = (int32_t) round(value->i64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_INT64:
|
||||
case NEU_TYPE_UINT64:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->i64 = (int64_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->i64 = (int64_t) round(value->i64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_UINT8:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->u8 = (uint8_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->u8 = (uint8_t) round(value->u64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_UINT16:
|
||||
case NEU_TYPE_WORD:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->u16 = (uint16_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->u16 = (uint16_t) round(value->u64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_UINT32:
|
||||
case NEU_TYPE_LWORD:
|
||||
if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->u32 = (uint32_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->u32 = (uint32_t) round(value->u64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_UINT64:
|
||||
case NEU_TYPE_DWORD:
|
||||
if (value_type == NEU_TYPE_INT64 || value_type == NEU_TYPE_LWORD) {
|
||||
value->u64 = value->u64 / decimal;
|
||||
} else if (value_type == NEU_TYPE_DOUBLE) {
|
||||
value->u64 = (uint64_t) round(value->d64 / decimal);
|
||||
value->d64 = (uint64_t) round(value->d64 / decimal);
|
||||
} else {
|
||||
value->u64 = (uint64_t) round(value->u64 / decimal);
|
||||
}
|
||||
break;
|
||||
case NEU_TYPE_FLOAT:
|
||||
|
||||
@@ -1274,30 +1274,29 @@ int neu_conn_stream_consume(neu_conn_t *conn, void *context,
|
||||
ssize_t ret = neu_conn_recv(conn, conn->buf + conn->offset,
|
||||
conn->buf_size - conn->offset);
|
||||
if (ret > 0) {
|
||||
pthread_mutex_lock(&conn->mtx);
|
||||
zlog_recv_protocol(conn->param.log, conn->buf + conn->offset, ret);
|
||||
conn->offset += ret;
|
||||
neu_protocol_unpack_buf_t protocol_buf = { 0 };
|
||||
neu_protocol_unpack_buf_init(&protocol_buf, conn->buf, conn->offset);
|
||||
int used = 0;
|
||||
while (neu_protocol_unpack_buf_unused_size(&protocol_buf) > 0) {
|
||||
used = fn(context, &protocol_buf);
|
||||
int used = fn(context, &protocol_buf);
|
||||
|
||||
zlog_debug(conn->param.log, "buf used: %d offset: %d", used,
|
||||
conn->offset);
|
||||
if (used == 0 || used == -1) {
|
||||
if (used == 0) {
|
||||
break;
|
||||
} else if (used == -1) {
|
||||
neu_conn_disconnect(conn);
|
||||
break;
|
||||
} else {
|
||||
pthread_mutex_lock(&conn->mtx);
|
||||
conn->offset -= used;
|
||||
memmove(conn->buf, conn->buf + used, conn->offset);
|
||||
neu_protocol_unpack_buf_init(&protocol_buf, conn->buf,
|
||||
conn->offset);
|
||||
pthread_mutex_unlock(&conn->mtx);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&conn->mtx);
|
||||
if (used == -1) {
|
||||
neu_conn_disconnect(conn);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+17
-3
@@ -615,7 +615,7 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
free(so_tmp_path);
|
||||
free(schema_tmp_path);
|
||||
header->type = NEU_RESP_ERROR;
|
||||
e.error = NEU_ERR_LIBRARY_ADD_FAIL;
|
||||
e.error = NEU_ERR_LIBRARY_UPDATE_FAIL;
|
||||
strcpy(header->receiver, header->sender);
|
||||
reply(manager, header, &e);
|
||||
break;
|
||||
@@ -628,7 +628,7 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
free(so_tmp_path);
|
||||
free(schema_tmp_path);
|
||||
header->type = NEU_RESP_ERROR;
|
||||
e.error = NEU_ERR_LIBRARY_ADD_FAIL;
|
||||
e.error = NEU_ERR_LIBRARY_UPDATE_FAIL;
|
||||
strcpy(header->receiver, header->sender);
|
||||
reply(manager, header, &e);
|
||||
break;
|
||||
@@ -641,7 +641,21 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
free(so_tmp_path);
|
||||
free(schema_tmp_path);
|
||||
header->type = NEU_RESP_ERROR;
|
||||
e.error = NEU_ERR_LIBRARY_ADD_FAIL;
|
||||
e.error = NEU_ERR_LIBRARY_UPDATE_FAIL;
|
||||
strcpy(header->receiver, header->sender);
|
||||
reply(manager, header, &e);
|
||||
break;
|
||||
}
|
||||
|
||||
if (neu_plugin_manager_update(manager->plugin_manager, cmd->library) !=
|
||||
NEU_ERR_SUCCESS) {
|
||||
nlog_warn("update library %s fail", cmd->library);
|
||||
free(cmd->so_file);
|
||||
free(cmd->schema_file);
|
||||
free(so_tmp_path);
|
||||
free(schema_tmp_path);
|
||||
header->type = NEU_RESP_ERROR;
|
||||
e.error = NEU_ERR_LIBRARY_UPDATE_FAIL;
|
||||
strcpy(header->receiver, header->sender);
|
||||
reply(manager, header, &e);
|
||||
break;
|
||||
|
||||
@@ -98,7 +98,7 @@ int neu_plugin_manager_add(neu_plugin_manager_t *mgr,
|
||||
snprintf(lib_path, sizeof(lib_path) - 1, "%s/%s", lib_paths[i],
|
||||
plugin_lib_name);
|
||||
|
||||
handle = dlopen(lib_path, RTLD_NOW | RTLD_NODELETE);
|
||||
handle = dlopen(lib_path, RTLD_NOW);
|
||||
|
||||
if (handle == NULL) {
|
||||
nlog_warn("failed to open library %s, error: %s", lib_path,
|
||||
@@ -173,6 +173,78 @@ int neu_plugin_manager_add(neu_plugin_manager_t *mgr,
|
||||
return NEU_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int neu_plugin_manager_update(neu_plugin_manager_t *mgr,
|
||||
const char * plugin_lib_name)
|
||||
{
|
||||
char lib_path[256] = { 0 };
|
||||
void * handle = NULL;
|
||||
void * module = NULL;
|
||||
neu_plugin_module_t *pm = NULL;
|
||||
plugin_entity_t * plugin = NULL;
|
||||
char lib_paths[3][64] = { 0 };
|
||||
snprintf(lib_paths[0], sizeof(lib_paths[0]), "%s", g_plugin_dir);
|
||||
snprintf(lib_paths[1], sizeof(lib_paths[1]), "%s/system", g_plugin_dir);
|
||||
snprintf(lib_paths[2], sizeof(lib_paths[2]), "%s/custom", g_plugin_dir);
|
||||
|
||||
assert(strlen(plugin_lib_name) <= NEU_PLUGIN_LIBRARY_LEN);
|
||||
|
||||
for (size_t i = 0; i < sizeof(lib_paths) / sizeof(lib_paths[0]); i++) {
|
||||
|
||||
snprintf(lib_path, sizeof(lib_path) - 1, "%s/%s", lib_paths[i],
|
||||
plugin_lib_name);
|
||||
|
||||
handle = dlopen(lib_path, RTLD_NOW);
|
||||
|
||||
if (handle == NULL) {
|
||||
nlog_warn("failed to open library %s, error: %s", lib_path,
|
||||
dlerror());
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (handle == NULL) {
|
||||
return NEU_ERR_LIBRARY_FAILED_TO_OPEN;
|
||||
}
|
||||
|
||||
module = dlsym(handle, "neu_plugin_module");
|
||||
if (module == NULL) {
|
||||
dlclose(handle);
|
||||
nlog_warn("failed to find neu_plugin_module symbol in %s", lib_path);
|
||||
return NEU_ERR_LIBRARY_MODULE_INVALID;
|
||||
}
|
||||
|
||||
pm = (neu_plugin_module_t *) module;
|
||||
|
||||
HASH_FIND_STR(mgr->plugins, pm->module_name, plugin);
|
||||
if (plugin == NULL) {
|
||||
dlclose(handle);
|
||||
return NEU_ERR_LIBRARY_MODULE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
plugin->version = pm->version;
|
||||
plugin->display = pm->display;
|
||||
plugin->type = pm->type;
|
||||
plugin->kind = pm->kind;
|
||||
free(plugin->schema);
|
||||
free(plugin->description);
|
||||
free(plugin->description_zh);
|
||||
plugin->schema = strdup(pm->schema);
|
||||
plugin->description = strdup(pm->module_descr);
|
||||
plugin->description_zh = strdup(pm->module_descr_zh);
|
||||
plugin->single = pm->single;
|
||||
if (plugin->single) {
|
||||
free(plugin->single_name);
|
||||
plugin->single_name = strdup(pm->single_name);
|
||||
}
|
||||
|
||||
nlog_notice("update plugin, name: %s, library: %s, kind: %d, type: %d",
|
||||
plugin->name, plugin->lib_name, plugin->kind, plugin->type);
|
||||
|
||||
dlclose(handle);
|
||||
return NEU_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int neu_plugin_manager_del(neu_plugin_manager_t *mgr, const char *plugin_name)
|
||||
{
|
||||
plugin_entity_t *plugin = NULL;
|
||||
@@ -322,7 +394,7 @@ int neu_plugin_manager_create_instance(neu_plugin_manager_t * mgr,
|
||||
|
||||
snprintf(lib_path, sizeof(lib_path) - 1, "%s/%s", lib_paths[i],
|
||||
plugin->lib_name);
|
||||
instance->handle = dlopen(lib_path, RTLD_NOW | RTLD_NODELETE);
|
||||
instance->handle = dlopen(lib_path, RTLD_NOW);
|
||||
|
||||
if (instance->handle == NULL) {
|
||||
continue;
|
||||
@@ -387,7 +459,7 @@ bool neu_plugin_manager_create_instance_by_path(neu_plugin_manager_t *mgr,
|
||||
|
||||
(void) mgr;
|
||||
|
||||
instance->handle = dlopen(plugin_path, RTLD_NOW | RTLD_NODELETE);
|
||||
instance->handle = dlopen(plugin_path, RTLD_NOW);
|
||||
|
||||
if (instance->handle == NULL) {
|
||||
const char *dl_err = dlerror();
|
||||
|
||||
@@ -71,4 +71,7 @@ bool neu_plugin_manager_create_instance_by_path(neu_plugin_manager_t *mgr,
|
||||
bool neu_plugin_manager_remove_library(neu_plugin_manager_t *mgr,
|
||||
const char * library);
|
||||
|
||||
int neu_plugin_manager_update(neu_plugin_manager_t *mgr,
|
||||
const char * plugin_lib_name);
|
||||
|
||||
#endif
|
||||
+16
-6
@@ -182,8 +182,12 @@ neu_events_t *neu_event_new(void)
|
||||
neu_events_t *events = calloc(1, sizeof(struct neu_events));
|
||||
|
||||
events->epoll_fd = epoll_create(1);
|
||||
events->stop = false;
|
||||
events->n_event = 0;
|
||||
|
||||
nlog_notice("create epoll: %d(%d)", events->epoll_fd, errno);
|
||||
assert(events->epoll_fd > 0);
|
||||
|
||||
events->stop = false;
|
||||
events->n_event = 0;
|
||||
pthread_mutex_init(&events->mtx, NULL);
|
||||
|
||||
pthread_create(&events->thread, NULL, event_loop, events);
|
||||
@@ -273,8 +277,13 @@ int neu_event_del_timer(neu_events_t *events, neu_event_timer_t *timer)
|
||||
|
||||
neu_event_io_t *neu_event_add_io(neu_events_t *events, neu_event_io_param_t io)
|
||||
{
|
||||
int ret = 0;
|
||||
int index = get_free_event(events);
|
||||
int ret = 0;
|
||||
int index = get_free_event(events);
|
||||
|
||||
nlog_notice("add io, fd: %d, epoll: %d, index: %d", io.fd, events->epoll_fd,
|
||||
index);
|
||||
assert(index >= 0);
|
||||
|
||||
neu_event_io_t *io_ctx = &events->event_datas[index].ctx.io;
|
||||
io_ctx->event_data = &events->event_datas[index];
|
||||
struct epoll_event event = {
|
||||
@@ -292,8 +301,9 @@ neu_event_io_t *neu_event_add_io(neu_events_t *events, neu_event_io_param_t io)
|
||||
|
||||
ret = epoll_ctl(events->epoll_fd, EPOLL_CTL_ADD, io.fd, &event);
|
||||
|
||||
nlog_notice("add io, fd: %d, epoll: %d, ret: %d", io.fd, events->epoll_fd,
|
||||
ret);
|
||||
nlog_notice("add io, fd: %d, epoll: %d, ret: %d(%d)", io.fd,
|
||||
events->epoll_fd, ret, errno);
|
||||
assert(ret == 0);
|
||||
|
||||
return io_ctx;
|
||||
}
|
||||
|
||||
+2
-1
@@ -125,9 +125,10 @@ static int neuron_run(const neu_cli_args_t *args)
|
||||
int rv = 0;
|
||||
|
||||
signal(SIGINT, sig_handler);
|
||||
signal(SIGTERM, sig_handler);
|
||||
signal(SIGABRT, sig_handler);
|
||||
signal(SIGSEGV, sig_handler);
|
||||
signal(SIGTERM, sig_handler);
|
||||
signal(SIGKILL, sig_handler);
|
||||
|
||||
// try to enable core dump
|
||||
rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
|
||||
|
||||
+8
-9
@@ -341,12 +341,20 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content)
|
||||
case NEU_ERR_PLUGIN_NAME_TOO_LONG:
|
||||
case NEU_ERR_PLUGIN_NOT_SUPPORT_TEMPLATE:
|
||||
case NEU_ERR_LIBRARY_ADD_FAIL:
|
||||
case NEU_ERR_LIBRARY_UPDATE_FAIL:
|
||||
case NEU_ERR_LIBRARY_MODULE_NOT_EXISTS:
|
||||
case NEU_ERR_LIBRARY_MODULE_KIND_NOT_SUPPORT:
|
||||
case NEU_ERR_LIBRARY_MODULE_VERSION_NOT_MATCH:
|
||||
case NEU_ERR_LIBRARY_NAME_NOT_CONFORM:
|
||||
case NEU_ERR_LIBRARY_CLIB_NOT_MATCH:
|
||||
case NEU_ERR_LIBRARY_ARCH_NOT_SUPPORT:
|
||||
case NEU_ERR_TAG_ATTRIBUTE_NOT_SUPPORT:
|
||||
case NEU_ERR_TAG_TYPE_NOT_SUPPORT:
|
||||
case NEU_ERR_TAG_ADDRESS_FORMAT_INVALID:
|
||||
case NEU_ERR_TAG_DESCRIPTION_TOO_LONG:
|
||||
case NEU_ERR_TAG_PRECISION_INVALID:
|
||||
case NEU_ERR_TAG_NAME_TOO_LONG:
|
||||
case NEU_ERR_TAG_ADDRESS_TOO_LONG:
|
||||
status = NNG_HTTP_STATUS_BAD_REQUEST;
|
||||
break;
|
||||
case NEU_ERR_FILE_NOT_EXIST:
|
||||
@@ -382,15 +390,6 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content)
|
||||
case NEU_ERR_LIBRARY_SYSTEM_NOT_ALLOW_DEL:
|
||||
status = NNG_HTTP_STATUS_CONFLICT;
|
||||
break;
|
||||
case NEU_ERR_TAG_ATTRIBUTE_NOT_SUPPORT:
|
||||
case NEU_ERR_TAG_TYPE_NOT_SUPPORT:
|
||||
case NEU_ERR_TAG_ADDRESS_FORMAT_INVALID:
|
||||
case NEU_ERR_TAG_DESCRIPTION_TOO_LONG:
|
||||
case NEU_ERR_TAG_PRECISION_INVALID:
|
||||
case NEU_ERR_TAG_NAME_TOO_LONG:
|
||||
case NEU_ERR_TAG_ADDRESS_TOO_LONG:
|
||||
status = NNG_HTTP_STATUS_PARTIAL_CONTENT;
|
||||
break;
|
||||
default:
|
||||
if (code >= NEU_ERR_PLUGIN_ERROR_START &&
|
||||
code <= NEU_ERR_PLUGIN_ERROR_END) {
|
||||
|
||||
@@ -116,6 +116,8 @@ hold_string_s = [{"name": "hold_string_s", "address": "1!400870.2",
|
||||
|
||||
hold_int16_decimal = [{"name": "hold_int16_decimal", "address": "1!40103",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_INT16, "decimal": 0.1}]
|
||||
hold_int16_decimal_neg = [{"name": "int16_decimal_neg", "address": "1!40140",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_INT16, "decimal": -1}]
|
||||
hold_uint16_decimal = [{"name": "hold_uint16_decimal", "address": "1!400105",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_UINT16, "decimal": 0.2}]
|
||||
hold_int32_decimal = [{"name": "hold_int32_decimal", "address": "1!400199",
|
||||
@@ -124,6 +126,8 @@ hold_uint32_decimal = [{"name": "hold_uint32_decimal", "address": "1!400115",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_UINT32, "decimal": 0.3}]
|
||||
hold_float_decimal = [{"name": "hold_float_decimal", "address": "1!400119",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_FLOAT, "decimal": 0.5}]
|
||||
hold_float_decimal_neg = [{"name": "float_decimal_neg", "address": "1!400150",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_FLOAT, "decimal": -1}]
|
||||
hold_double_decimal = [{"name": "hold_double_decimal", "address": "1!4000127",
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_DOUBLE, "decimal": 0.6}]
|
||||
|
||||
@@ -378,27 +382,27 @@ class TestModbus:
|
||||
"attribute": config.NEU_TAG_ATTRIBUTE_RW, "type": config.NEU_TYPE_BYTES}]
|
||||
|
||||
response = api.add_tags(node=param[0], group='group', tags=wrong_tag1)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_ATTRIBUTE_NOT_SUPPORT == response.json()[
|
||||
'error']
|
||||
|
||||
response = api.add_tags(node=param[0], group='group', tags=wrong_tag2)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_TYPE_NOT_SUPPORT == response.json()[
|
||||
'error']
|
||||
|
||||
response = api.add_tags(node=param[0], group='group', tags=wrong_tag3)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_ADDRESS_FORMAT_INVALID == response.json()[
|
||||
'error']
|
||||
|
||||
response = api.add_tags(node=param[0], group='group', tags=wrong_tag4)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_ADDRESS_FORMAT_INVALID == response.json()[
|
||||
'error']
|
||||
|
||||
response = api.add_tags(node=param[0], group='group', tags=wrong_tag5)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_ADDRESS_FORMAT_INVALID == response.json()[
|
||||
'error']
|
||||
|
||||
@@ -567,7 +571,7 @@ class TestModbus:
|
||||
up_tag[0]['type'] = config.NEU_TYPE_BIT
|
||||
response = api.update_tags(
|
||||
node=param[0], group='group', tags=up_tag)
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert error.NEU_ERR_TAG_ATTRIBUTE_NOT_SUPPORT == response.json()[
|
||||
'error']
|
||||
|
||||
@@ -633,6 +637,8 @@ class TestModbus:
|
||||
def test_add_decimal_tag(self, param):
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_int16_decimal)
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_int16_decimal_neg)
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_uint16_decimal)
|
||||
api.add_tags_check(
|
||||
@@ -641,6 +647,8 @@ class TestModbus:
|
||||
node=param[0], group='group', tags=hold_uint32_decimal)
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_float_decimal)
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_float_decimal_neg)
|
||||
api.add_tags_check(
|
||||
node=param[0], group='group', tags=hold_double_decimal)
|
||||
|
||||
@@ -648,6 +656,8 @@ class TestModbus:
|
||||
def test_read_write_decimal_tag(self, param):
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_int16_decimal[0]['name'], value=11)
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_int16_decimal_neg[0]['name'], value=345)
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_uint16_decimal[0]['name'], value=23)
|
||||
api.write_tag_check(
|
||||
@@ -656,12 +666,16 @@ class TestModbus:
|
||||
node=param[0], group='group', tag=hold_uint32_decimal[0]['name'], value=123)
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_float_decimal[0]['name'], value=121.314)
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_float_decimal_neg[0]['name'], value=345.6)
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_double_decimal[0]['name'], value=513.11)
|
||||
|
||||
time.sleep(0.3)
|
||||
assert 11 == api.read_tag(
|
||||
node=param[0], group='group', tag=hold_int16_decimal[0]['name'])
|
||||
assert 345 == api.read_tag(
|
||||
node=param[0], group='group', tag=hold_int16_decimal_neg[0]['name'])
|
||||
assert 23 == api.read_tag(
|
||||
node=param[0], group='group', tag=hold_uint16_decimal[0]['name'])
|
||||
assert 123 == api.read_tag(
|
||||
@@ -670,6 +684,8 @@ class TestModbus:
|
||||
node=param[0], group='group', tag=hold_uint32_decimal[0]['name'])
|
||||
compare_float(121.314, api.read_tag(
|
||||
node=param[0], group='group', tag=hold_float_decimal[0]['name']))
|
||||
compare_float(345.6, api.read_tag(
|
||||
node=param[0], group='group', tag=hold_float_decimal[0]['name']))
|
||||
assert 513.11 == api.read_tag(
|
||||
node=param[0], group='group', tag=hold_double_decimal[0]['name'])
|
||||
|
||||
|
||||
@@ -228,6 +228,24 @@ class TestPlugin:
|
||||
assert 400 == response.status_code
|
||||
assert NEU_ERR_BODY_IS_WRONG == response.json().get("error")
|
||||
|
||||
@description(given="incorrect configuration", when="update plugin", then="success")
|
||||
def test_09_update_plugin_success0(self):
|
||||
test_data = TestPlugin.test_data
|
||||
plugin_data = {}
|
||||
plugin_data['library'] = test_data['library_c1']
|
||||
plugin_data['so_file'] = test_data['so_file_c1_2']
|
||||
plugin_data['schema_file'] = test_data['schema_file']
|
||||
|
||||
response = api.updata_plugin(
|
||||
library_name=plugin_data['library'], so_file=plugin_data['so_file'], schema_file=plugin_data['schema_file'])
|
||||
assert 200 == response.status_code
|
||||
assert NEU_ERR_SUCCESS == response.json().get("error")
|
||||
response = api.get_plugins()
|
||||
assert 200 == response.status_code
|
||||
for plugin in response.json().get("plugins"):
|
||||
if plugin['name'] == 'c1':
|
||||
assert plugin['version'] == '2.7.99'
|
||||
|
||||
@description(given="incorrect configuration", when="update plugin", then="fail")
|
||||
def test_10_update_plugin_fail3(self):
|
||||
test_data = TestPlugin.test_data
|
||||
|
||||
@@ -279,7 +279,7 @@ class TestLog:
|
||||
]
|
||||
)
|
||||
|
||||
assert 200 == response.status_code
|
||||
assert 400 == response.status_code
|
||||
assert NEU_ERR_TAG_TYPE_NOT_SUPPORT == response.json()['error']
|
||||
|
||||
response = api.get_group()
|
||||
@@ -342,7 +342,7 @@ class TestLog:
|
||||
]
|
||||
)
|
||||
|
||||
assert 200 == response.status_code
|
||||
assert 409 == response.status_code
|
||||
assert NEU_ERR_TAG_NAME_CONFLICT == response.json()['error']
|
||||
|
||||
response = api.get_group()
|
||||
|
||||
@@ -63,7 +63,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
|
||||
};
|
||||
|
||||
const neu_plugin_module_t neu_plugin_module = {
|
||||
.version = NEURON_PLUGIN_VER_1_0,
|
||||
.version = NEU_VERSION(2, 7, 99),
|
||||
.schema = "c1",
|
||||
.module_name = "c1",
|
||||
.module_descr = "c1 v2",
|
||||
|
||||
Reference in New Issue
Block a user