Skip to content

Commit

Permalink
Cirrus: Implement containerized system testing
Browse files Browse the repository at this point in the history
containers#8714 (comment)

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Jan 11, 2021
1 parent d2503ae commit fe29126
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ local_system_test_task: &local_system_test_task
- local_integration_test
matrix: *platform_axis
gce_instance: *standardvm
timeout_in: 30m
env:
TEST_FLAVOR: sys
clone_script: *noop # Comes from cache
Expand All @@ -568,6 +569,18 @@ remote_system_test_task:
PODBIN_NAME: remote


container_system_test_task:
<<: *local_system_test_task
alias: container_system_test
skip: *branch
depends_on:
- container_integration_test
matrix: *fedora_vm_axis
env:
TEST_FLAVOR: sys
TEST_ENVIRON: container


rootless_system_test_task:
name: *std_name_fmt
alias: rootless_system_test
Expand Down Expand Up @@ -641,6 +654,7 @@ success_task:
- container_integration_test
- local_system_test
- remote_system_test
- container_system_test
- rootless_system_test
- meta
container: *smallcontainer
Expand Down
1 change: 1 addition & 0 deletions contrib/cirrus/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ exec_container() {
set -x
# shellcheck disable=SC2154
exec podman run --rm --privileged --net=host --cgroupns=host \
--cgroup-manager=$CGROUP_MANAGER \
-v /dev/fuse:/dev/fuse \
-v "$GOPATH:$GOPATH:Z" \
--workdir "$GOSRC" \
Expand Down
20 changes: 12 additions & 8 deletions contrib/cirrus/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,19 @@ case "$TEST_ENVIRON" in
# the following two modules loaded on the host.
modprobe ip6table_nat || :
modprobe iptable_nat || :
else
warn "Forcing CGROUP_MANAGER=cgroupfs"
echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment

# There's no practical way to detect userns w/in a container
# affected/related tests are sensitive to this variable.
warn "Disabling usernamespace integration testing"
echo "SKIP_USERNS=1" >> /etc/ci_environment
else # inside the container intended for testing
if [[ -c /dev/fuse ]]; then
warn "Enabling Fuse-Overlay in storage.conf"
sed -i -r -e 's|^#(mount_program.+fuse-over.*)|\1|g' \
/etc/containers/storage.conf
else
warn "Running inside a container w/o /dev/fuse mounted."
fi
fi

# The e2e tests wrongly guess `--cgroup-manager systemd`
warn "Forcing CGROUP_MANAGER=cgroupfs"
echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment
;;
*) die_unknown TEST_ENVIRON
esac
Expand Down

0 comments on commit fe29126

Please sign in to comment.