Don't define OPENSSL_ENGINES in test recipes, do it in Makefiles instead

In most builds, we can assume that engines live in the build tree
subdirectory "engines".  This was hard coded into the tests that use
the engine ossltest.

However, that hard coding is tedious, it would need to be done in
every test recipe, and it's an incorrect assumption in some cases.

This change has us play it safe and let the build files tell the
testing framework where the engines are.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
This commit is contained in:
Richard Levitte 2016-03-05 13:11:37 +01:00
parent 909289dfc3
commit a717738b45
13 changed files with 8 additions and 9 deletions

View File

@ -224,7 +224,9 @@ test tests : configdata.pm, -
SET DEFAULT [.test]{- move("test") -} SET DEFAULT [.test]{- move("test") -}
DEFINE SRCTOP {- sourcedir() -} DEFINE SRCTOP {- sourcedir() -}
DEFINE BLDTOP {- builddir() -} DEFINE BLDTOP {- builddir() -}
DEFINE OPENSSL_ENGINES {- builddir("engines") -}
$(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS) $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
DEASSIGN OPENSSL_ENGINES
DEASSIGN BLDTOP DEASSIGN BLDTOP
DEASSIGN SRCTOP DEASSIGN SRCTOP
SET DEFAULT [-]{- move("..") -} SET DEFAULT [-]{- move("..") -}

View File

@ -220,6 +220,7 @@ test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
SRCTOP=../$(SRCDIR) \ SRCTOP=../$(SRCDIR) \
BLDTOP=../$(BLDDIR) \ BLDTOP=../$(BLDDIR) \
EXE_EXT={- $exeext -} \ EXE_EXT={- $exeext -} \
OPENSSL_ENGINES=../$(BLDDIR)/engines \
$(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) ) $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
list-tests: list-tests:

View File

@ -160,7 +160,8 @@ $(SRC):
@sh $(TOP)/util/point.sh dummytest.c $@ @sh $(TOP)/util/point.sh dummytest.c $@
tests: exe apps tests: exe apps
TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl $(TESTS) OPENSSL_ENGINES=../engines TOP=$(TOP) PERL=$(PERL) \
$(PERL) run_tests.pl $(TESTS)
errors: errors:

View File

@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(
\&certstatus_filter, \&certstatus_filter,

View File

@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(
\&extension_filter, \&extension_filter,

View File

@ -67,7 +67,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
sub checkmessages($$$$$$); sub checkmessages($$$$$$);

View File

@ -69,7 +69,6 @@ plan skip_all => "$test_name needs the dynamic engine feature enabled"
plan skip_all => "dh is not supported by this OpenSSL build" plan skip_all => "dh is not supported by this OpenSSL build"
if disabled("dh"); if disabled("dh");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(
\&ske_0_p_filter, \&ske_0_p_filter,

View File

@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(
\&vers_tolerance_filter, \&vers_tolerance_filter,

View File

@ -67,7 +67,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
sub checkmessages($$$$$); sub checkmessages($$$$$);

View File

@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the dynamic engine feature enabled"
if disabled("engine") || disabled("dynamic-engine"); if disabled("engine") || disabled("dynamic-engine");
$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000'; $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
my $proxy = TLSProxy::Proxy->new( my $proxy = TLSProxy::Proxy->new(

View File

@ -110,6 +110,7 @@ $target: $deps force.$target
set TOP=. set TOP=.
set BIN_D=\$(BIN_D) set BIN_D=\$(BIN_D)
set TEST_D=\$(TEST_D) set TEST_D=\$(TEST_D)
set OPENSSL_ENGINES=\$(ENG_D)
set PERL=\$(PERL) set PERL=\$(PERL)
\$(PERL) test\\$test_cmd \$(TESTS) \$(PERL) test\\$test_cmd \$(TESTS)
force.$target: force.$target:

View File

@ -316,6 +316,7 @@ $target: $deps force.$target
set TOP=. set TOP=.
set BIN_D=\$(BIN_D) set BIN_D=\$(BIN_D)
set TEST_D=\$(TEST_D) set TEST_D=\$(TEST_D)
set OPENSSL_ENGINES=\$(ENG_D)
set PERL=\$(PERL) set PERL=\$(PERL)
\$(PERL) test\\$test_cmd \$(TESTS) \$(PERL) test\\$test_cmd \$(TESTS)
force.$target: force.$target:

View File

@ -198,7 +198,7 @@ sub do_test_rule {
my ($target, $deps, $test_cmd) = @_; my ($target, $deps, $test_cmd) = @_;
my $ret = <<"EOF"; my $ret = <<"EOF";
$target: $deps force.$target $target: $deps force.$target
TOP=. BIN_D=\$(BIN_D) TEST_D=\$(TEST_D) \\ TOP=. BIN_D=\$(BIN_D) TEST_D=\$(TEST_D) OPENSSL_ENGINES=$(ENG_D) \\
PERL=\$(PERL) \$(PERL) test/$test_cmd \$(TESTS) PERL=\$(PERL) \$(PERL) test/$test_cmd \$(TESTS)
force.$target: force.$target: