diff options
Diffstat (limited to 'meta-networking/recipes-protocols/freediameter/files')
4 files changed, 97 insertions, 171 deletions
diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch b/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch deleted file mode 100644 index d5e242ac21..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch +++ /dev/null @@ -1,97 +0,0 @@ -From d527a0b7b63e43263384540b5525714484bb089f Mon Sep 17 00:00:00 2001 -From: Mingli Yu <Mingli.Yu@windriver.com> -Date: Mon, 3 Sep 2018 14:40:56 +0800 -Subject: [PATCH] libfdcore/sctp.c: update the old sctp api check - -The initial sctp api check for freediameter as below: - === - commit d3c5e991cb532ea09684d69fb4d0d58e9bc39a0c - Author: Sebastien Decugis <sdecugis@freediameter.net> - Date: Mon Jun 3 12:05:37 2013 +0800 - - Add some compliancy to RFC6458. Not tested however as Ubuntu does not support this yet - - [snip] - +/* Use old draft-ietf-tsvwg-sctpsocket-17 API ? If not defined, RFC6458 API will be used */ - +/* #define OLD_SCTP_SOCKET_API */ - + - +/* Automatically fallback to old API if some of the new symbols are not defined */ - +#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) - +# define OLD_SCTP_SOCKET_API - +#endif - === - -SCTP_RECVRCVINFO is defined in <linux/sctp.h>, -but <linux/sctp.h> is't included in the source code -previouly. So defined(SCTP_RECVRCVINFO) can be 0 -and it make old sctp socket api definiton in effect -as below: - # define OLD_SCTP_SOCKET_API - -After lksctp-tools upgrade to 1.0.18, there is below -commit introduced: -=== -commit 3c8bd0d26b64611c690f33f5802c734b0642c1d8 -Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> -Date: Tue Apr 17 20:17:14 2018 -0300 - - sctp.h: make use kernel UAPI header - - and with that, remove tons of duplicated declarations. These were - lagging behind the kernel header, which is always the most updated one, - and as the library is intended to be run only on Linux, there is no - reason that we cannot re-use what is in there. - - That said, this patch drops all duplicated declarations and includes - linux/sctp.h to bring them into lksctp-tools. - - Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - - [snip] - #include <stdint.h> - #include <linux/types.h> - #include <sys/socket.h> -+#include <linux/sctp.h> - [snip] -=== - -And above logic make defined(SCTP_RECVRCVINFO) to -be 1 and the old sctp socket api macro as below -won't be defined. - # define OLD_SCTP_SOCKET_API - -And it encouters below build error: -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: error: 'SCTP_SEND_FAILED_EVENT' undeclared (first use in this function); did you mean 'SCTP_SEND_FAILED'? - case SCTP_SEND_FAILED_EVENT: - ^~~~~~~~~~~~~~~~~~~~~~ - SCTP_SEND_FAILED -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: note: each undeclared identifier is reported only once for each function it appears in -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1274:9: error: 'SCTP_NOTIFICATIONS_STOPPED_EVENT' undeclared (first use in this function); did you mean 'SCTP_AUTHENTICATION_EVENT'? - case SCTP_NOTIFICATIONS_STOPPED_EVENT: - -Update the old sctp socket api check to fix -the above build error. - -Upstream-Status: Pending - -Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> ---- - libfdcore/sctp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libfdcore/sctp.c b/libfdcore/sctp.c -index c80a497..83440c7 100644 ---- a/libfdcore/sctp.c -+++ b/libfdcore/sctp.c -@@ -48,7 +48,7 @@ - /* #define OLD_SCTP_SOCKET_API */ - - /* Automatically fallback to old API if some of the new symbols are not defined */ --#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) -+#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_NOTIFICATIONS_STOPPED_EVENT)) || (!defined(SCTP_SNDINFO))) - # define OLD_SCTP_SOCKET_API - #endif - --- -2.7.4 - diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch new file mode 100644 index 0000000000..4cedc21ce8 --- /dev/null +++ b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch @@ -0,0 +1,92 @@ +From 935fcac46e2790e0e297ca855b8033895c1b8941 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Wed, 24 Aug 2022 13:45:32 +0800 +Subject: [PATCH] tests: use EXTENSIONS_DIR + +Use EXTENSIONS_DIR to replace BUILD_DIR as the BUILD_DIR is meanlingless +on target and also fix buildpaths issue. + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + tests/CMakeLists.txt | 1 + + tests/testloadext.c | 12 ++++++------ + tests/testmesg_stress.c | 12 ++++++------ + 3 files changed, 13 insertions(+), 12 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 8b698ce..2c83cbb 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -37,6 +37,7 @@ SET(TEST_LIST + + ADD_DEFINITIONS(-DTEST_DEBUG) + ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}") ++ADD_DEFINITIONS(-DEXTENSIONS_DIR="${EXTENSIONS_DIR}") + + INCLUDE_DIRECTORIES( "../libfdproto" ) + INCLUDE_DIRECTORIES( "../libfdcore" ) +diff --git a/tests/testloadext.c b/tests/testloadext.c +index 452737f..3fffef5 100644 +--- a/tests/testloadext.c ++++ b/tests/testloadext.c +@@ -35,9 +35,9 @@ + + #include "tests.h" + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + #include <sys/types.h> + #include <dirent.h> +@@ -59,9 +59,9 @@ int main(int argc, char *argv[]) + CHECK( 0, fd_rtdisp_init() ); + + /* Find all extensions which have been compiled along the test */ +- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ TRACE_DEBUG(INFO, "Loading from: '%s'", EXTENSIONS_DIR); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +diff --git a/tests/testmesg_stress.c b/tests/testmesg_stress.c +index 310a9d2..97dfe07 100644 +--- a/tests/testmesg_stress.c ++++ b/tests/testmesg_stress.c +@@ -38,9 +38,9 @@ + #include <libgen.h> + #include <dlfcn.h> + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + + /* The number of times each operation is repeated to measure the average operation time */ +@@ -73,9 +73,9 @@ static void load_all_extensions(char * prefix) + struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); + + /* Find all extensions which have been compiled along the test */ +- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ LOG_D("Loading %s*.fdx from: '%s'", EXTENSIONS_DIR, prefix ?: ""); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch deleted file mode 100644 index ea857af7d6..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch +++ /dev/null @@ -1,72 +0,0 @@ -freediameter ptest cases testmesg_stress.c and testloadext.c need load -extensions both build time and runtime. Then they search extensions with -build directory that causes runtime failures. - -Pass an environment variable to define runtime extension path. - -Upstream-Status: Inappropriate [OE ptest specific] - -Signed-off-by: Kai Kang <kai.kang@windriver.com> -Signed-off-by: Jackie Huang <jackie.huang@windriver.com> - -diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c ---- freeDiameter-1.2.0.orig/tests/testloadext.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testloadext.c 2014-02-19 20:08:03.871403924 +0800 -@@ -49,7 +49,7 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - - /* First, initialize the daemon modules */ -@@ -57,11 +57,16 @@ - CHECK( 0, fd_queues_init() ); - CHECK( 0, fd_msg_init() ); - CHECK( 0, fd_rtdisp_init() ); -- -+ -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); -diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c ---- freeDiameter-1.2.0.orig/tests/testmesg_stress.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800 -@@ -67,15 +67,20 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions); - struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); - -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest index d0ca8d9621..7d0648935c 100644 --- a/meta-networking/recipes-protocols/freediameter/files/run-ptest +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest @@ -6,6 +6,9 @@ if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then echo fi -export EXTENSIONS_DIR=$EXTENSIONS_DIR cmake -E cmake_echo_color --cyan "Running tests..." -ctest --force-new-ctest-process +if ctest --force-new-ctest-process ; then + echo "PASS: freediameter" +else + echo "FAIL: freediameter" +fi |