[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Mon Mar 19 06:09:17 UTC 2018
The branch master has been updated
via 00c8f1b05cd5e815d21e51737505e901d572e09c (commit)
via b4d46ad27078fa71bbc7270b667a7764d87d6f0f (commit)
from 97a479c6f835ba7e1e5b03de4ff59bf829a6eadd (commit)
- Log -----------------------------------------------------------------
commit 00c8f1b05cd5e815d21e51737505e901d572e09c
Author: Richard Levitte <levitte at openssl.org>
Date: Wed Mar 14 17:31:20 2018 +0100
Stop test/shlibloadtest.c from failing in a regression test
When doing a regression test, it's obvious that the version
test/shlibloadtest is built for will not be the same as the library
version. So we change the test to check for assumed compatibility.
Reviewed-by: Andy Polyakov <appro at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5619)
commit b4d46ad27078fa71bbc7270b667a7764d87d6f0f
Author: Richard Levitte <levitte at openssl.org>
Date: Wed Mar 14 17:25:37 2018 +0100
Add a simple method to run regression tests
This is only useful when building shared libraries. This allows us to
run our tests against newer libraries when the time comes. Simply do
this:
OPENSSL_REGRESSION=/other/OpenSSL/build/tree make test
($OPENSSL_REGRESSION *must* be an absolute path)
Reviewed-by: Andy Polyakov <appro at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5619)
-----------------------------------------------------------------------
Summary of changes:
test/shlibloadtest.c | 14 +++++++++++++-
util/shlib_wrap.sh.in | 20 ++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/test/shlibloadtest.c b/test/shlibloadtest.c
index 5f8ec55..0bf24ee 100644
--- a/test/shlibloadtest.c
+++ b/test/shlibloadtest.c
@@ -141,8 +141,20 @@ static int test_lib(void)
myERR_get_error = (ERR_get_error_t)symbols[0].func;
if (!TEST_int_eq(myERR_get_error(), 0))
goto end;
+
+ /*
+ * The bits that COMPATIBILITY_MASK lets through MUST be the same in
+ * the library and in the application.
+ * The bits that are masked away MUST be a larger or equal number in
+ * the library compared to the application.
+ */
+# define COMPATIBILITY_MASK 0xfff00000L
myOpenSSL_version_num = (OpenSSL_version_num_t)symbols[1].func;
- if (!TEST_int_eq(myOpenSSL_version_num(), OPENSSL_VERSION_NUMBER))
+ if (!TEST_int_eq(myOpenSSL_version_num() & COMPATIBILITY_MASK,
+ OPENSSL_VERSION_NUMBER & COMPATIBILITY_MASK)
+ goto end;
+ if (!TEST_int_ge(myOpenSSL_version_num() & ~COMPATIBILITY_MASK,
+ OPENSSL_VERSION_NUMBER & ~COMPATIBILITY_MASK)
goto end;
switch (test_type) {
diff --git a/util/shlib_wrap.sh.in b/util/shlib_wrap.sh.in
index 27a1e51..6c115ba 100755
--- a/util/shlib_wrap.sh.in
+++ b/util/shlib_wrap.sh.in
@@ -1,5 +1,25 @@
#!/bin/sh
+# To test this OpenSSL version's applications against another version's
+# shared libraries, simply set
+#
+# OPENSSL_REGRESSION=/path/to/other/OpenSSL/build/tree
+if [ -n "$OPENSSL_REGRESSION" ]; then
+ shlibwrap="$OPENSSL_REGRESSION/util/shlib_wrap.sh"
+ if [ -x "$shlibwrap" ]; then
+ # We clear OPENSSL_REGRESSION to avoid a loop, should the shlib_wrap.sh
+ # we exec also support that mechanism...
+ OPENSSL_REGRESSION= exec "$shlibwrap" "$@"
+ else
+ if [ -f "$shlibwrap" ]; then
+ echo "Not permitted to run $shlibwrap" >&2
+ else
+ echo "No $shlibwrap, perhaps OPENSSL_REGRESSION isn't properly set?" >&2
+ fi
+ exit 1
+ fi
+fi
+
[ $# -ne 0 ] || set -x # debug mode without arguments:-)
THERE="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."
More information about the openssl-commits
mailing list