Skip to content

Commit

Permalink
Enable cgroupv2 integration tests
Browse files Browse the repository at this point in the history
Those needs to be run on the (Vagrant Fedora 31) host
(since we need real systemd running), and so we have
to have all the tools needed to compile runc and run
the tests.

The good news is Fedora packages a decent and recent release
of bats-core (1.1.0), which we can use (Debian does not).

Currently only cgroups.bats and update.bats are working,
and only with RUNC_USE_SYSTEMD=yes.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Apr 10, 2020
1 parent 8d1a159 commit c316380
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ matrix:
- sudo ssh default sudo podman build -t test /vagrant
# Mounting /lib/modules into the container is necessary as CRIU wants to load (via iptables) additional modules
- sudo ssh default sudo podman run --privileged --cgroupns=private -v /lib/modules:/lib/modules:ro test make localunittest
- sudo ssh default 'cd /vagrant && sudo make localintegration TESTPATH=/update.bats RUNC_USE_SYSTEMD=yes'
- sudo ssh default 'cd /vagrant && sudo make localintegration TESTPATH=/cgroups.bats RUNC_USE_SYSTEMD=yes'
allow_failures:
- go: tip

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Vagrant.configure("2") do |config|
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
dnf install -y podman
dnf install -y podman git-core make golang-go libseccomp-devel bats jq
SHELL
end
1 change: 1 addition & 0 deletions tests/integration/cgroups.bats
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ EOF
runc run -d --console-socket $CONSOLE_SOCKET test_cgroups_permissions
[ "$status" -eq 0 ]

sleep 1
runc exec test_cgroups_permissions echo "cgroups_exec"
[ "$status" -eq 0 ]
[[ ${lines[0]} == *"cgroups_exec"* ]]
Expand Down

0 comments on commit c316380

Please sign in to comment.