commit: 20f797f1093cf4d531e059d0b6bd6bc962550ed0 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Aug 2 21:51:24 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Aug 2 21:54:13 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20f797f1
sys-libs/glibc: skip extra tests in systemd-nspawn containers Some tests fail because of systemd-nspawn's default restrictive seccomp filter list. Skip those tests only when systemd-detect-virt reckons we're in an nspawn container. Bug: https://sourceware.org/PR30603 Closes: https://github.com/gentoo/gentoo/pull/32148 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-libs/glibc/glibc-2.37-r4.ebuild | 25 +++++++++++++++++++++++++ sys-libs/glibc/glibc-2.38.ebuild | 25 +++++++++++++++++++++++++ sys-libs/glibc/glibc-9999.ebuild | 25 +++++++++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/sys-libs/glibc/glibc-2.37-r4.ebuild b/sys-libs/glibc/glibc-2.37-r4.ebuild index 830de3656427..5fb0eb873238 100644 --- a/sys-libs/glibc/glibc-2.37-r4.ebuild +++ b/sys-libs/glibc/glibc-2.37-r4.ebuild @@ -170,6 +170,25 @@ XFAIL_TEST_LIST=( tst-strsignal ) +XFAIL_NSPAWN_TEST_LIST=( + # These tests need to be adapted to handle EPERM/ENOSYS(?) properly + # upstream, as systemd-nspawn's default seccomp whitelist is too strict. + # https://sourceware.org/PR30603 + test-errno-linux + tst-bz21269 + tst-mlock2 + tst-ntp_gettime + tst-ntp_gettime-time64 + tst-ntp_gettimex + tst-ntp_gettimex-time64 + tst-pkey + tst-process_mrelease + tst-adjtime + tst-adjtime-time64 + tst-clock2 + tst-clock2-time64 +) + # # Small helper functions # @@ -1225,6 +1244,12 @@ glibc_src_test() { local myxfailparams="" if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then + local virt=$(systemd-detect-virt 2>/dev/null) + if [[ ${virt} == systemd-nspawn ]] ; then + ewarn "Skipping extra tests because in systemd-nspawn container" + XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) + fi + for myt in ${XFAIL_TEST_LIST[@]} ; do myxfailparams+="test-xfail-${myt}=yes " done diff --git a/sys-libs/glibc/glibc-2.38.ebuild b/sys-libs/glibc/glibc-2.38.ebuild index a0250a2928fc..1e4988e77976 100644 --- a/sys-libs/glibc/glibc-2.38.ebuild +++ b/sys-libs/glibc/glibc-2.38.ebuild @@ -170,6 +170,25 @@ XFAIL_TEST_LIST=( tst-strsignal ) +XFAIL_NSPAWN_TEST_LIST=( + # These tests need to be adapted to handle EPERM/ENOSYS(?) properly + # upstream, as systemd-nspawn's default seccomp whitelist is too strict. + # https://sourceware.org/PR30603 + test-errno-linux + tst-bz21269 + tst-mlock2 + tst-ntp_gettime + tst-ntp_gettime-time64 + tst-ntp_gettimex + tst-ntp_gettimex-time64 + tst-pkey + tst-process_mrelease + tst-adjtime + tst-adjtime-time64 + tst-clock2 + tst-clock2-time64 +) + # # Small helper functions # @@ -1221,6 +1240,12 @@ glibc_src_test() { local myxfailparams="" if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then + local virt=$(systemd-detect-virt 2>/dev/null) + if [[ ${virt} == systemd-nspawn ]] ; then + ewarn "Skipping extra tests because in systemd-nspawn container" + XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) + fi + for myt in ${XFAIL_TEST_LIST[@]} ; do myxfailparams+="test-xfail-${myt}=yes " done diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index a0250a2928fc..1e4988e77976 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -170,6 +170,25 @@ XFAIL_TEST_LIST=( tst-strsignal ) +XFAIL_NSPAWN_TEST_LIST=( + # These tests need to be adapted to handle EPERM/ENOSYS(?) properly + # upstream, as systemd-nspawn's default seccomp whitelist is too strict. + # https://sourceware.org/PR30603 + test-errno-linux + tst-bz21269 + tst-mlock2 + tst-ntp_gettime + tst-ntp_gettime-time64 + tst-ntp_gettimex + tst-ntp_gettimex-time64 + tst-pkey + tst-process_mrelease + tst-adjtime + tst-adjtime-time64 + tst-clock2 + tst-clock2-time64 +) + # # Small helper functions # @@ -1221,6 +1240,12 @@ glibc_src_test() { local myxfailparams="" if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then + local virt=$(systemd-detect-virt 2>/dev/null) + if [[ ${virt} == systemd-nspawn ]] ; then + ewarn "Skipping extra tests because in systemd-nspawn container" + XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) + fi + for myt in ${XFAIL_TEST_LIST[@]} ; do myxfailparams+="test-xfail-${myt}=yes " done
