diff options
| -rw-r--r-- | recipes-compliance/scap-security-guide/files/run-ptest | 7 | ||||
| -rw-r--r-- | recipes-compliance/scap-security-guide/scap-security-guide_0.1.77.bb | 52 |
2 files changed, 1 insertions, 58 deletions
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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | export PYTHONPATH="/usr/lib/scap-security-guide/ptest/git:$PYTHONPATH" | ||
| 4 | |||
| 5 | cd git/build | ||
| 6 | |||
| 7 | 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" | |||
| 9 | SRCREV = "c1e1ba121d32b3c319b0e25ee2993b62386e5857" | 9 | SRCREV = "c1e1ba121d32b3c319b0e25ee2993b62386e5857" |
| 10 | SRC_URI = "git://github.com/ComplianceAsCode/content.git;nobranch=1;protocol=https \ | 10 | SRC_URI = "git://github.com/ComplianceAsCode/content.git;nobranch=1;protocol=https \ |
| 11 | file://run_eval.sh \ | 11 | file://run_eval.sh \ |
| 12 | file://run-ptest \ | ||
| 13 | " | 12 | " |
| 14 | 13 | ||
| 15 | 14 | ||
| @@ -17,7 +16,7 @@ DEPENDS = "openscap-native python3-pyyaml-native python3-jinja2-native libxml2-n | |||
| 17 | 16 | ||
| 18 | B = "${S}/build" | 17 | B = "${S}/build" |
| 19 | 18 | ||
| 20 | inherit cmake pkgconfig python3native python3targetconfig ptest | 19 | inherit cmake pkgconfig python3native python3targetconfig |
| 21 | 20 | ||
| 22 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" | 21 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" |
| 23 | export OSCAP_CPE_PATH = "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe" | 22 | export OSCAP_CPE_PATH = "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe" |
| @@ -40,57 +39,8 @@ do_install:append() { | |||
| 40 | install ${UNPACKDIR}/run_eval.sh ${D}${datadir}/openscap/. | 39 | install ${UNPACKDIR}/run_eval.sh ${D}${datadir}/openscap/. |
| 41 | } | 40 | } |
| 42 | 41 | ||
| 43 | do_compile_ptest() { | ||
| 44 | cd ${S}/build | ||
| 45 | cmake ../ | ||
| 46 | make | ||
| 47 | } | ||
| 48 | |||
| 49 | do_install_ptest() { | ||
| 50 | |||
| 51 | # remove host & work dir from tests | ||
| 52 | for x in $(find ${S}/build -type f) ; | ||
| 53 | do | ||
| 54 | sed -e 's#${HOSTTOOLS_DIR}/##g' \ | ||
| 55 | -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ | ||
| 56 | -e 's#${UNPACKDIR}#${PTEST_PATH}#g' \ | ||
| 57 | -e 's#/.*/xmllint#/usr/bin/xmllint#g' \ | ||
| 58 | -e 's#/.*/oscap#/usr/bin/oscap#g' \ | ||
| 59 | -e 's#/python3-native##g' \ | ||
| 60 | -i ${x} | ||
| 61 | done | ||
| 62 | |||
| 63 | for x in $(find ${S}/build-scripts -type f) ; | ||
| 64 | do | ||
| 65 | sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x} | ||
| 66 | done | ||
| 67 | |||
| 68 | for x in $(find ${S}/tests -type f) ; | ||
| 69 | do | ||
| 70 | sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x} | ||
| 71 | done | ||
| 72 | |||
| 73 | for x in $(find ${S}/utils -type f) ; | ||
| 74 | do | ||
| 75 | sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' ${x} | ||
| 76 | done | ||
| 77 | |||
| 78 | PDIRS="apple_os build controls products shared components applications linux_os ocp-resources tests utils ssg build-scripts" | ||
| 79 | t=${D}/${PTEST_PATH}/git | ||
| 80 | for d in ${PDIRS}; do | ||
| 81 | install -d ${t}/$d | ||
| 82 | cp -fr ${S}/$d/* ${t}/$d/. | ||
| 83 | done | ||
| 84 | |||
| 85 | # Remove __pycache__ directories as they contain references to TMPDIR | ||
| 86 | for pycachedir in $(find ${D}/${PTEST_PATH} -name __pycache__); do | ||
| 87 | rm -rf $pycachedir | ||
| 88 | done | ||
| 89 | } | ||
| 90 | |||
| 91 | FILES:${PN} += "${datadir}/xml ${datadir}/openscap" | 42 | FILES:${PN} += "${datadir}/xml ${datadir}/openscap" |
| 92 | 43 | ||
| 93 | RDEPENDS:${PN} = "openscap" | 44 | RDEPENDS:${PN} = "openscap" |
| 94 | RDEPENDS:${PN}-ptest = "cmake grep sed bash git python3 python3-modules python3-pyyaml python3-pytest libxml2-utils libxslt-bin" | ||
| 95 | 45 | ||
| 96 | COMPATIBLE_HOST:libc-musl = "null" | 46 | COMPATIBLE_HOST:libc-musl = "null" |
