mirror of
https://github.com/emqx/neuron.git
synced 2026-10-30 07:45:59 +08:00
Compare commits
4
Commits
v2.6-daily
...
v2.16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e3fc394b | ||
|
|
3d7fbb58cd | ||
|
|
2b4630cee7 | ||
|
|
5187fcaf02 |
@@ -27,7 +27,7 @@ jobs:
|
||||
|
||||
cppcheck:
|
||||
runs-on: ubuntu-24.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.16
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.16
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
|
||||
ut:
|
||||
runs-on: ubuntu-24.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.16
|
||||
needs: [build]
|
||||
|
||||
steps:
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
|
||||
pft:
|
||||
runs-on: ubuntu-24.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.16
|
||||
needs: [build]
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -181,7 +181,7 @@ jobs:
|
||||
|
||||
pft_kafka:
|
||||
runs-on: ubuntu-24.04
|
||||
container: ghcr.io/neugates/build:x86_64-main
|
||||
container: ghcr.io/neugates/build:x86_64-v2.16
|
||||
needs: [build]
|
||||
services:
|
||||
kafka:
|
||||
@@ -224,13 +224,13 @@ jobs:
|
||||
- name: debug kafka plugin deps
|
||||
run: |
|
||||
echo "=== libs in staging prefix ==="
|
||||
ls -la /home/neuron/main/libs/x86_64-linux-gnu/lib/librdkafka* || echo "no librdkafka"
|
||||
ls -la /home/neuron/main/libs/x86_64-linux-gnu/lib/libzstd* || echo "no libzstd"
|
||||
ls -la /home/neuron/main/libs/x86_64-linux-gnu/lib/libsasl2* || echo "no libsasl2"
|
||||
ls -la /home/neuron/v2.16/libs/x86_64-linux-gnu/lib/librdkafka* || echo "no librdkafka"
|
||||
ls -la /home/neuron/v2.16/libs/x86_64-linux-gnu/lib/libzstd* || echo "no libzstd"
|
||||
ls -la /home/neuron/v2.16/libs/x86_64-linux-gnu/lib/libsasl2* || echo "no libsasl2"
|
||||
echo "=== libs in /usr/local/lib ==="
|
||||
ls -la /usr/local/lib/librdkafka* /usr/local/lib/libzstd* /usr/local/lib/libsasl2* 2>/dev/null || echo "none yet"
|
||||
echo "=== ldd librdkafka from staging ==="
|
||||
ldd /home/neuron/main/libs/x86_64-linux-gnu/lib/librdkafka.so.1 || true
|
||||
ldd /home/neuron/v2.16/libs/x86_64-linux-gnu/lib/librdkafka.so.1 || true
|
||||
echo "=== ldd plugin-kafka from build ==="
|
||||
chmod -R +x ./build/ 2>/dev/null || true
|
||||
ldd ./build/plugins/libplugin-kafka.so || true
|
||||
|
||||
@@ -8,9 +8,9 @@ on:
|
||||
- published
|
||||
|
||||
env:
|
||||
VERSION: 2.15.0
|
||||
VERSION: 2.16.0
|
||||
UI_VERSION: 2.6.1
|
||||
BRANCH: main
|
||||
BRANCH: v2.16
|
||||
|
||||
jobs:
|
||||
cross-build:
|
||||
@@ -19,7 +19,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.16
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -62,7 +62,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.16
|
||||
|
||||
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.16/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.16/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.16/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.16/libs)
|
||||
|
||||
set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#define NEU_VERSION_MAJOR 2
|
||||
#define NEU_VERSION_MINOR 15
|
||||
#define NEU_VERSION_MINOR 16
|
||||
#define NEU_VERSION_FIX 0
|
||||
|
||||
#define NEU_GET_VERSION_MAJOR(V) ((0xffff0000 & V) >> 16)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <nng/nng.h>
|
||||
#include <nng/supplemental/http/http.h>
|
||||
|
||||
@@ -11,6 +13,20 @@
|
||||
#include "json/neu_json_error.h"
|
||||
#include "json/neu_json_fn.h"
|
||||
|
||||
static void ede_cmd_uninit(neu_req_add_gtag_t *cmd)
|
||||
{
|
||||
if (cmd == NULL || cmd->groups == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < cmd->n_group; ++i) {
|
||||
neu_ede_tags_uninit(cmd->groups[i].tags, cmd->groups[i].n_tag);
|
||||
}
|
||||
free(cmd->groups);
|
||||
cmd->groups = NULL;
|
||||
cmd->n_group = 0;
|
||||
}
|
||||
|
||||
void handle_ede(nng_aio *aio)
|
||||
{
|
||||
neu_plugin_t *plugin = neu_rest_get_plugin();
|
||||
@@ -31,13 +47,16 @@ void handle_ede(nng_aio *aio)
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_INVALID_CID, {
|
||||
neu_http_response(aio, NEU_ERR_INVALID_CID, result_error);
|
||||
});
|
||||
goto success;
|
||||
}
|
||||
|
||||
int ret = neu_plugin_op(plugin, header, &cmd);
|
||||
if (ret != 0) {
|
||||
if (neu_plugin_op(plugin, header, &cmd) != 0) {
|
||||
ede_cmd_uninit(&cmd);
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_IS_BUSY, {
|
||||
neu_http_response(aio, NEU_ERR_IS_BUSY, result_error);
|
||||
});
|
||||
}
|
||||
|
||||
success:;
|
||||
})
|
||||
}
|
||||
@@ -1148,6 +1148,7 @@ static int get_tags_resp(context_t *ctx, neu_resp_get_tag_t *tags)
|
||||
tags_res.tags[index].precision = tag->precision;
|
||||
tags_res.tags[index].decimal = tag->decimal;
|
||||
tags_res.tags[index].bias = tag->bias;
|
||||
tags_res.tags[index].unit = tag->unit;
|
||||
tags_res.tags[index].t = NEU_JSON_UNDEFINE;
|
||||
}
|
||||
|
||||
|
||||
@@ -332,6 +332,12 @@ int neu_ede_parse_file(const char *file_path, neu_ede_result_t *result)
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if (!object_header_seen || result->count == 0) {
|
||||
neu_ede_result_uninit(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ class TestPlugin:
|
||||
assert 200 == response.status_code
|
||||
for plugin in response.json().get("plugins"):
|
||||
if plugin['name'] == 'c1':
|
||||
assert plugin['version'] == '2.15.99'
|
||||
assert plugin['version'] == '2.16.99'
|
||||
|
||||
@description(given="incorrect configuration", when="update plugin", then="fail")
|
||||
def test_10_update_plugin_fail3(self):
|
||||
|
||||
@@ -63,7 +63,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
|
||||
};
|
||||
|
||||
const neu_plugin_module_t neu_plugin_module = {
|
||||
.version = NEU_VERSION(2, 15, 99),
|
||||
.version = NEU_VERSION(2, 16, 99),
|
||||
.schema = "c1",
|
||||
.module_name = "c1",
|
||||
.module_descr = "c1 v2",
|
||||
|
||||
@@ -94,6 +94,7 @@ target_include_directories(mqtt_schema_test PRIVATE
|
||||
target_link_libraries(mqtt_schema_test neuron-base gtest_main gtest)
|
||||
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/tests/ut/EDE_test.csv DESTINATION ${UT_DIRECTORY}/config)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/tests/ut/wrong.ede DESTINATION ${UT_DIRECTORY}/config)
|
||||
add_executable(ede_test ede_test.cc ${CMAKE_SOURCE_DIR}/src/utils/ede.c)
|
||||
target_include_directories(ede_test PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
|
||||
@@ -15,6 +15,7 @@ zlog_category_t *neuron = NULL;
|
||||
|
||||
static constexpr size_t kExpectedEdeTagCount = 1499;
|
||||
#define EDE_TEST_FILE_PATH "./config/EDE_test.csv"
|
||||
#define WRONG_EDE_FILE_PATH "./config/wrong.ede"
|
||||
|
||||
static std::vector<std::string> split_semicolon(const std::string &line)
|
||||
{
|
||||
@@ -150,6 +151,22 @@ TEST(EdeTest, ParseEdeFileToAddressAndType)
|
||||
neu_ede_result_uninit(&result);
|
||||
}
|
||||
|
||||
TEST(EdeTest, RejectTruncatedEdeFile)
|
||||
{
|
||||
neu_ede_result_t result = { 0 };
|
||||
neu_datatag_t * tags = NULL;
|
||||
size_t count = 0;
|
||||
|
||||
EXPECT_NE(neu_ede_parse_file(WRONG_EDE_FILE_PATH, &result), 0);
|
||||
EXPECT_EQ(result.entries, nullptr);
|
||||
EXPECT_EQ(result.count, 0);
|
||||
|
||||
EXPECT_NE(neu_ede_parse_file_to_tags(WRONG_EDE_FILE_PATH, &tags, &count),
|
||||
0);
|
||||
EXPECT_EQ(tags, nullptr);
|
||||
EXPECT_EQ(count, 0);
|
||||
}
|
||||
|
||||
TEST(EdeTest, FormatAddress)
|
||||
{
|
||||
char address[128] = { 0 };
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#Engineering-Data-Exchange;;;;;;;;;;;;;;;;;;;
|
||||
#PROJECT_NAME;NeuronEX BACnet/IP EDE Simulator;;;;;;;;;;;;;;;;;;;
|
||||
#VERSION_OF_REFERENCEFILE;1.0;;;;;;;;;;;;;;;;;;;
|
||||
#TIMESTAMP_OF_LAST_CHANGE;25.09.2026;;;;;;;;;;;;;;;;;;;
|
||||
#AUTHOR_OF_LAST_
|
||||
Reference in New Issue
Block a user