Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 1 | SUMMARY = "Linux Test Project" |
| 2 | DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features." |
| 3 | HOMEPAGE = "https://linux-test-project.github.io/" |
| 4 | SECTION = "console/utils" |
| 5 | LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause" |
| 6 | LIC_FILES_CHKSUM = "\ |
| 7 | file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 8 | file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ |
| 9 | file://testcases/network/can/filter-tests/COPYING;md5=5b155ea7d7f86eae8e8832955d8b70bc \ |
| 10 | " |
| 11 | |
| 12 | DEPENDS = "attr libaio libcap acl openssl zip-native" |
| 13 | DEPENDS:append:libc-musl = " fts " |
| 14 | EXTRA_OEMAKE:append:libc-musl = " LIBC=musl " |
| 15 | EXTRA_OECONF:append:libc-musl = " LIBS=-lfts " |
| 16 | |
| 17 | # since ltp contains x86-64 assembler which uses the frame-pointer register, |
| 18 | # set -fomit-frame-pointer x86-64 to handle cases where optimisation |
| 19 | # is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer |
| 20 | # earlier in CFLAGS, etc. |
| 21 | CFLAGS:append:x86-64 = " -fomit-frame-pointer" |
| 22 | |
| 23 | CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__" |
| 24 | CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" |
| 25 | SRCREV = "12beeda351b5d758a729aaf695b836ccc9eb5304" |
| 26 | |
| 27 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ |
| 28 | file://0001-Remove-OOM-tests-from-runtest-mm.patch \ |
| 29 | file://0002-lib-fix-MemAvailable-parsing.patch \ |
| 30 | file://0003-lapi-rtnetlink.h-Fix-include-guards.patch \ |
| 31 | file://0004-lapi-Create-if_addr.h-and-reuse-it-in-rtnetlink.h.patch \ |
| 32 | file://0005-lapi-if_addr.h-Define-IFA_FLAGS.patch \ |
| 33 | " |
| 34 | |
| 35 | S = "${WORKDIR}/git" |
| 36 | |
| 37 | inherit autotools-brokensep pkgconfig |
| 38 | |
| 39 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 40 | |
| 41 | export prefix = "/opt/${PN}" |
| 42 | export exec_prefix = "/opt/${PN}" |
| 43 | |
| 44 | PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," |
| 45 | EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" |
| 46 | EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite " |
| 47 | # ltp network/rpc test cases ftbfs when libtirpc is found |
| 48 | EXTRA_OECONF += " --without-tirpc " |
| 49 | |
| 50 | do_install(){ |
| 51 | install -d ${D}${prefix}/ |
| 52 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install include-install |
| 53 | |
| 54 | # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run |
| 55 | # as it lacks dependency on some perl moudle such as LWP::Simple |
| 56 | # And this script previously works as a tool for analyzing failures from LTP |
| 57 | # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses |
| 58 | # http://khack.osdl.org to retrieve ltp test results run on |
| 59 | # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible |
| 60 | rm -rf ${D}${prefix}/bin/STPfailure_report.pl |
| 61 | |
| 62 | # Copy POSIX test suite into ${D}${prefix}/testcases by manual |
| 63 | cp -r testcases/open_posix_testsuite ${D}${prefix}/testcases |
| 64 | |
| 65 | # Makefile were configured in the build system |
| 66 | find ${D}${prefix} -name Makefile | xargs -n 1 sed -i \ |
| 67 | -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ |
| 68 | -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ |
| 69 | -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ |
| 70 | -e 's@[^ ]*--sysroot=[^ "]*@@g' |
| 71 | |
| 72 | # The controllers memcg_stree test seems to cause us hangs and takes 900s |
| 73 | # (maybe we expect more regular output?), anyhow, skip it |
| 74 | sed -e '/^memcg_stress/d' -i ${D}${prefix}/runtest/controllers |
| 75 | } |
| 76 | |
| 77 | RDEPENDS:${PN} = "\ |
| 78 | attr \ |
| 79 | bash \ |
| 80 | bc \ |
| 81 | coreutils \ |
| 82 | cpio \ |
| 83 | cronie \ |
| 84 | curl \ |
| 85 | e2fsprogs \ |
| 86 | e2fsprogs-mke2fs \ |
| 87 | expect \ |
| 88 | file \ |
| 89 | gawk \ |
| 90 | gdb \ |
| 91 | gzip \ |
| 92 | iproute2 \ |
| 93 | ldd \ |
| 94 | libaio \ |
| 95 | logrotate \ |
| 96 | net-tools \ |
| 97 | perl \ |
| 98 | python3-core \ |
| 99 | procps \ |
| 100 | quota \ |
| 101 | unzip \ |
| 102 | util-linux \ |
| 103 | which \ |
| 104 | tar \ |
| 105 | " |
| 106 | |
| 107 | FILES:${PN} += "${prefix}/* ${prefix}/runtest/* ${prefix}/scenario_groups/* ${prefix}/testcases/bin/* ${prefix}/testcases/bin/*/bin/* ${prefix}/testscripts/* ${prefix}/testcases/open_posix_testsuite/* ${prefix}/testcases/open_posix_testsuite/conformance/* ${prefix}/testcases/open_posix_testsuite/Documentation/* ${prefix}/testcases/open_posix_testsuite/functional/* ${prefix}/testcases/open_posix_testsuite/include/* ${prefix}/testcases/open_posix_testsuite/scripts/* ${prefix}/testcases/open_posix_testsuite/stress/* ${prefix}/testcases/open_posix_testsuite/tools/* ${prefix}/testcases/data/nm01/lib.a ${prefix}/lib/libmem.a" |
| 108 | |
| 109 | # Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail |
| 110 | INHIBIT_PACKAGE_STRIP_FILES = "${prefix}/testcases/bin/nm01 ${prefix}/testcases/bin/ldd01" |
| 111 | INSANE_SKIP:${PN} += "already-stripped staticdev" |
| 112 | |
| 113 | remove_broken_musl_sources() { |
| 114 | [ "${TCLIBC}" = "musl" ] || return 0 |
| 115 | |
| 116 | cd ${S} |
| 117 | echo "WARNING: remove unsupported tests (until they're fixed)" |
| 118 | |
| 119 | # sync with upstream |
| 120 | # https://github.com/linux-test-project/ltp/blob/master/ci/alpine.sh#L33 |
| 121 | rm -rfv \ |
| 122 | testcases/kernel/syscalls/confstr/confstr01.c \ |
| 123 | testcases/kernel/syscalls/fmtmsg/fmtmsg01.c \ |
| 124 | testcases/kernel/syscalls/getcontext/getcontext01.c \ |
| 125 | testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \ |
| 126 | testcases/kernel/syscalls/timer_create/timer_create01.c \ |
| 127 | testcases/kernel/syscalls/timer_create/timer_create03.c \ |
| 128 | utils/benchmark/ebizzy-0.3 |
| 129 | } |
| 130 | do_patch[postfuncs] += "remove_broken_musl_sources" |
| 131 | |
| 132 | # Avoid file dependency scans, as LTP checks for things that may or may not |
| 133 | # exist on the running system. For instance it has specific checks for |
| 134 | # csh and ksh which are not typically part of OpenEmbedded systems (but |
| 135 | # can be added via additional layers.) |
| 136 | SKIP_FILEDEPS:${PN} = '1' |