ping tests: Run tests unprivileged inside a vnet
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, arm64, aarch64) (push) Waiting to run

In order to create vnet jails, atf_python needs root privileges.
However, once the vnet is created, its privileges inside the vnet can be
demoted, as these tests should not require root in order to pass.

Reviewed by:	markj
Approved by:	emaste (mentor)
Fixes:	4efaf43c6f ("ping: Require root user for pytests")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42175
This commit is contained in:
Jose Luis Duran 2024-11-05 03:00:38 +00:00
parent 8b13cb9d65
commit 5797a03fe8
No known key found for this signature in database
GPG Key ID: 5415E244477475CC

View File

@ -724,6 +724,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
@pytest.mark.parametrize("expected", testdata)
@pytest.mark.require_user("root")
@pytest.mark.require_user("unprivileged")
def test_ping(self, expected):
"""Test ping"""
ping = subprocess.run(
@ -753,6 +754,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
@pytest.mark.parametrize("expected", ping46_testdata)
@pytest.mark.require_user("root")
@pytest.mark.require_user("unprivileged")
def test_ping_46(self, expected):
"""Test ping -4/ping -6"""
for version in [4, 6]: