diff options
author | Ross Burton <ross.burton@arm.com> | 2023-06-08 12:59:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-09 13:55:20 +0100 |
commit | 098df1bd77ac231903194bec556bb7be20496141 (patch) | |
tree | 4f50289b5b1d9ca6987298f6f577707692d5acb8 | |
parent | 5be5b6ee21baa32e35fd9a9d1e093edfa32f1a7f (diff) | |
download | poky-098df1bd77ac231903194bec556bb7be20496141.tar.gz |
nettle: rewrite ptest integration
Instead of patching a relative path to an unversioned libnettle.so to be
a bare filename which then needs nettle-dev to be installed, create a
symlink in the expected place which points to the actual library. This
means nettle-ptest no longer needs to depend on nettle-dev.
Explicitly skip symbols-test, it has been silently failing as nm isn't
available and also needs a static libnettle.a to run.
Install two rsa-* example binaries that are needed for pkcs1-conv-test
to pass.
(From OE-Core rev: dc5cd169e8b9a0f9d9881f116a8d83706460bb7c)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-support/nettle/nettle/dlopen-test.patch | 29 | ||||
-rw-r--r-- | meta/recipes-support/nettle/nettle/run-ptest | 40 | ||||
-rw-r--r-- | meta/recipes-support/nettle/nettle_3.8.1.bb | 21 |
3 files changed, 32 insertions, 58 deletions
diff --git a/meta/recipes-support/nettle/nettle/dlopen-test.patch b/meta/recipes-support/nettle/nettle/dlopen-test.patch deleted file mode 100644 index ab9b91f88b..0000000000 --- a/meta/recipes-support/nettle/nettle/dlopen-test.patch +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | Remove the relative path for libnettle.so so the test | ||
2 | program can find it. | ||
3 | Relative paths are not suitable, as the folder strucure for ptest | ||
4 | is different from the one expected by the nettle testsuite. | ||
5 | |||
6 | Upstream-Status: Inappropriate [embedded specific] | ||
7 | |||
8 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
9 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
10 | --- | ||
11 | testsuite/dlopen-test.c | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c | ||
15 | index 4265bf7..1a25d17 100644 | ||
16 | --- a/testsuite/dlopen-test.c | ||
17 | +++ b/testsuite/dlopen-test.c | ||
18 | @@ -15,7 +15,7 @@ int | ||
19 | main (int argc UNUSED, char **argv UNUSED) | ||
20 | { | ||
21 | #if HAVE_LIBDL | ||
22 | - void *handle = dlopen ("../libnettle." SO_EXT, RTLD_NOW); | ||
23 | + void *handle = dlopen ("libnettle.so", RTLD_NOW); | ||
24 | int (*get_version)(void); | ||
25 | if (!handle) | ||
26 | { | ||
27 | -- | ||
28 | 2.17.1 | ||
29 | |||
diff --git a/meta/recipes-support/nettle/nettle/run-ptest b/meta/recipes-support/nettle/nettle/run-ptest index b90bed66d2..61a43c78f1 100644 --- a/meta/recipes-support/nettle/nettle/run-ptest +++ b/meta/recipes-support/nettle/nettle/run-ptest | |||
@@ -6,31 +6,35 @@ failed=0 | |||
6 | all=0 | 6 | all=0 |
7 | 7 | ||
8 | for f in *-test; do | 8 | for f in *-test; do |
9 | if [ "$f" = "sha1-huge-test" ] ; then | 9 | case "$f" in |
10 | echo "SKIP: $f (skipped for ludicrous run time)" | 10 | "sha1-huge-test") |
11 | continue | 11 | echo "SKIP: $f (long run time)" |
12 | fi | ||
13 | |||
14 | "./$f" | ||
15 | case "$?" in | ||
16 | 0) | ||
17 | echo "PASS: $f" | ||
18 | all=$((all + 1)) | ||
19 | ;; | 12 | ;; |
20 | 77) | 13 | "symbols-test") |
21 | echo "SKIP: $f" | 14 | echo "SKIP: $f (needs static libraries)" |
22 | ;; | 15 | ;; |
23 | *) | 16 | *) |
24 | echo "FAIL: $f" | 17 | "./$f" |
25 | failed=$((failed + 1)) | 18 | case "$?" in |
26 | all=$((all + 1)) | 19 | 0) |
20 | echo "PASS: $f" | ||
21 | all=$((all + 1)) | ||
22 | ;; | ||
23 | 77) | ||
24 | echo "SKIP: $f" | ||
25 | ;; | ||
26 | *) | ||
27 | echo "FAIL: $f" | ||
28 | failed=$((failed + 1)) | ||
29 | all=$((all + 1)) | ||
30 | ;; | ||
31 | esac | ||
27 | ;; | 32 | ;; |
28 | esac | 33 | esac |
29 | done | 34 | done |
30 | 35 | ||
31 | if [ "$failed" -eq 0 ] ; then | 36 | if [ "$failed" -eq 0 ] ; then |
32 | echo "All $all tests passed" | 37 | echo "All $all tests passed" |
33 | else | 38 | else |
34 | echo "$failed of $all tests failed" | 39 | echo "$failed of $all tests failed" |
35 | fi | 40 | fi |
36 | |||
diff --git a/meta/recipes-support/nettle/nettle_3.8.1.bb b/meta/recipes-support/nettle/nettle_3.8.1.bb index bf49132235..184023e403 100644 --- a/meta/recipes-support/nettle/nettle_3.8.1.bb +++ b/meta/recipes-support/nettle/nettle_3.8.1.bb | |||
@@ -20,10 +20,6 @@ SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ | |||
20 | file://check-header-files-of-openssl-only-if-enable_.patch \ | 20 | file://check-header-files-of-openssl-only-if-enable_.patch \ |
21 | " | 21 | " |
22 | 22 | ||
23 | SRC_URI:append:class-target = "\ | ||
24 | file://dlopen-test.patch \ | ||
25 | " | ||
26 | |||
27 | SRC_URI[sha256sum] = "364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe" | 23 | SRC_URI[sha256sum] = "364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe" |
28 | 24 | ||
29 | UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar" | 25 | UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar" |
@@ -44,14 +40,17 @@ do_install:append() { | |||
44 | 40 | ||
45 | do_install_ptest() { | 41 | do_install_ptest() { |
46 | install -d ${D}${PTEST_PATH}/testsuite/ | 42 | install -d ${D}${PTEST_PATH}/testsuite/ |
47 | install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/ | ||
48 | install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ | ||
49 | # tools can be found in PATH, not in ../tools/ | ||
50 | sed -i -e 's|../tools/||' ${D}${PTEST_PATH}/testsuite/*-test | ||
51 | install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ | 43 | install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ |
52 | } | 44 | install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ |
45 | install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/ | ||
53 | 46 | ||
54 | RDEPENDS:${PN}-ptest += "${PN}-dev" | 47 | # Install a symlink for dlopen-test |
55 | INSANE_SKIP:${PN}-ptest += "dev-deps" | 48 | ln -sr ${D}${libdir}/libnettle.so.*.* ${D}${PTEST_PATH}/libnettle.so |
49 | # These examples are needed for pkcs1-conv-test | ||
50 | install ${B}/examples/rsa-sign ${B}/examples/rsa-verify ${D}${PTEST_PATH}/testsuite/ | ||
51 | # Fix build-time relative paths | ||
52 | sed -i -e 's|../tools/|${bindir}/|g' ${D}${PTEST_PATH}/testsuite/*-test | ||
53 | sed -i -e 's|../examples/|./|g' ${D}${PTEST_PATH}/testsuite/*-test | ||
54 | } | ||
56 | 55 | ||
57 | BBCLASSEXTEND = "native nativesdk" | 56 | BBCLASSEXTEND = "native nativesdk" |