Skip to content

Commit cf5625a

Browse files
oech3oech3
authored andcommitted
build-gnu.sh: Enable test/df/no-mtab-status.sh
1 parent 1fca829 commit cf5625a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
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|.*maybe LD_PRELOAD.*||' -e "s|^export LD_PRELOAD=.*|function df { unshare -rm bash -c 'mount -t tmpfs tmpfs /proc \&\& command df \"\$@\"' -- \"\$@\"; }|" test/df/no-mtab-status.sh
174176
# We use coreutils yes
175177
"${SED}" -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
176178
# Different message

0 commit comments

Comments
 (0)