summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity
diff options
context:
space:
mode:
authorStefan Sicleru <stefan.sicleru@enea.com>2016-02-03 11:33:12 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2016-02-05 09:51:50 +0100
commit0c287b4f7a8356e34f683b3112068afa698fe69e (patch)
tree90b48ab05ba8a9bd292837330f8a6d53e58a0694 /recipes-connectivity
parent2fbbd79d364274c9cf659c9fe919e460de7aaab0 (diff)
downloadmeta-nfv-access-common-0c287b4f7a8356e34f683b3112068afa698fe69e.tar.gz
openssl: add ptest
This is backported from poky/meta repository. Needed only by FSL's openssl version (found in meta-fsl-ppc layer). Original commit: 8132507f0397877c4d528414c6d34ca61674b6dd on meta-fsl-ppc/dizzy-enea. Signed-off-by: Stefan Sicleru <stefan.sicleru@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'recipes-connectivity')
-rw-r--r--recipes-connectivity/openssl/openssl/Makefiles-ptest.patch75
-rw-r--r--recipes-connectivity/openssl/openssl/ptest-deps.patch30
-rw-r--r--recipes-connectivity/openssl/openssl/run-ptest2
-rw-r--r--recipes-connectivity/openssl/openssl_1.0.1i.bbappend41
4 files changed, 148 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch b/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
new file mode 100644
index 0000000..1795d5a
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
@@ -0,0 +1,75 @@
1Add 'buildtest' and 'runtest' targets to Makefile, to build and run tests
2cross-compiled.
3
4Signed-off-by: Anders Roxell <anders.roxell@enea.com>
5Signed-off-by: Maxin B. John <maxin.john@enea.com>
6Upstream-Status: Pending
7---
8diff -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:
29diff --git a/test/Makefile b/test/Makefile
30index 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/recipes-connectivity/openssl/openssl/ptest-deps.patch b/recipes-connectivity/openssl/openssl/ptest-deps.patch
new file mode 100644
index 0000000..d207dee
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl/ptest-deps.patch
@@ -0,0 +1,30 @@
1Remove Makefile dependencies for test targets
2
3These are probably here because the executables aren't always built for
4other platforms (e.g. Windows); however we can safely assume they'll
5always be there. None of the other test targets have such dependencies
6and if we don't remove them, make tries to rebuild the executables and
7fails during run-ptest.
8
9Upstream-Status: Inappropriate [config]
10
11Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
12
13diff --git a/test/Makefile b/test/Makefile
14index e6fcfb4..5ae043b 100644
15--- a/test/Makefile
16+++ b/test/Makefile
17@@ -322,11 +322,11 @@ test_cms:
18 @echo "CMS consistency test"
19 $(PERL) cms-test.pl
20
21-test_srp: $(SRPTEST)$(EXE_EXT)
22+test_srp:
23 @echo "Test SRP"
24 ../util/shlib_wrap.sh ./srptest
25
26-test_heartbeat: $(HEARTBEATTEST)$(EXE_EXT)
27+test_heartbeat:
28 ../util/shlib_wrap.sh ./$(HEARTBEATTEST)
29
30 lint:
diff --git a/recipes-connectivity/openssl/openssl/run-ptest b/recipes-connectivity/openssl/openssl/run-ptest
new file mode 100644
index 0000000..3b20fce
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2make -k runtest
diff --git a/recipes-connectivity/openssl/openssl_1.0.1i.bbappend b/recipes-connectivity/openssl/openssl_1.0.1i.bbappend
new file mode 100644
index 0000000..a13f6c3
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl_1.0.1i.bbappend
@@ -0,0 +1,41 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI += "file://Makefiles-ptest.patch \
4 file://ptest-deps.patch \
5 file://run-ptest \
6 "
7
8DEPENDS_append_class-target = " openssl-native"
9
10inherit ptest
11
12RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
13
14do_compile_prepend_class-target () {
15 sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
16}
17
18do_compile_ptest () {
19 oe_runmake buildtest
20}
21
22do_install_ptest () {
23 cp -r Makefile test ${D}${PTEST_PATH}
24 cp -r certs ${D}${PTEST_PATH}
25 mkdir -p ${D}${PTEST_PATH}/apps
26 ln -sf /usr/lib/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
27 ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
28 ln -sf /usr/bin/openssl ${D}${PTEST_PATH}/apps
29 cp apps/server2.pem ${D}${PTEST_PATH}/apps
30 mkdir -p ${D}${PTEST_PATH}/util
31 install util/opensslwrap.sh ${D}${PTEST_PATH}/util
32 install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
33}
34
35do_install_append_virtclass-native() {
36 create_wrapper ${D}${bindir}/openssl \
37 OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
38 SSL_CERT_DIR=${libdir}/ssl/certs \
39 SSL_CERT_FILE=${libdir}/ssl/cert.pem \
40 OPENSSL_ENGINES=${libdir}/ssl/engines
41}