@@ -149,6 +149,7 @@ PTESTS_SLOW = "\
libpcap \
libpng \
libsoup \
+ libxcrypt \
${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'libseccomp', '',d)} \
lttng-tools \
lz4 \
@@ -173,6 +174,7 @@ PTESTS_SLOW = "\
PTESTS_SLOW:remove:riscv32 = "lttng-tools strace "
PTESTS_PROBLEMS:append:riscv32 = " lttng-tools strace"
PTESTS_SLOW:append:libc-musl = " libc-test"
+PTESTS_SLOW:remove:libc-musl = "libxcrypt"
# These tests don't yet pass for riscv64
PTESTS_SLOW:remove:riscv64 = "tcl python3-cffi lttng-tools python3-numpy perl glib-2.0 zstd libpcap"
@@ -12,6 +12,7 @@ PTESTS = "${PTESTS_SLOW} ${PTESTS_FAST}"
PTEST_RUNNER_TIMEOUT:virtclass-mcextend-python3-cffi = "600"
PTEST_RUNNER_TIMEOUT:virtclass-mcextend-go = "4800"
PTEST_RUNNER_TIMEOUT:virtclass-mcextend-icu = "2400"
+PTEST_RUNNER_TIMEOUT:virtclass-mcextend-libxcrypt = "900"
IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
new file mode 100644
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd "$(dirname "$0")/test" || exit 1
+
+for t in *; do
+ out=$(./"$t" 2>&1)
+ case $? in
+ 0) echo "PASS: $t" ;;
+ 77) echo "SKIP: $t" ;;
+ *) echo "FAIL: $t"; echo "$out" | sed 's/^/ /' ;;
+ esac
+done
@@ -1,2 +1,22 @@
require libxcrypt.inc
+inherit ptest
+
+SRC_URI += "file://run-ptest"
+
+do_compile_ptest() {
+ oe_runmake check TESTS=
+}
+
+LIBXCRYPT_PTEST_SKIP = "test/alg-yescrypt"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/test
+ for t in $(makefile-getvar ${B}/Makefile TESTS); do
+ case " ${LIBXCRYPT_PTEST_SKIP} " in
+ *" $t "*) continue ;;
+ esac
+ ${B}/libtool --mode=install install -m 0755 ${B}/$t ${D}${PTEST_PATH}/test/
+ done
+}
+
Build libxcrypt's upstream test programs and run them under ptest. The test list is taken from the TESTS variable of the build's Makefile, so tests added upstream are picked up without a recipe change. Each test's output is captured and printed only when the test fails, because several tests print their own PASS:/FAIL: lines that would otherwise be counted as extra results. Skip alg-yescrypt. It allocates about 1 GiB for its scrypt known-answer test and 256 MiB for its ROM test, which fail on the 1 GiB ptest image, and it then crashes reading the uninitialised ROM [1]. The suite takes about 7.5 minutes on qemuriscv64, which is over the default 450s timeout, so raise the timeout to 900s and list libxcrypt in PTESTS_SLOW. [1] https://github.com/besser82/libxcrypt/issues/165 Tested with testimage on qemuriscv64: 50 passed, 1 skipped (getrandom-fallbacks), 0 failed. Signed-off-by: Pratik Farkase <pratik.farkase@est.tech> --- Notes: v2: Remove libxcrypt from PTESTS_SLOW on musl, where it is not built because virtual/crypt is provided by musl. .../distro/include/ptest-packagelists.inc | 2 ++ meta/recipes-core/images/core-image-ptest.bb | 1 + meta/recipes-core/libxcrypt/files/run-ptest | 12 +++++++++++ .../recipes-core/libxcrypt/libxcrypt_4.5.2.bb | 20 +++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 meta/recipes-core/libxcrypt/files/run-ptest