Add a test to see that signals are caught as failures
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
This commit is contained in:
parent
2ef157afb9
commit
ef33d13185
3 changed files with 31 additions and 0 deletions
17
test/aborttest.c
Normal file
17
test/aborttest.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL licenses, (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* https://www.openssl.org/source/license.html
|
||||
* or in the file LICENSE in the source distribution.
|
||||
*/
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
OPENSSL_die("Voluntary abort", __FILE__, __LINE__);
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{- use File::Spec::Functions qw/catdir rel2abs/; -}
|
||||
PROGRAMS=\
|
||||
aborttest \
|
||||
nptest bntest \
|
||||
ectest ecdsatest ecdhtest gmdifftest pbelutest ideatest \
|
||||
md2test md4test md5test \
|
||||
|
@ -15,6 +16,10 @@ PROGRAMS=\
|
|||
packettest asynctest secmemtest srptest memleaktest \
|
||||
dtlsv1listentest ct_test threadstest afalgtest
|
||||
|
||||
SOURCE[aborttest]=aborttest.c
|
||||
INCLUDE[aborttest]={- rel2abs(catdir($builddir,"../include")) -} ../include
|
||||
DEPEND[aborttest]=../libcrypto
|
||||
|
||||
SOURCE[nptest]=nptest.c
|
||||
INCLUDE[nptest]={- rel2abs(catdir($builddir,"../include")) -} ../include
|
||||
DEPEND[nptest]=../libcrypto
|
||||
|
|
9
test/recipes/01-test_abort.t
Normal file
9
test/recipes/01-test_abort.t
Normal file
|
@ -0,0 +1,9 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use OpenSSL::Test;
|
||||
|
||||
setup("test_abort");
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
is(run(test(["aborttest"])), 0, "Testing that abort is caught correctly");
|
Loading…
Reference in a new issue