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/prf.c | |
parent | b978a25de5ef06754bf94bdfb2e6442b7fb6f1fa (diff) | |
download | gnutls-tmp-tests-fail-on-signals.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/prf.c')
-rw-r--r-- | tests/prf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/prf.c b/tests/prf.c index 78526cfba8..ff839fe73c 100644 --- a/tests/prf.c +++ b/tests/prf.c @@ -41,6 +41,7 @@ int main(int argc, char **argv) #include <sys/wait.h> #include <arpa/inet.h> #include <unistd.h> +#include <signal.h> #include <gnutls/gnutls.h> #include <gnutls/dtls.h> @@ -423,6 +424,8 @@ static void start(void) int fd[2]; int ret; + signal(SIGPIPE, SIG_IGN); + ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); if (ret < 0) { perror("socketpair"); |