diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-01-03 09:51:34 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-01-04 17:12:43 +0100 |
commit | 81f8d97b3486928048bb8ad701b4af62ddce9901 (patch) | |
tree | 2b072a5b2e41ed38fbd052b73a07f1c7c54f21b8 /tests/mini-dtls-discard.c | |
parent | b978a25de5ef06754bf94bdfb2e6442b7fb6f1fa (diff) | |
download | gnutls-81f8d97b3486928048bb8ad701b4af62ddce9901.tar.gz |
tests: treat all signals as errortmp-tests-fail-on-signals
Previously we were only treating SIGSEGV as error though there is
no reason to treat other signals as success and they may hide an
actual error case (e.g., when SIGPIPE is received). With this change we
treat any signals received by the child except SIGTERM as error, and
we ensure that SIGPIPE is ignored in all tests.
This also updates tests/slow/cipher-api-test.c to test failures with
SIGABRT or otherwise consistently.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/mini-dtls-discard.c')
-rw-r--r-- | tests/mini-dtls-discard.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/mini-dtls-discard.c b/tests/mini-dtls-discard.c index e9201acaea..97bc6de29b 100644 --- a/tests/mini-dtls-discard.c +++ b/tests/mini-dtls-discard.c @@ -44,6 +44,7 @@ int main() #include <arpa/inet.h> #include <unistd.h> #include <errno.h> +#include <signal.h> #include <gnutls/gnutls.h> #include <gnutls/dtls.h> #include <assert.h> @@ -266,6 +267,8 @@ void start(const char *prio) int fd[2]; int ret; + signal(SIGPIPE, SIG_IGN); + ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); if (ret < 0) { perror("socketpair"); |