diff options
author | Maxin B. John <maxin.john@enea.com> | 2014-04-24 19:28:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-29 17:20:11 +0100 |
commit | af49e60b1f0dd4c95c602025195343116f7fc01b (patch) | |
tree | 66e11f736138bab6506fcff08696c33b3fcab50b /meta | |
parent | b3c688cf1f219fbd54a3fe867cb3a085d794e61d (diff) | |
download | poky-af49e60b1f0dd4c95c602025195343116f7fc01b.tar.gz |
openssl: enable ptest support
Install openssl test suite and run it as ptest.
(From OE-Core rev: c48981d2d24a20978a17866fa478dde21bd96b91)
Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
4 files changed, 97 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc index 229ec870cd..6c86588c83 100644 --- a/meta/recipes-connectivity/openssl/openssl.inc +++ b/meta/recipes-connectivity/openssl/openssl.inc | |||
@@ -30,7 +30,7 @@ export DIRS = "crypto ssl apps" | |||
30 | export EX_LIBS = "-lgcc -ldl" | 30 | export EX_LIBS = "-lgcc -ldl" |
31 | export AS = "${CC} -c" | 31 | export AS = "${CC} -c" |
32 | 32 | ||
33 | inherit pkgconfig siteinfo multilib_header | 33 | inherit pkgconfig siteinfo multilib_header ptest |
34 | 34 | ||
35 | PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf" | 35 | PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf" |
36 | FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}" | 36 | FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}" |
@@ -47,6 +47,7 @@ FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}" | |||
47 | FILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | 47 | FILES_openssl-conf = "${libdir}/ssl/openssl.cnf" |
48 | CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf" | 48 | CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf" |
49 | RRECOMMENDS_libcrypto += "openssl-conf" | 49 | RRECOMMENDS_libcrypto += "openssl-conf" |
50 | RDEPENDS_${PN}-ptest += "${PN}-misc make" | ||
50 | 51 | ||
51 | do_configure_prepend_darwin () { | 52 | do_configure_prepend_darwin () { |
52 | sed -i -e '/version-script=openssl\.ld/d' Configure | 53 | sed -i -e '/version-script=openssl\.ld/d' Configure |
@@ -140,6 +141,10 @@ do_compile () { | |||
140 | oe_runmake | 141 | oe_runmake |
141 | } | 142 | } |
142 | 143 | ||
144 | do_compile_ptest () { | ||
145 | oe_runmake buildtest | ||
146 | } | ||
147 | |||
143 | do_install () { | 148 | do_install () { |
144 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install | 149 | oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install |
145 | 150 | ||
@@ -169,5 +174,17 @@ do_install () { | |||
169 | fi | 174 | fi |
170 | } | 175 | } |
171 | 176 | ||
177 | do_install_ptest () { | ||
178 | cp -r Makefile test ${D}${PTEST_PATH} | ||
179 | mkdir -p ${D}${PTEST_PATH}/apps | ||
180 | ln -sf /usr/lib/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps | ||
181 | ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps | ||
182 | ln -sf /usr/bin/openssl ${D}${PTEST_PATH}/apps | ||
183 | cp apps/server2.pem ${D}${PTEST_PATH}/apps | ||
184 | mkdir -p ${D}${PTEST_PATH}/util | ||
185 | install util/opensslwrap.sh ${D}${PTEST_PATH}/util | ||
186 | install util/shlib_wrap.sh ${D}${PTEST_PATH}/util | ||
187 | } | ||
188 | |||
172 | BBCLASSEXTEND = "native nativesdk" | 189 | BBCLASSEXTEND = "native nativesdk" |
173 | 190 | ||
diff --git a/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch b/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch new file mode 100644 index 0000000000..ac53a9142b --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Add 'buildtest' and 'runtest' targets to Makefile, to build and run tests | ||
2 | cross-compiled. | ||
3 | |||
4 | Signed-off-by: Anders Roxell <anders.roxell@enea.com> | ||
5 | Signed-off-by: Maxin B. John <maxin.john@enea.com> | ||
6 | Upstream-Status: Pending | ||
7 | --- | ||
8 | diff -uNr a/Makefile b/Makefile | ||
9 | --- a/Makefile.org 2012-05-10 17:06:02.000000000 +0200 | ||
10 | +++ b/Makefile.org 2012-10-27 00:05:55.359424024 +0200 | ||
11 | @@ -411,8 +411,16 @@ | ||
12 | test: tests | ||
13 | |||
14 | tests: rehash | ||
15 | + $(MAKE) buildtest | ||
16 | + $(MAKE) runtest | ||
17 | + | ||
18 | +buildtest: | ||
19 | + @(cd test && \ | ||
20 | + $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf exe apps); | ||
21 | + | ||
22 | +runtest: | ||
23 | @(cd test && echo "testing..." && \ | ||
24 | - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests ); | ||
25 | + $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf alltests ); | ||
26 | OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a | ||
27 | |||
28 | report: | ||
29 | diff --git a/test/Makefile b/test/Makefile | ||
30 | index 3912f82..1696767 100644 | ||
31 | --- a/test/Makefile | ||
32 | +++ b/test/Makefile | ||
33 | @@ -128,7 +128,7 @@ tests: exe apps $(TESTS) | ||
34 | apps: | ||
35 | @(cd ..; $(MAKE) DIRS=apps all) | ||
36 | |||
37 | -alltests: \ | ||
38 | +all-tests= \ | ||
39 | test_des test_idea test_sha test_md4 test_md5 test_hmac \ | ||
40 | test_md2 test_mdc2 test_wp \ | ||
41 | test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \ | ||
42 | @@ -138,6 +138,11 @@ alltests: \ | ||
43 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ | ||
44 | test_jpake test_cms | ||
45 | |||
46 | +alltests: | ||
47 | + @(for i in $(all-tests); do \ | ||
48 | + ( $(MAKE) $$i && echo "PASS: $$i" ) || echo "FAIL: $$i"; \ | ||
49 | + done) | ||
50 | + | ||
51 | test_evp: | ||
52 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt | ||
53 | |||
54 | @@ -203,7 +208,7 @@ test_x509: | ||
55 | echo test second x509v3 certificate | ||
56 | sh ./tx509 v3-cert2.pem 2>/dev/null | ||
57 | |||
58 | -test_rsa: $(RSATEST)$(EXE_EXT) | ||
59 | +test_rsa: | ||
60 | @sh ./trsa 2>/dev/null | ||
61 | ../util/shlib_wrap.sh ./$(RSATEST) | ||
62 | |||
63 | @@ -298,11 +303,11 @@ test_tsa: | ||
64 | sh ./testtsa; \ | ||
65 | fi | ||
66 | |||
67 | -test_ige: $(IGETEST)$(EXE_EXT) | ||
68 | +test_ige: | ||
69 | @echo "Test IGE mode" | ||
70 | ../util/shlib_wrap.sh ./$(IGETEST) | ||
71 | |||
72 | -test_jpake: $(JPAKETEST)$(EXE_EXT) | ||
73 | +test_jpake: | ||
74 | @echo "Test JPAKE" | ||
75 | ../util/shlib_wrap.sh ./$(JPAKETEST) | ||
diff --git a/meta/recipes-connectivity/openssl/openssl/run-ptest b/meta/recipes-connectivity/openssl/openssl/run-ptest new file mode 100755 index 0000000000..3b20fce1ee --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/run-ptest | |||
@@ -0,0 +1,2 @@ | |||
1 | #!/bin/sh | ||
2 | make -k runtest | ||
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.1g.bb b/meta/recipes-connectivity/openssl/openssl_1.0.1g.bb index f3c20e8c97..5ca29d007b 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.1g.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.1g.bb | |||
@@ -34,6 +34,8 @@ SRC_URI += "file://configure-targets.patch \ | |||
34 | file://initial-aarch64-bits.patch \ | 34 | file://initial-aarch64-bits.patch \ |
35 | file://find.pl \ | 35 | file://find.pl \ |
36 | file://openssl-fix-des.pod-error.patch \ | 36 | file://openssl-fix-des.pod-error.patch \ |
37 | file://Makefiles-ptest.patch \ | ||
38 | file://run-ptest \ | ||
37 | " | 39 | " |
38 | 40 | ||
39 | SRC_URI[md5sum] = "de62b43dfcd858e66a74bee1c834e959" | 41 | SRC_URI[md5sum] = "de62b43dfcd858e66a74bee1c834e959" |