]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
nettle: rewrite ptest integration
authorRoss Burton <ross.burton@arm.com>
Thu, 8 Jun 2023 11:59:15 +0000 (12:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Jun 2023 12:53:46 +0000 (13:53 +0100)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/nettle/nettle/dlopen-test.patch [deleted file]
meta/recipes-support/nettle/nettle/run-ptest
meta/recipes-support/nettle/nettle_3.8.1.bb

diff --git a/meta/recipes-support/nettle/nettle/dlopen-test.patch b/meta/recipes-support/nettle/nettle/dlopen-test.patch
deleted file mode 100644 (file)
index ab9b91f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Remove the relative path for libnettle.so so the test
-program can find it.
-Relative paths are not suitable, as the folder strucure for ptest
-is different from the one expected by the nettle testsuite.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
-Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
----
- testsuite/dlopen-test.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
-index 4265bf7..1a25d17 100644
---- a/testsuite/dlopen-test.c
-+++ b/testsuite/dlopen-test.c
-@@ -15,7 +15,7 @@ int
- main (int argc UNUSED, char **argv UNUSED)
- {
- #if HAVE_LIBDL
--  void *handle = dlopen ("../libnettle." SO_EXT, RTLD_NOW);
-+  void *handle = dlopen ("libnettle.so", RTLD_NOW);
-   int (*get_version)(void);
-   if (!handle)
-     {
--- 
-2.17.1
-
index b90bed66d270b6d172b7ed219b027bf8434d8a23..61a43c78f12dddbf8047ee899377f7819d836c32 100644 (file)
@@ -6,31 +6,35 @@ failed=0
 all=0
 
 for f in *-test; do
-    if [ "$f" = "sha1-huge-test" ] ; then
-        echo "SKIP: $f (skipped for ludicrous run time)"
-        continue
-    fi
-
-    "./$f"
-    case "$?" in
-        0)
-            echo "PASS: $f"
-            all=$((all + 1))
+    case "$f" in
+        "sha1-huge-test")
+            echo "SKIP: $f (long run time)"
             ;;
-        77)
-            echo "SKIP: $f"
+        "symbols-test")
+            echo "SKIP: $f (needs static libraries)"
             ;;
         *)
-            echo "FAIL: $f"
-            failed=$((failed + 1))
-            all=$((all + 1))
+            "./$f"
+            case "$?" in
+                0)
+                    echo "PASS: $f"
+                    all=$((all + 1))
+                    ;;
+                77)
+                    echo "SKIP: $f"
+                    ;;
+                *)
+                    echo "FAIL: $f"
+                    failed=$((failed + 1))
+                    all=$((all + 1))
+                    ;;
+            esac
             ;;
     esac
 done
 
 if [ "$failed" -eq 0 ] ; then
-  echo "All $all tests passed"
+    echo "All $all tests passed"
 else
-  echo "$failed of $all tests failed"
+    echo "$failed of $all tests failed"
 fi
-
index bf4913223548953bb8199a313c40bb9af2aebee8..184023e40310d34bca4b616e9b3fde26cfdd8d8c 100644 (file)
@@ -20,10 +20,6 @@ SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
            file://check-header-files-of-openssl-only-if-enable_.patch \
            "
 
-SRC_URI:append:class-target = "\
-            file://dlopen-test.patch \
-            "
-
 SRC_URI[sha256sum] = "364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe"
 
 UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar"
@@ -44,14 +40,17 @@ do_install:append() {
 
 do_install_ptest() {
         install -d ${D}${PTEST_PATH}/testsuite/
-        install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/
-        install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
-        # tools can be found in PATH, not in ../tools/
-        sed -i -e 's|../tools/||' ${D}${PTEST_PATH}/testsuite/*-test
         install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
-}
+        install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
+        install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/
 
-RDEPENDS:${PN}-ptest += "${PN}-dev"
-INSANE_SKIP:${PN}-ptest += "dev-deps"
+        # Install a symlink for dlopen-test
+        ln -sr ${D}${libdir}/libnettle.so.*.* ${D}${PTEST_PATH}/libnettle.so
+        # These examples are needed for pkcs1-conv-test
+        install ${B}/examples/rsa-sign ${B}/examples/rsa-verify ${D}${PTEST_PATH}/testsuite/
+        # Fix build-time relative paths
+        sed -i -e 's|../tools/|${bindir}/|g' ${D}${PTEST_PATH}/testsuite/*-test
+        sed -i -e 's|../examples/|./|g' ${D}${PTEST_PATH}/testsuite/*-test
+}
 
 BBCLASSEXTEND = "native nativesdk"