]> code.ossystems Code Review - openembedded-core.git/commitdiff
findutils: add ptest
authorOleh Matiusha <oleh.matiusha@globallogic.com>
Wed, 8 Sep 2021 17:17:54 +0000 (20:17 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Oct 2021 17:41:02 +0000 (18:41 +0100)
Placed it in PTESTS_SLOW since it takes 36s to execute this ptest on qemu.

Signed-off-by: Oleh Matiusha <oleh.matiusha@globallogic.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-extended/findutils/findutils.inc
meta/recipes-extended/findutils/findutils/run-ptest [new file with mode: 0644]
meta/recipes-extended/findutils/findutils_4.8.0.bb

index 3709998f292c2a99c531821cd75c0cc92cc3cb79..2e324f8da4cf7dcc92e90660a467106bf8990e63 100644 (file)
@@ -72,6 +72,7 @@ PTESTS_SLOW = "\
     coreutils-ptest \
     dbus-test-ptest \
     e2fsprogs-ptest \
+    findutils-ptest \
     glib-2.0-ptest \
     gstreamer1.0-ptest \
     libevent-ptest \
index ea8a1b7afec3a261e8d2e3028205efc1ec3d5620..ddcc05750b85eff7700eef8c0a42419ae044e87d 100644 (file)
@@ -6,9 +6,11 @@ HOMEPAGE = "http://www.gnu.org/software/findutils/"
 BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
 SECTION = "console/utils"
 
-SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.xz"
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.xz \
+          file://run-ptest \
+          "
 
-inherit autotools gettext texinfo update-alternatives
+inherit autotools gettext texinfo update-alternatives ptest
 
 ALTERNATIVE:${PN} = "find xargs"
 ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-extended/findutils/findutils/run-ptest b/meta/recipes-extended/findutils/findutils/run-ptest
new file mode 100644 (file)
index 0000000..ec71583
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# create temporary symlink to workaround missing oldfind
+ln -s /usr/bin/find /tmp/oldfind
+# make oldfind visible
+export PATH="/tmp:${PATH}"
+
+export built_programs="find xargs locate updatedb"
+
+# this gets substituted by sed during build
+export VERSION="__run_ptest_version__"
+
+# define missing functions for tests/init.sh
+fu_path_prepend_ () {
+       path_prepend_ $@
+}
+
+print_ver_ () {
+       :
+}
+
+skip_if_root_ () {
+       [ $(id -u) = 0 ] && exit 77;
+}
+
+require_root_ () {
+       [ $(id -u) = 0 ] || exit 77;
+}
+
+expensive_ () {
+       :
+}
+
+export -f fu_path_prepend_
+export -f print_ver_
+export -f skip_if_root_
+export -f require_root_
+export -f expensive_
+
+
+for f in tests/*/*.sh; do
+       bash $f ;
+       case $? in
+               0 )
+                       echo -n "PASS";;
+               77 )
+                       echo -n "SKIP";;
+               * )
+                       echo -n "FAIL";;
+       esac
+       echo ": $f"
+done
+
+#remove symlink
+rm -f /tmp/oldfind
+
+echo
index d8ccf4b8e1b9848e091dec212805095b0d80f191..b0e56da159588edbc1e6f65cd49a6b313fa52389 100644 (file)
@@ -13,3 +13,14 @@ PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
 CACHED_CONFIGUREVARS += "gl_cv_func_wcwidth_works=yes"
 
 EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
+
+RDEPENDS:${PN}-ptest += "bash sed grep"
+
+do_install_ptest:class-target() {
+       mkdir -p ${D}${PTEST_PATH}/tests/
+       cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/
+
+       # substitute value in run-ptest with actual version
+       sed -i -e 's/__run_ptest_version__/${PV}/' ${D}${PTEST_PATH}/run-ptest
+
+}