diff mbox series

[meta-security,2/4] scap-security-guide: disable ptest

Message ID ee5f84c7c5eb1ee97edbe6cdcf25a0336a672be6.1752846514.git.scott.murray@konsulko.com
State New
Headers show
Series master-next updates | expand

Commit Message

Scott Murray July 18, 2025, 2:10 p.m. UTC
From: Yi Zhao <yi.zhao@eng.windriver.com>

Enabling ptest will significantly increase build time. Additionally,
since the ptest distro_feature is enabled by default in poky distro,
build time can be very long, which is annoying.

On my build host:
Enable ptest:
$ time build scap-security-guide
real    219m54.529s
user    0m49.040s
sys     0m1.304s

Disable ptest:
$ time build scap-security-guide
real    1m25.222s
user    0m3.306s
sys     0m0.166s

Since no one cares about this ptest and no one fixes the test failures.
Let's disable it.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
 .../scap-security-guide/files/run-ptest       |  7 ---
 .../scap-security-guide_0.1.77.bb             | 52 +------------------
 2 files changed, 1 insertion(+), 58 deletions(-)
 delete mode 100644 recipes-compliance/scap-security-guide/files/run-ptest
diff mbox series

Patch

diff --git a/recipes-compliance/scap-security-guide/files/run-ptest b/recipes-compliance/scap-security-guide/files/run-ptest
deleted file mode 100644
index e8d270f..0000000
--- a/recipes-compliance/scap-security-guide/files/run-ptest
+++ /dev/null
@@ -1,7 +0,0 @@ 
-#!/bin/sh
-
-export PYTHONPATH="/usr/lib/scap-security-guide/ptest/git:$PYTHONPATH"
-
-cd git/build
-
-ctest --output-on-failure -E unique-stigids
diff --git a/recipes-compliance/scap-security-guide/scap-security-guide_0.1.77.bb b/recipes-compliance/scap-security-guide/scap-security-guide_0.1.77.bb
index a082a70..cdd22a5 100644
--- a/recipes-compliance/scap-security-guide/scap-security-guide_0.1.77.bb
+++ b/recipes-compliance/scap-security-guide/scap-security-guide_0.1.77.bb
@@ -9,7 +9,6 @@  LICENSE = "BSD-3-Clause"
 SRCREV = "c1e1ba121d32b3c319b0e25ee2993b62386e5857"
 SRC_URI = "git://github.com/ComplianceAsCode/content.git;nobranch=1;protocol=https \
            file://run_eval.sh \
-           file://run-ptest \
            "
 
 
@@ -17,7 +16,7 @@  DEPENDS = "openscap-native python3-pyyaml-native python3-jinja2-native libxml2-n
 
 B = "${S}/build"
 
-inherit cmake pkgconfig python3native python3targetconfig ptest
+inherit cmake pkgconfig python3native python3targetconfig
 
 STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
 export OSCAP_CPE_PATH = "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe"
@@ -40,57 +39,8 @@  do_install:append() {
     install  ${UNPACKDIR}/run_eval.sh ${D}${datadir}/openscap/.
 }
 
-do_compile_ptest() {
-    cd ${S}/build
-    cmake ../
-    make 
-}
-
-do_install_ptest() {
-
-    # remove host & work dir from tests
-    for x in $(find ${S}/build -type f) ;
-    do
-       sed -e 's#${HOSTTOOLS_DIR}/##g' \
-           -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
-           -e 's#${UNPACKDIR}#${PTEST_PATH}#g' \
-           -e 's#/.*/xmllint#/usr/bin/xmllint#g' \
-           -e 's#/.*/oscap#/usr/bin/oscap#g' \
-           -e 's#/python3-native##g' \
-           -i ${x}
-    done
-
-    for x in $(find ${S}/build-scripts -type f) ;
-    do
-       sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x}
-    done
-
-    for x in $(find ${S}/tests -type f) ;
-    do
-       sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x}
-    done
-
-    for x in $(find ${S}/utils -type f) ;
-    do
-       sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x}
-    done
-
-    PDIRS="apple_os build controls products shared components applications linux_os ocp-resources tests utils ssg build-scripts"
-    t=${D}/${PTEST_PATH}/git
-    for d in ${PDIRS}; do
-        install -d ${t}/$d
-        cp -fr ${S}/$d/* ${t}/$d/.
-    done
-
-    # Remove __pycache__ directories as they contain references to TMPDIR
-    for pycachedir in $(find ${D}/${PTEST_PATH} -name __pycache__); do
-        rm -rf $pycachedir
-    done
-}
-
 FILES:${PN} += "${datadir}/xml ${datadir}/openscap"
 
 RDEPENDS:${PN} = "openscap"
-RDEPENDS:${PN}-ptest = "cmake grep sed bash git python3 python3-modules python3-pyyaml python3-pytest libxml2-utils libxslt-bin"
 
 COMPATIBLE_HOST:libc-musl = "null"