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), so install make
and bats to the host.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Apr 9, 2020
1 parent 8d1a159 commit 3dac3f6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ 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 ./script/install-bats.sh && make RUNC_USE_SYSTEMD=yes integration'
allow_failures:
- go: tip

Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG GO_VERSION=1.13
ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f
ARG CRIU_VERSION=v3.13

FROM golang:${GO_VERSION}-buster
Expand Down Expand Up @@ -49,13 +48,8 @@ RUN dpkg --add-architecture armel \
RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless

# install bats
ARG BATS_VERSION
RUN cd /tmp \
&& git clone https://github.com/sstephenson/bats.git \
&& cd bats \
&& git reset --hard "${BATS_VERSION}" \
&& ./install.sh /usr/local \
&& rm -rf /tmp/bats
COPY script/install-bats.sh /tmp
RUN /tmp/install-bats.sh && rm /tmp/install-bats.sh

# install criu
ARG CRIU_VERSION
Expand Down
9 changes: 8 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Vagrant.configure("2") do |config|
v.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
dnf install -y podman
dnf install -y podman make git;
BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f; \
cd /tmp \
&& git clone https://github.com/sstephenson/bats.git \
&& cd bats \
&& git reset --hard "${BATS_VERSION}" \
&& ./install.sh /usr/local \
&& rm -rf /tmp/bats
SHELL
end
11 changes: 11 additions & 0 deletions script/install-bats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -u -e -o pipefail
: "${BATS_VERSION:="03608115df2071fff4eaaff1605768c275e5f81f"}"

cd /tmp \
&& git clone https://github.com/sstephenson/bats.git \
&& cd bats \
&& git reset --hard "${BATS_VERSION}" \
&& ./install.sh /usr/local \
&& rm -rf /tmp/bats

0 comments on commit 3dac3f6

Please sign in to comment.