diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 292a469defc..bc82dd20245 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -6,6 +6,7 @@ name: GnuTests # spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic # spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay # spell-checker:ignore (vars) FILESET SUBDIRS XPASS +# spell-checker:ignore userns # * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT` @@ -116,6 +117,9 @@ jobs: - name: Run GNU tests shell: bash run: | + ## Use unshare + sudo sysctl -w kernel.unprivileged_userns_clone=1 + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 ## Run GNU tests path_GNU='gnu' path_UUTILS='uutils' diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 42b714ac7be..3364522ca47 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -4,7 +4,7 @@ # spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW # spell-checker:ignore baddecode submodules xstrtol distros ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) greadlink gsed multihardlink texinfo CARGOFLAGS -# spell-checker:ignore openat TOCTOU CFLAGS +# spell-checker:ignore openat TOCTOU CFLAGS tmpfs set -e @@ -171,6 +171,8 @@ grep -rl '\$abs_path_dir_' tests/*/*.sh | xargs -r "${SED}" -i "s|\$abs_path_dir "${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/runcon/runcon-no-reorder.sh "${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh +# Mask mtab by unshare instead of LD_PRELOAD (able to merge this to GNU?) +"${SED}" -i -e 's|^export LD_PRELOAD=.*||' -e "s|.*maybe LD_PRELOAD.*|df() { unshare -rm bash -c \"mount -t tmpfs tmpfs /proc \&\& command df \\\\\"\\\\\$@\\\\\"\" -- \"\$@\"; }|" tests/df/no-mtab-status.sh # We use coreutils yes "${SED}" -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh # Different message diff --git a/util/why-error.md b/util/why-error.md index 04039e34e2a..f2a710c462d 100644 --- a/util/why-error.md +++ b/util/why-error.md @@ -7,6 +7,7 @@ This file documents why some GNU tests are failing: * dd/nocache_eof.sh * dd/skip-seek-past-file.sh - https://github.com/uutils/coreutils/issues/7216 * dd/stderr.sh +* tests/df/no-mtab-status.sh - https://github.com/uutils/coreutils/issues/9760 * fmt/non-space.sh * help/help-version-getopt.sh * help/help-version.sh diff --git a/util/why-skip.md b/util/why-skip.md index f471ec09b22..8a43020859a 100644 --- a/util/why-skip.md +++ b/util/why-skip.md @@ -7,7 +7,6 @@ * tests/rm/rm-readdir-fail.sh * tests/rm/r-root.sh * tests/df/skip-duplicates.sh -* tests/df/no-mtab-status.sh = LD_PRELOAD was ineffective? = * tests/cp/nfs-removal-race.sh