]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: make TEST-07-PID1.user-namespace-path more robust 42001/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 8 May 2026 17:02:40 +0000 (18:02 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 8 May 2026 17:05:03 +0000 (18:05 +0100)
commit7af304d601e63b892bd965e5d0c7536d6ab31621
treef930759ee6c9abb4e6008a7302b9fea4f50d865f
parentd0c912899a33436d6676b2564eb1ac506f378571
test: make TEST-07-PID1.user-namespace-path more robust

The test occasionally fails because lsns returns empty output for
the transient unit, even though the process is running. e.g.:

    [ 1843.556046] TEST-07-PID1.sh[8560]: + systemd-run --unit=newservice --property=Type=exec --property=UserNamespacePath=/proc/8608/ns/user --property=NetworkNamespacePath=/proc/8608/ns/net sleep 3600
    [ 1844.205927] TEST-07-PID1.sh[8616]: ++ systemctl show newservice -p MainPID
    [ 1844.221425] TEST-07-PID1.sh[8618]: ++ lsns -p 8608 -o NS -t net -n
    [ 1844.229653] TEST-07-PID1.sh[8619]: ++ lsns -p 8614 -o NS -t net -n
    [ 1844.235563] TEST-07-PID1.sh[8620]: FAIL: expected: '' actual: '4026532522'

This could be a race, so switch to Type=notify to try and make it more robust.
test/units/TEST-07-PID1.user-namespace-path.sh