Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial integration tests for cgroupv2 #2295

Merged
merged 8 commits into from
Apr 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Enable integration tests in cgroupv2 env
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),
and we can also use golang (currently 1.13.9) from Fedora.

The bad news are

 1. Currently cgroups tests are only working with
    RUNC_USE_SYSTEMD=yes (addressed by #2299, #2305)

 2. Tests in events.bats do not work (need cgroupv2
    memory.events support)

 3. Fedora 31 image is 6 months old (and has broken
    container-selinux policy) so we need `dnf update`,
    which adds ~5 min to test time.

[v2: add -t to ssh to enforce pty]
[v3: disable events tests for cgroupv2]
[v4: update fedora packages, use a single dnf transation]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Apr 14, 2020
commit 84583eb1a4a5a53ca79bba32eb67592c26c25704
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
# cgroupv2+systemd: test on vagrant host itself as we need systemd
- sudo ssh default -t 'cd /vagrant && sudo make localintegration RUNC_USE_SYSTEMD=yes'
allow_failures:
- go: tip

8 changes: 7 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
@@ -13,6 +13,12 @@ Vagrant.configure("2") do |config|
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
dnf install -y podman
cat << EOF | dnf -y shell
config install_weak_deps: False
update
install podman make golang-go libseccomp-devel bats jq
ts run
EOF
dnf clean all
SHELL
end
12 changes: 8 additions & 4 deletions tests/integration/events.bats
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@ function teardown() {

@test "events --stats" {
# XXX: currently cgroups require root containers.
requires root
# TODO: support cgroup v2 memory.events
requires root cgroups_v1

# run busybox detached
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
@@ -28,7 +29,8 @@ function teardown() {

@test "events --interval default " {
# XXX: currently cgroups require root containers.
requires root
# TODO: support cgroup v2 memory.events
requires root cgroups_v1

# run busybox detached
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
@@ -55,7 +57,8 @@ function teardown() {

@test "events --interval 1s " {
# XXX: currently cgroups require root containers.
requires root
# TODO: support cgroup v2 memory.events
requires root cgroups_v1

# run busybox detached
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
@@ -81,7 +84,8 @@ function teardown() {

@test "events --interval 100ms " {
# XXX: currently cgroups require root containers.
requires root
# TODO: support cgroup v2 memory.events
requires root cgroups_v1

# run busybox detached
runc run -d --console-socket $CONSOLE_SOCKET test_busybox