diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2019-03-12 02:46:26 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2019-03-14 07:24:03 -0700 |
| commit | 666c23a48a93ad38443a0c70f8d5b1fa12cafd86 (patch) | |
| tree | d070e8f35955b9825046ad6e235846bf01eabf9c /meta-oe/recipes-extended/rsyslog/librelp | |
| parent | b3eeaf4498f09339c3727c95d3d9368ba9903286 (diff) | |
| download | meta-openembedded-666c23a48a93ad38443a0c70f8d5b1fa12cafd86.tar.gz | |
librelp: Upgrade to 1.4.0
Remove one backported patch.
Add openssl to Depends.
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/librelp')
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch | 164 |
1 files changed, 0 insertions, 164 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch deleted file mode 100644 index 6b60bd7486..0000000000 --- a/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch +++ /dev/null | |||
| @@ -1,164 +0,0 @@ | |||
| 1 | From 1e6be18ed243dc562ff2976b46850bfd2e576664 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Rainer Gerhards <rgerhards@adiscon.com> | ||
| 3 | Date: Thu, 15 Nov 2018 12:23:41 +0100 | ||
| 4 | Subject: [PATCH] testbench improvements | ||
| 5 | |||
| 6 | Most importantly, the test receiver process is now terminated | ||
| 7 | gracefully. Without that, gcov can never pick up correct | ||
| 8 | coverage data. | ||
| 9 | |||
| 10 | Upstream-Status: Backport[https://github.com/rsyslog/librelp/commit/1e6be18ed243dc562ff2976b46850bfd2e576664] | ||
| 11 | |||
| 12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 13 | --- | ||
| 14 | src/tcp.c | 4 ++-- | ||
| 15 | tests/Makefile.am | 3 ++- | ||
| 16 | tests/receive.c | 29 +++++++++++++++++++++++++++-- | ||
| 17 | tests/selftest_receive_usage.sh | 5 +++++ | ||
| 18 | tests/test-framework.sh | 4 ++-- | ||
| 19 | 5 files changed, 38 insertions(+), 7 deletions(-) | ||
| 20 | create mode 100755 tests/selftest_receive_usage.sh | ||
| 21 | |||
| 22 | diff --git a/src/tcp.c b/src/tcp.c | ||
| 23 | index f10a720..0ea92ea 100644 | ||
| 24 | --- a/src/tcp.c | ||
| 25 | +++ b/src/tcp.c | ||
| 26 | @@ -3027,7 +3027,7 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 27 | struct addrinfo hints; | ||
| 28 | struct addrinfo *reslocal = NULL; | ||
| 29 | struct pollfd pfd; | ||
| 30 | - char errmsg[1024]; | ||
| 31 | + char errmsg[1424]; | ||
| 32 | int so_error; | ||
| 33 | socklen_t len = sizeof so_error; | ||
| 34 | int r; | ||
| 35 | @@ -3067,7 +3067,7 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 36 | } | ||
| 37 | if(connect(pThis->sock, res->ai_addr, res->ai_addrlen) == -1) { | ||
| 38 | if(errno != EINPROGRESS) { | ||
| 39 | - char errStr[1024]; | ||
| 40 | + char errStr[1200]; | ||
| 41 | _relpEngine_strerror_r(errno, errStr, sizeof(errStr)); | ||
| 42 | snprintf(errmsg, sizeof(errmsg), "error connecting: '%s'", errStr); | ||
| 43 | callOnErr(pThis, errmsg, RELP_RET_IO_ERR); | ||
| 44 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
| 45 | index 64deb19..51fd78f 100644 | ||
| 46 | --- a/tests/Makefile.am | ||
| 47 | +++ b/tests/Makefile.am | ||
| 48 | @@ -25,7 +25,8 @@ TESTS= basic.sh \ | ||
| 49 | long-msg.sh \ | ||
| 50 | oversize-msg-abort-errmsg.sh \ | ||
| 51 | oversize-msg-accept-errmsg.sh \ | ||
| 52 | - truncate-oversize-msg.sh | ||
| 53 | + truncate-oversize-msg.sh \ | ||
| 54 | + selftest_receive_usage.sh | ||
| 55 | # OpenSSL tests only! | ||
| 56 | if ENABLE_TLS_OPENSSL | ||
| 57 | TESTS += tls-wrong-permittedPeer.sh \ | ||
| 58 | diff --git a/tests/receive.c b/tests/receive.c | ||
| 59 | index e56e59c..4b69c99 100644 | ||
| 60 | --- a/tests/receive.c | ||
| 61 | +++ b/tests/receive.c | ||
| 62 | @@ -1,6 +1,7 @@ | ||
| 63 | /* A minimal RELP receiver using librelp | ||
| 64 | * | ||
| 65 | * Copyright 2014 Mathias Nyman | ||
| 66 | + * Copyright 2018 Adiscon GmbH | ||
| 67 | * | ||
| 68 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 69 | * you may not use this file except in compliance with the License. | ||
| 70 | @@ -24,6 +25,7 @@ | ||
| 71 | #include <string.h> | ||
| 72 | #include <limits.h> | ||
| 73 | #include <errno.h> | ||
| 74 | +#include <signal.h> | ||
| 75 | #include "librelp.h" | ||
| 76 | |||
| 77 | #define TRY(f) if(f != RELP_RET_OK) { fprintf(stderr, "receive.c: FAILURE in '%s'\n", #f); ret = 1; goto done; } | ||
| 78 | @@ -31,6 +33,24 @@ | ||
| 79 | static FILE *errFile = NULL; | ||
| 80 | static relpEngine_t *pRelpEngine; | ||
| 81 | |||
| 82 | +static void | ||
| 83 | +hdlr_enable(int sig, void (*hdlr)()) | ||
| 84 | +{ | ||
| 85 | + struct sigaction sigAct; | ||
| 86 | + memset(&sigAct, 0, sizeof (sigAct)); | ||
| 87 | + sigemptyset(&sigAct.sa_mask); | ||
| 88 | + sigAct.sa_handler = hdlr; | ||
| 89 | + sigaction(sig, &sigAct, NULL); | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +void | ||
| 93 | +terminate(int sig) | ||
| 94 | +{ | ||
| 95 | + fprintf(stderr, "terminating on signal %d\n", sig); | ||
| 96 | + relpEngineSetStop(pRelpEngine); | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | + | ||
| 100 | static void __attribute__((format(printf, 1, 2))) | ||
| 101 | dbgprintf(char *fmt, ...) | ||
| 102 | { | ||
| 103 | @@ -237,6 +257,8 @@ int main(int argc, char *argv[]) { | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | + hdlr_enable(SIGTERM, terminate); | ||
| 108 | + | ||
| 109 | TRY(relpEngineConstruct(&pRelpEngine)); | ||
| 110 | TRY(relpEngineSetDbgprint(pRelpEngine, verbose ? dbgprintf : NULL)); | ||
| 111 | TRY(relpEngineSetEnableCmd(pRelpEngine, (unsigned char*) "syslog", eRelpCmdState_Required)); | ||
| 112 | @@ -294,11 +316,14 @@ int main(int argc, char *argv[]) { | ||
| 113 | fclose(fp); | ||
| 114 | } | ||
| 115 | |||
| 116 | - TRY(relpEngineRun(pRelpEngine)); /* Abort with ctrl-c */ | ||
| 117 | + TRY(relpEngineRun(pRelpEngine)); /* Abort via SIGHUP */ | ||
| 118 | |||
| 119 | - TRY(relpEngineSetStop(pRelpEngine)); | ||
| 120 | TRY(relpEngineDestruct(&pRelpEngine)); | ||
| 121 | |||
| 122 | + if(pidFileName != NULL) { | ||
| 123 | + unlink(pidFileName); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | done: | ||
| 127 | return ret; | ||
| 128 | } | ||
| 129 | diff --git a/tests/selftest_receive_usage.sh b/tests/selftest_receive_usage.sh | ||
| 130 | new file mode 100755 | ||
| 131 | index 0000000..c4ac8bb | ||
| 132 | --- /dev/null | ||
| 133 | +++ b/tests/selftest_receive_usage.sh | ||
| 134 | @@ -0,0 +1,5 @@ | ||
| 135 | +#!/bin/bash | ||
| 136 | +. ${srcdir:=$(pwd)}/test-framework.sh | ||
| 137 | +./receive &>librelp.out.log | ||
| 138 | +check_output "Port is missing" | ||
| 139 | +terminate | ||
| 140 | diff --git a/tests/test-framework.sh b/tests/test-framework.sh | ||
| 141 | index 6abdcf2..d4ab3ec 100644 | ||
| 142 | --- a/tests/test-framework.sh | ||
| 143 | +++ b/tests/test-framework.sh | ||
| 144 | @@ -32,7 +32,7 @@ function wait_process_startup_via_pidfile() { | ||
| 145 | # start receiver WITH valgrind, add receiver command line parameters after function name | ||
| 146 | function startup_receiver_valgrind() { | ||
| 147 | printf 'Starting Receiver...\n' | ||
| 148 | - $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log & | ||
| 149 | + $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log & | ||
| 150 | export RECEIVE_PID=$! | ||
| 151 | printf "got receive pid $RECEIVE_PID\n" | ||
| 152 | wait_process_startup_via_pidfile receive.pid | ||
| 153 | @@ -43,7 +43,7 @@ function startup_receiver_valgrind() { | ||
| 154 | # start receiver, add receiver command line parameters after function name | ||
| 155 | function startup_receiver() { | ||
| 156 | printf 'Starting Receiver...\n' | ||
| 157 | - ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log & | ||
| 158 | + ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log & | ||
| 159 | export RECEIVE_PID=$! | ||
| 160 | printf "got receive pid $RECEIVE_PID\n" | ||
| 161 | wait_process_startup_via_pidfile receive.pid | ||
| 162 | -- | ||
| 163 | 2.17.1 | ||
| 164 | |||
