Skip to content

Commit

Permalink
github: Fix cgroup2 support
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Sep 26, 2023
1 parent a225e69 commit 7789c61
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
sudo add-apt-repository ppa:ubuntu-lxc/daily -y
sudo apt-get install -qq lxc lxc-dev pkg-config uidmap busybox libdbus-1-dev libseccomp-dev libcap-dev
sudo apt-get install -qq apparmor lxc lxc-dev pkg-config uidmap busybox libdbus-1-dev libseccomp-dev libcap-dev libselinux-dev
- name: Setup test environment
run: |
Expand Down Expand Up @@ -65,15 +65,18 @@ jobs:
sudo chown -R $USER: $d/lxc-test
echo $$ | sudo tee $d/lxc-test/cgroup.procs
done
# Run the unprivileged tests
./go-lxc.test -test.v -test.coverprofile=/tmp/unpriv.out
else
# CGroup 2
sudo mkdir -p /sys/fs/cgroup/lxc-test
sudo chown -R $USER: /sys/fs/cgroup/lxc-test
echo $$ | sudo tee /sys/fs/cgroup/lxc-test/cgroup.procs
fi
# Run the unprivileged tests
./go-lxc.test -test.v -test.coverprofile=/tmp/unpriv.out
# Run the unprivileged tests
systemd-run --unit=go-lxc-test --user --scope -p "Delegate=yes" ./go-lxc.test -test.v -test.coverprofile=/tmp/unpriv.out
fi
- name: Privileged tests
env:
Expand Down

0 comments on commit 7789c61

Please sign in to comment.