From 358d17dea16e3ece2f9a68cda2ad733b579210bc Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 12 Feb 2026 13:24:10 -0500 Subject: [PATCH] ci: Drop `su -c` usage The `su -c` usage seems to be leftover from someone else's CI config that was used for inspiration. Drop it. Test suite in containers now run as root. The libvirt pieces and new test exclusions were what I needed to get the test suite working under root Signed-off-by: Cole Robinson --- .github/workflows/main.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 276c17da8..384834628 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,33 +119,30 @@ jobs: - name: Checkout sources uses: actions/checkout@v5 - - name: Create user - run: | - useradd -m -s /bin/bash -G wheel guestfs - tail /etc/passwd - - - name: Make checkout directory editable by the sscg user - run: | - chown -R guestfs:wheel ${GITHUB_WORKSPACE} - - name: Checkout submodule run: | - su -c 'git submodule update --init' guestfs + git config --global --add safe.directory $PWD + git submodule update --init - name: Compile the code run: | - su -c ' autoreconf -fiv && ./configure CFLAGS="-fPIC -g -O2" --enable-werror && make -j - ' guestfs - name: Run the quick test run: | - su -c 'make quickcheck' guestfs + make quickcheck + + - name: Sanity check libvirt connection + run: | + virtqemud --daemon + virsh uri - name: Run the full tests run: | + # https://github.com/libguestfs/libguestfs/issues/307 + export SKIP_TEST_GUESTUNMOUNT_FD=1 # error: passt exited with status 1 export SKIP_TEST_NETWORK_SH=1 # error: passt exited with status 1 @@ -153,9 +150,7 @@ jobs: # error: internal_autosync: umount: /sysroot: umount: /sysroot: # target is busy export SKIP_RHBZ1011907_1165785_SH=1 - # We have to set $HOME since su -p won't set it below. - export HOME=/home/guestfs - if ! su -p -c 'make check' guestfs; then + if ! make check; then find -name test-suite.log -exec cat {} \; exit 1 fi