Skip to content

Commit aacbeb5

Browse files
authored
build-gnu.sh: Enable test/df/no-mtab-status.sh (#9759)
* build-gnu.sh: Enable test/df/no-mtab-status.sh * Document why no-mtab-status.sh fails
1 parent eed7a0a commit aacbeb5

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/workflows/GnuTests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name: GnuTests
66
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
77
# spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay
88
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
9+
# spell-checker:ignore userns
910

1011
# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
1112

@@ -116,6 +117,9 @@ jobs:
116117
- name: Run GNU tests
117118
shell: bash
118119
run: |
120+
## Use unshare
121+
sudo sysctl -w kernel.unprivileged_userns_clone=1
122+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
119123
## Run GNU tests
120124
path_GNU='gnu'
121125
path_UUTILS='uutils'

util/build-gnu.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW
66
# spell-checker:ignore baddecode submodules xstrtol distros ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) greadlink gsed multihardlink texinfo CARGOFLAGS
7-
# spell-checker:ignore openat TOCTOU CFLAGS
7+
# spell-checker:ignore openat TOCTOU CFLAGS tmpfs
88

99
set -e
1010

@@ -171,6 +171,8 @@ grep -rl '\$abs_path_dir_' tests/*/*.sh | xargs -r "${SED}" -i "s|\$abs_path_dir
171171
"${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/runcon/runcon-no-reorder.sh
172172
"${SED}" -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh
173173

174+
# Mask mtab by unshare instead of LD_PRELOAD (able to merge this to GNU?)
175+
"${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
174176
# We use coreutils yes
175177
"${SED}" -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
176178
# Different message

util/why-error.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file documents why some GNU tests are failing:
77
* dd/nocache_eof.sh
88
* dd/skip-seek-past-file.sh - https://github.com/uutils/coreutils/issues/7216
99
* dd/stderr.sh
10+
* tests/df/no-mtab-status.sh - https://github.com/uutils/coreutils/issues/9760
1011
* fmt/non-space.sh
1112
* help/help-version-getopt.sh
1213
* help/help-version.sh

util/why-skip.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* tests/rm/rm-readdir-fail.sh
88
* tests/rm/r-root.sh
99
* tests/df/skip-duplicates.sh
10-
* tests/df/no-mtab-status.sh
1110

1211
= LD_PRELOAD was ineffective? =
1312
* tests/cp/nfs-removal-race.sh

0 commit comments

Comments
 (0)