Don't define OPENSSL_ENGINES in test recipes, do it in Makefiles instead
authorRichard Levitte <levitte@openssl.org>
Sat, 5 Mar 2016 12:11:37 +0000 (13:11 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 17 Mar 2016 09:10:59 +0000 (10:10 +0100)
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>
13 files changed:
Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
test/Makefile.in
test/recipes/70-test_sslcertstatus.t
test/recipes/70-test_sslextension.t
test/recipes/70-test_sslsessiontick.t
test/recipes/70-test_sslskewith0p.t
test/recipes/70-test_sslvertol.t
test/recipes/70-test_tlsextms.t
test/recipes/90-test_networking.t
util/pl/BC-32.pl
util/pl/VC-32.pl
util/pl/unix.pl

index 294c422f9f800becee065009a888060c0ca65921..512b8e5a0823500f467b714a9f7ea3170337e660 100644 (file)
@@ -224,7 +224,9 @@ test tests : configdata.pm, -
         SET DEFAULT [.test]{- move("test") -}
         DEFINE SRCTOP {- sourcedir() -}
         DEFINE BLDTOP {- builddir() -}
+        DEFINE OPENSSL_ENGINES {- builddir("engines") -}
         $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
+        DEASSIGN OPENSSL_ENGINES
         DEASSIGN BLDTOP
         DEASSIGN SRCTOP
         SET DEFAULT [-]{- move("..") -}
index d781e537dc60c097240af1a27811ec4ae3cad512..3a1ade72b7b94c4f8ce600367fdb4fed21dbafac 100644 (file)
@@ -220,6 +220,7 @@ test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
          SRCTOP=../$(SRCDIR) \
          BLDTOP=../$(BLDDIR) \
          EXE_EXT={- $exeext -} \
+         OPENSSL_ENGINES=../$(BLDDIR)/engines \
            $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
 
 list-tests:
index 313ff6fec2efa2e4b6fe38baaf510493de97228c..be4f0623f51ed9a3150e3b06b344ec6c63f52114 100644 (file)
@@ -160,7 +160,8 @@ $(SRC):
        @sh $(TOP)/util/point.sh dummytest.c $@
 
 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:
 
index 216804ce2b42666698b2c4a94ec1ff469210c21e..37265ed07aa5fbfcbad0e3c60c7f8a159b96fa3c 100755 (executable)
@@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
 plan skip_all => "$test_name needs the dynamic engine feature enabled"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&certstatus_filter,
index f9a6573cc872e0d766997e8cdeb20241079c5ad1..1641daa344988b44d469933db1e190490ee47abc 100755 (executable)
@@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
 plan skip_all => "$test_name needs the dynamic engine feature enabled"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&extension_filter,
index 56ae4c0cba2fb7341fef98e1ac3fa1dad39352ae..caab77745e46d64c87f7584906ee6e0aa953182f 100755 (executable)
@@ -67,7 +67,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
 plan skip_all => "$test_name needs the dynamic engine feature enabled"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 
 sub checkmessages($$$$$$);
index 90fcf3071120a1025306511ca2662427d84236cb..b0cc9ffb59f84ba2cf8783e57e9fc0b2c86c8719 100755 (executable)
@@ -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"
     if disabled("dh");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&ske_0_p_filter,
index d436b5aba7963b98efea1460b729e98d4e69e77d..0795733fb95c9dfe414b532bd8ea4a4ebbf1555c 100755 (executable)
@@ -66,7 +66,6 @@ plan skip_all => "TLSProxy isn't usable on $^O"
 plan skip_all => "$test_name needs the dynamic engine feature enabled"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&vers_tolerance_filter,
index 47a03213c82df9814a14001f026fbb3ae3bb731b..bc3b7878008301c5991a4aa9c4a6be21a24095bc 100644 (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"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 
 sub checkmessages($$$$$);
index 16ece75be059139932c82ec605806173d2f4fcea..5d876ca51c7f33de1937c0c25385787cfc63ec90 100644 (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"
     if disabled("engine") || disabled("dynamic-engine");
 
-$ENV{OPENSSL_ENGINES} = bldtop_dir("engines");
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 
 my $proxy = TLSProxy::Proxy->new(
index ef21b585857cdc05ec33d6f693d46c2fc0e734c2..6d061d3b6805224435adfdf6a2d433a2c7bf0fce 100644 (file)
@@ -110,6 +110,7 @@ $target: $deps force.$target
        set TOP=.
        set BIN_D=\$(BIN_D)
        set TEST_D=\$(TEST_D)
+       set OPENSSL_ENGINES=\$(ENG_D)
        set PERL=\$(PERL)
        \$(PERL) test\\$test_cmd \$(TESTS)
 force.$target:
index 8ed650857eca4a941fe0673fab59c8e5d553c5a2..9c9bee5ce9c3e4aa816a1a4468c31dc5cd2e2e22 100644 (file)
@@ -316,6 +316,7 @@ $target: $deps force.$target
        set TOP=.
        set BIN_D=\$(BIN_D)
        set TEST_D=\$(TEST_D)
+       set OPENSSL_ENGINES=\$(ENG_D)
        set PERL=\$(PERL)
        \$(PERL) test\\$test_cmd \$(TESTS)
 force.$target:
index 6add39a565c428e71de8fe9ddbd4e1c077a7c7ba..8d9f25a4846b84cc21867ff7e8b8015f58cae0fd 100644 (file)
@@ -198,7 +198,7 @@ sub do_test_rule {
     my ($target, $deps, $test_cmd) = @_;
     my $ret = <<"EOF";
 $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)
 force.$target: