CI: run CRI tests on Fedora 32
SELinux is currently disabled Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
f4ebe02f98
commit
061d338ec2
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -442,3 +442,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Integration
|
- name: Integration
|
||||||
run: vagrant ssh default -- sudo -i /integration.sh
|
run: vagrant ssh default -- sudo -i /integration.sh
|
||||||
|
|
||||||
|
- name: CRI test
|
||||||
|
run: vagrant ssh default -- sudo -i /critest.sh
|
||||||
|
45
Vagrantfile
vendored
45
Vagrantfile
vendored
@ -33,16 +33,21 @@ Vagrant.configure("2") do |config|
|
|||||||
RUNC_FLAVOR="crun"
|
RUNC_FLAVOR="crun"
|
||||||
|
|
||||||
# install dnf deps
|
# install dnf deps
|
||||||
dnf install -y gcc git libseccomp-devel lsof make
|
dnf install -y container-selinux gcc git iptables libseccomp-devel lsof make
|
||||||
|
|
||||||
# install Go
|
# install Go
|
||||||
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
|
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
|
||||||
|
|
||||||
# setup env vars
|
# setup env vars
|
||||||
cat >> /etc/profile.d/sh.local <<EOF
|
cat >> /etc/environment <<EOF
|
||||||
PATH=/usr/local/go/bin:$PATH
|
PATH=/usr/local/go/bin:$PATH
|
||||||
GO111MODULE=off
|
GO111MODULE=off
|
||||||
export PATH GO111MODULE
|
EOF
|
||||||
|
source /etc/environment
|
||||||
|
cat >> /etc/profile.d/sh.local <<EOF
|
||||||
|
GOPATH=\\$HOME/go
|
||||||
|
PATH=\\$GOPATH/bin:\\$PATH
|
||||||
|
export GOPATH PATH
|
||||||
EOF
|
EOF
|
||||||
source /etc/profile.d/sh.local
|
source /etc/profile.d/sh.local
|
||||||
|
|
||||||
@ -51,11 +56,27 @@ EOF
|
|||||||
ln -s /vagrant /root/go/src/github.com/containerd/containerd
|
ln -s /vagrant /root/go/src/github.com/containerd/containerd
|
||||||
cd /root/go/src/github.com/containerd/containerd
|
cd /root/go/src/github.com/containerd/containerd
|
||||||
|
|
||||||
# install runc (or crun)
|
# install runc (or crun) and other components
|
||||||
RUNC_FLAVOR=$RUNC_FLAVOR ./script/setup/install-runc
|
RUNC_FLAVOR=$RUNC_FLAVOR ./script/setup/install-runc
|
||||||
|
./script/setup/install-cni
|
||||||
|
./script/setup/install-critools
|
||||||
|
|
||||||
# install containerd
|
# install containerd
|
||||||
make BUILDTAGS="no_aufs no_btrfs no_devmapper no_zfs" binaries install
|
make BUILDTAGS="seccomp selinux no_aufs no_btrfs no_devmapper no_zfs" binaries install
|
||||||
|
|
||||||
|
# FIXME: enable SELinux
|
||||||
|
setenforce 0
|
||||||
|
umount /sys/fs/selinux
|
||||||
|
|
||||||
|
# create the daemon config
|
||||||
|
mkdir -p /etc/containerd
|
||||||
|
cat > /etc/containerd/config.toml <<EOF
|
||||||
|
version = 2
|
||||||
|
[plugins]
|
||||||
|
[plugins."io.containerd.grpc.v1.cri"]
|
||||||
|
# FIXME: enable SELinux
|
||||||
|
enable_selinux = false
|
||||||
|
EOF
|
||||||
|
|
||||||
# create /integration.sh
|
# create /integration.sh
|
||||||
cat > /integration.sh <<EOF
|
cat > /integration.sh <<EOF
|
||||||
@ -65,5 +86,19 @@ cd /root/go/src/github.com/containerd/containerd
|
|||||||
make integration EXTRA_TESTFLAGS=-no-criu TEST_RUNTIME=io.containerd.runc.v2 RUNC_FLAVOR=$RUNC_FLAVOR
|
make integration EXTRA_TESTFLAGS=-no-criu TEST_RUNTIME=io.containerd.runc.v2 RUNC_FLAVOR=$RUNC_FLAVOR
|
||||||
EOF
|
EOF
|
||||||
chmod +x /integration.sh
|
chmod +x /integration.sh
|
||||||
|
|
||||||
|
# create /critest.sh
|
||||||
|
cat > /critest.sh <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
set -eux -o pipefail
|
||||||
|
containerd -log-level debug &> /tmp/containerd-cri.log &
|
||||||
|
critest --runtime-endpoint=unix:///var/run/containerd/containerd.sock --parallel=2
|
||||||
|
TEST_RC=\\$?
|
||||||
|
test \\$TEST_RC -ne 0 && cat /tmp/containerd-cri.log
|
||||||
|
pkill containerd
|
||||||
|
rm -rf /etc/containerd
|
||||||
|
exit \\$TEST_RC
|
||||||
|
EOF
|
||||||
|
chmod +x /critest.sh
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user