-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZTS: acl/off/posixmode never passes? #16030
Comments
The qemu testings on Fedora 39 seems to run the acl/off/posixmode within the distributions default settings. I have not touched selinux and so on. But the testings on Fedora 39 are running out of time, while Fedora 38 runs all tests in ~4h ... |
Some progress: TL;DR my script uses parallel build ( The root cause is that Lines 81 to 83 in d35f9f2
A subsequent 1. The test fails for me because
|
# Add new users to the same group and the command line utils. | |
# This allows them to be run out of the original users home | |
# directory as long as it permissioned to be group readable. | |
cmd_group=$(stat --format="%G" $(command -v zfs)) |
The script is adding the user to the group that owns the zfs
file in the test setup bin
directory (part of the constrained path) to ensure that the users can run test binaries.
And sure enough for my setup that's owned by root
for some reason:
$ ls -l tests/zfs-tests/bin/zfs
lrwxrwxrwx. 1 root root 22 Jan 3 09:08 tests/zfs-tests/bin/zfs -> /home/vm37user/zfs/zfs
3. Why is zfs
binary in the constrained path owned by root?
I'm doing approximately this script to create a clean VM image before running tests:
set -ex
make distclean || true
./autogen.sh
./configure --enable-debug --enable-debuginfo
make -j32
sudo ./scripts/zfs.sh
sudo make install
make distclean
removes all links in tests/zfs-tests/bin
and after this script tests/zfs-tests/bin/zfs
is owned by root
, so this is a clean reproducer.
Looking very closely:
- The
make -j32
step creates most files intests/zfs-tests/bin
but nottests/zfs-tests/bin/zfs
. - Then
sudo make install
creates thezfs
link, but it ends up owned by root.
If the make step is replaced with make -j32 all all-am
, then the zfs
link is created owned by the build user, and the test passes as expected. The test also passes if make
is called without any -j
flag (without all-am
target).
Digging into the Makefile:
- the constrained path is created in the
scripts-all-local
target which runsscripts/zfs-tests.sh -c
- this is run from
all-local
target by automake in theall-am
target created byautogen.sh
- the automake
all-recursive
target runsall-am
after doingmake all
in each subdirectory - the
all-am
target depends onall-local
- make without any target implies
all
which buildsall-recursive
The culprit appears to building with parallelism.
make -j32
builds the all-am
targets in parallel. Makefile
contains:
all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
$(HEADERS) zfs_config.h all-local
Once the build winds down far enough to start linking binaries, the available parallelism considers other targets including all-local
. This then installs the constrained path before the zfs binaries are built.
In my script sudo make install
also does makes all-am
before installing. But by this point the binaries now exist, so scripts/zfs-tests.sh -c
creates the symlink but owned by root.
Staring very closely at the make -j32
output:
CC [M] /home/vm37user/zfs/module/lua/lfunc.o
ln -s -f zfs contrib/bash_completion.d/zpool
SCRIPT_COMMON=scripts/common.sh ./scripts/zfs-tests.sh -c
CC contrib/pam_zfs_key/pam_zfs_key_la-pam_zfs_key.lo
CC [M] /home/vm37user/zfs/module/lua/lgc.o
cd contrib/pyzfs && /usr/bin/python3.12 setup.py -q egg_info -e . build
CCLD libicp.la
CCLD libunicode.la
CCLD libspl_assert.la
... 377 lines omitted ...
CCLD mount.zfs
CCLD zfs_ids_to_path
CCLD zfs
CCLD zinject
CCLD zpool
CCLD zed
The rules for scripts-all-local
do not depend on any binary targets, so make believes all of its dependencies are satisfied too early when using parallel builds.
The explicit dependencies force make to build all outputs before running the script to populate `tests/zfs-tests/bin`. Really this only needs to depend on targets in `tests/zfs-tests/include/commands.cfg` but waiting for all primary targets is more straightforward. Without this, parallel make may install symlinks before all outputs are built. This is problematic if also doing `sudo make install` as some files end up owned by root. This confuses ZTS into adding non-root test users to the root group causing tests to break. Fixes openzfs#16030 Signed-off-by: Robert Evans <evansr@google.com>
This updates the Makefile to be more correct for parallel make. Fixes openzfs#16030 Signed-off-by: Robert Evans <evansr@google.com>
This updates the Makefile to be more correct for parallel make. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Robert Evans <evansr@google.com> Closes openzfs#16030 Closes openzfs#16922
This updates the Makefile to be more correct for parallel make. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Robert Evans <evansr@google.com> Closes openzfs#16030 Closes openzfs#16922
I would like help debugging why I'm unable to make acl/off/posixmode pass when running ZTS locally.
System information
Describe the problem you're observing
ZTS test
tests/functional/acl/off/posixmode.ksh
always fails on my setup.this is the runfile I'm using:
The test fails in the tmpfs precheck part of the test:
It seems that on my setup for some reason
g=---
disallows staff2, but I don't understand what's going on or why this would pass on other systems but not Fedora (SELinux? Something different about tmpfs in Linux 6.6?)Describe how to reproduce the problem
Using the runfile above:
Include any warning/errors/backtraces from the system logs
Nothing of note
The text was updated successfully, but these errors were encountered: