diff options
author | 2021-08-11 14:02:29 -0400 | |
---|---|---|
committer | 2021-08-11 14:02:29 -0400 | |
commit | 16e67b51511f6ad9cdffa1f1bf9ec3b109dd645c (patch) | |
tree | 9b3d714b0912335337ece5301f5a2075b18bb61a /sys-fs/udev | |
parent | app-crypt/yubioath-desktop: add self as co-maintainer (diff) | |
download | gentoo-16e67b51511f6ad9cdffa1f1bf9ec3b109dd645c.tar.gz gentoo-16e67b51511f6ad9cdffa1f1bf9ec3b109dd645c.tar.bz2 gentoo-16e67b51511f6ad9cdffa1f1bf9ec3b109dd645c.zip |
sys-fs/udev: check if /dev is writable before running tests
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-fs/udev')
-rw-r--r-- | sys-fs/udev/udev-249-r2.ebuild | 28 | ||||
-rw-r--r-- | sys-fs/udev/udev-9999.ebuild | 28 |
2 files changed, 26 insertions, 30 deletions
diff --git a/sys-fs/udev/udev-249-r2.ebuild b/sys-fs/udev/udev-249-r2.ebuild index a77771e66f71..08a32a5d3c7b 100644 --- a/sys-fs/udev/udev-249-r2.ebuild +++ b/sys-fs/udev/udev-249-r2.ebuild @@ -198,32 +198,30 @@ multilib_src_compile() { eninja "${targets[@]}" } -multilib_src_test() { +src_test() { # The testsuite is *very* finicky. Don't try running it in # containers or anything but a full VM or on bare metal. # udev calls 'mknod' a number of times, and this interacts # badly with kernel namespaces. - if [[ ${EUID} -ne 0 ]]; then - ewarn "udev tests need to run under uid 0" - ewarn "Skipping tests" - elif has sandbox ${FEATURES}; then - ewarn "\'FEATURES=sandbox\' detected" + if [[ ! -w /dev ]]; then ewarn "udev tests needs full access to /dev" ewarn "Skipping tests" else - einfo Running tests + meson-multilib_src_test + fi +} - # two binaries required by udev-test.pl - eninja systemd-detect-virt test-udev - local -x PATH="${PWD}:${PATH}" +multilib_src_test() { + # two binaries required by udev-test.pl + eninja systemd-detect-virt test-udev + local -x PATH="${PWD}:${PATH}" - # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl - "${EPYTHON}" "${S}"/test/sys-script.py test || die + # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl + "${EPYTHON}" "${S}"/test/sys-script.py test || die - # the perl script contains all the udev tests - "${S}"/test/udev-test.pl || die - fi + # the perl script contains all the udev tests + "${S}"/test/udev-test.pl || die } multilib_src_install() { diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild index 270009d07a3c..162f55057995 100644 --- a/sys-fs/udev/udev-9999.ebuild +++ b/sys-fs/udev/udev-9999.ebuild @@ -195,32 +195,30 @@ multilib_src_compile() { eninja "${targets[@]}" } -multilib_src_test() { +src_test() { # The testsuite is *very* finicky. Don't try running it in # containers or anything but a full VM or on bare metal. # udev calls 'mknod' a number of times, and this interacts # badly with kernel namespaces. - if [[ ${EUID} -ne 0 ]]; then - ewarn "udev tests need to run under uid 0" - ewarn "Skipping tests" - elif has sandbox ${FEATURES}; then - ewarn "\'FEATURES=sandbox\' detected" + if [[ ! -w /dev ]]; then ewarn "udev tests needs full access to /dev" ewarn "Skipping tests" else - einfo Running tests + meson-multilib_src_test + fi +} - # two binaries required by udev-test.pl - eninja systemd-detect-virt test-udev - local -x PATH="${PWD}:${PATH}" +multilib_src_test() { + # two binaries required by udev-test.pl + eninja systemd-detect-virt test-udev + local -x PATH="${PWD}:${PATH}" - # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl - "${EPYTHON}" "${S}"/test/sys-script.py test || die + # prepare ${BUILD_DIR}/test/sys, required by udev-test.pl + "${EPYTHON}" "${S}"/test/sys-script.py test || die - # the perl script contains all the udev tests - "${S}"/test/udev-test.pl || die - fi + # the perl script contains all the udev tests + "${S}"/test/udev-test.pl || die } multilib_src_install() { |