summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2015-09-11Enable -Wmissing-variable-declarations andBen Laurie
-Wincompatible-pointer-types-discards-qualifiers (the latter did not require any code changes). Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-09Add a simple test for the new rehash commandRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-09Make sure the temporary error log resides in a well defined locationRichard Levitte
If a test recipe does something like this: indir "foo.$$" => sub { chmod 0500, File::Spec->curdir(); ok(run(app(["something"]))); } we get a problem, because we were storing the temporary stderr file in the current directory at all times (so while inside the 'indir', we would attemp to store it in "foo.$$"). So, change our ways to always store that temporary file in the exact same location, defined by the environment variable RESULT_D, or failing that TEST_D, or failing that $TOP/test. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-09Fix warning about mixed declarations and code.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-09PACKET: add PACKET_memdup and PACKET_strndupEmilia Kasper
Use each once in s3_srvr.c to show how they work. Also fix a bug introduced in c3fc7eeab884b6876a1b4006163f190d325aa047 and made apparent by this change: ssl3_get_next_proto wasn't updating next_proto_negotiated_len Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-08Fix a few tests that depended on the wrong algorithm checkRichard Levitte
test_ecdh and test_ecdsa are made to depend on no-ec being false. test_hmac is made not to depend on algorithm at all. Based on a contribution by Alessandro Ghedini <alessandro@ghedini.me> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-08Adjust the verify_extra test recipe to its executableRichard Levitte
The verify_extra_test was recently changed to take its parameters as arguments instead of having them hardcoded. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Make sure that 80-test_ca.t finds all the config filesRichard Levitte
This recipe counted too much on being called with test/ as its current working directory. That's a mistake on, for example, Windows. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add a recipe for the new null pointer testRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Change the 80-test_tsa recipe as per changes in testtsaRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add a recipe for the new pbelu testRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Remake the testsslproxy testsRichard Levitte
The testsslproxy tests turned out to be useless as they were. They were really just for show and the results were ignore. Now they are changed into a more veerifiable test Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Small fix in OpenSSL::TestRichard Levitte
Be careful when shifting in a function argument, you end up changing the caller's value. Instead, when it is an array, make a shallow copy and shift in that instead. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Incorporate recent changes that were originally made in test/testsslRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add documentation for the new testing frameworkRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add a recipe for the new gmdiff testRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Correct test nameRichard Levitte
Some tests were copied from test_jpake, but the title wasn't changed accordingly. This might seem like a small thing, but it does affect the log file name... Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Remake test/sslsessionticktest.pl into a recipeRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Adapt the libssl test harness testing scripts to new testing frameworkRichard Levitte
This involves adding $TOP/util as perl library in test/run_tests.pl. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Check the validity of MINFORichard Levitte
MINFO may be an old file lying around, which might have 00-check_testexes.t produce incorrect results. To make sure this doesn't happen, check the variable VERSION in it against the same variable in the top Makefile. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Better method of skipping all the tests in 00-check_testexes.tRichard Levitte
Before trying to read MINFO, we have no idea how many to test for, and because skip expects to get an exact number somehow, it's better to use 'plan skip_all'. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Remove special x509 test conversionsRichard Levitte
Following the commit from July 2 that removed netscape formated certs, it is no longer necessary to have conversion tests for it. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add a few missing testsRichard Levitte
test_clienthello test_packet test_verify_extra test_secmem Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Push the line buffer filter on the out BIO on VMSRichard Levitte
VMS files are normally record oriented rather than stream oriented. This means that every write() will create a new record, which is seen as a line of its own, regardless of if there was a \n in there or not. bntest uses BN_print, which prints out number with more than one write(), thereby dividing up the numbers in several lines, which greatly disturbs the post-bntest checks that expect to find a full formula to calculate on one line. So, for VMS, we need to push the linebuffer filter on the out BIO. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Rework 00-test_checkexes.t for VMSRichard Levitte
Unfortunately, a file spec with character range globs interfere with paths on VMS, and are therefore disabled. Rework this test to collect a list of expected tests and a list of all recipes and compare the two using grep. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Document OpenSSL::Test and OpenSSL::Test::SimpleRichard Levitte
For OpenSSL::Test, it meant rearranging the code to better suite the structure of the documentation. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Change OpenSSL::Test to be an extension of Test::MoreRichard Levitte
It became tedious as well as error prone to have all recipes use Test::More as well as OpenSSL::Test. The easier way is to make OpenSSL::Test an extension of Test::More, thereby having all version checks as well as future checks firmly there. Additionally, that allows us to extend existing Test::More functions if the need would arise. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07New feature: STOPTESTRichard Levitte
When the environment variable STOPTEST is defined (with any value other than the empty string), the test machinery in OpenSSL::Test goes into a different mode that will stop all testing at the end of a failing recipe. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add version numbers on some modules we use.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Have 'make clean' clean away the log files.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Tone down the requirements of a test that will go away.Richard Levitte
00-check_testexes.t was a way for me to check that I didn't forget a compiled test app. The way it worked was to require MINFO to be present. Considering the need for this test has diminished considerably at this point, I might as well tone down the requirement, and have it skip the test (and not fail it) if MINFO isn't present. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Remove old testing scripts out of the way.Richard Levitte
For now, I'm moving them into Attic/. They will be removed later. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Simplify very simple test recipes further.Richard Levitte
Very simple test recipes easily become tedious, so they might benefit from being made as simple as possible. Therefore, OpenSSL::Test::Simple is born. It currently provides but one function, simple_test(), which takes a minimum of two parameters (test name and program to run), with the optional third, being the algorithm to be checked for before running the test itself. All recipes with that simple thing to do have been rewritten to be as minimal as possible. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Remove test targets from Makefile, have it use run_tests.plRichard Levitte
Also remove recipes/00-check_testalltests.t, since it will lack the information from the now gone alltests target. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add recipes for misc other things we want to testRichard Levitte
Note that this required a change in constant_time_test.c, as it says "ok", which interferes with what Test::Harness expects to see. I had constant_time_test.c say "success" instead. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add recipes for the larger protocolsRichard Levitte
This covers the certificate authority commands, the cms and smime commands, OCSP, SSL and TSA. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add engine and evp test recipes.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add recipes for tests related to certificatesRichard Levitte
Some of them make use of recipes/tconversion.pl. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add asymetric cipher test recipesRichard Levitte
Some of them make use of recipes/tconversion.pl. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add a helper script for key file format conversion testsRichard Levitte
As tests are done until now, there are a few scripts that look almost, but not quite the same. tkey, tx509, tcrl, tpkcs7, treq, tsid and probably a few more. recipes/tconversions.pl is a helper script that generalises the function of each of those, and can then be used in a general manner from test recipes. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add the encryption test recipeRichard Levitte
This tests all available openssl cipher commands. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add recipes for individual block ciphers, stream ciphers and digestsRichard Levitte
These recipes all correspond to a compiled test program. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Add math tests recipesRichard Levitte
The math recipes are among the heavier, but also quite important. For the BN test, we have previously relied on bc to verify the numbers. Unfortunately, bc doesn't exist everywhere, making tests on some platforms rather painful. With the new recipe (recipes/10-test_bn.t), we rely on perl's Math::BigInt and a homegrown simple calculator (recipes/bc.pl) that can do enough to cover for bc. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-07Groundwork for a perl based testing frameworkRichard Levitte
The idea with this perl based testing framework is to make use of what's delivered with perl and exists on all sorts of platforms. The choice came to using Test::More and Test::Harness, as that seems to be the most widely spread foundation, even if perl is aged. The main runner of the show is run_tests.pl. As it currently stands, it's designed to run from inside Makefile, but it's absolutely possible to run it from the command line as well, like so: cd test OPENSSL_SRCDIR=.. perl run_tests.pl The tester scripts themselves are stored in the subdirectory recipes/, and initially, we have two such scripts, recipes/00-check_testalltests.t and recipes/00-check_testexes.t. recipes/00-check_testalltests.t will pick out the dependencies of "alltests" in test/Makefile, and check if it can find recipes with corresponding names. recipes/00-check_testexes.t does something similar, but bases it on existing compiled test binaries. They make it easy to figure out what's to be added, and will be removed when this effort is finished. Individual recipes can be run as well, of course, as they are perl scripts in themselves. For example, you can run only recipes/00-check_testexes.t like so: cd test OPENSSL_SRCDIR=.. perl recipes/00-check_testexes.t To make coding easier, there's a routine library OpenSSL::Test, which is reachable in a perl script like so: use lib 'testlib'; use OpenSSL::Test; Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-06Have the test executables output in text modeRichard Levitte
The test executables use standard output and standard error for text output, so let's open the corresponding BIOs in text mode. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-06Make the verify_extra test location agnosticRichard Levitte
Depending on platform, verify_extra_test may fail because it relies on test/ being the current working directory. Make it get all the required files on the command line instead to solve that issue. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-06Avoid direct X509 structure accessDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05Cleanup testtsa scriptRich Salz
Add RUN function; remove single-use functions and use their body inline. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-05Use the shlib wrapper when running nptestAlessandro Ghedini
Since there seems to be no way to avoid linking to libssl and libcrypto, just wrap the test. This unbreaks "shared" builds when using clang and/or OS X. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Ben Laurie <ben@openssl.org>
2015-09-04Supply a build rule for the recently added nptestBenjamin Kaduk
Commit d4ab70f27cb7e518e6a9d6323c996cc3feb7496b added a test program to check that the NULL pointer is represented as all zero bits, but did not specify a build rule for that new executable. On many platforms, the implicit rule sufficed, since nptest is a very simple program, but for at least darwin-i386-cc, an explicit rule is needed. On darwin-i386-cc, the implicit rule targetted a 64-bit executable, but the object file containing the definition of main was a 32-bit object, which the linker excluded from consideration, resulting in a link failure due to no definition for _main. Add the missing build rule to fix the build on such platforms. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>