@@ -33,16 +33,21 @@ Vagrant.configure("2") do |config|
3333 RUNC_FLAVOR="crun"
3434
3535 # install dnf deps
36- dnf install -y gcc git libseccomp-devel lsof make
36+ dnf install -y container-selinux gcc git iptables libseccomp-devel lsof make
3737
3838 # install Go
3939 curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
4040
4141 # setup env vars
42- cat >> /etc/profile.d/sh.local <<EOF
42+ cat >> /etc/environment <<EOF
4343PATH=/usr/local/go/bin:$PATH
4444GO111MODULE=off
45- export PATH GO111MODULE
45+ EOF
46+ source /etc/environment
47+ cat >> /etc/profile.d/sh.local <<EOF
48+ GOPATH=\\ $HOME/go
49+ PATH=\\ $GOPATH/bin:\\ $PATH
50+ export GOPATH PATH
4651EOF
4752 source /etc/profile.d/sh.local
4853
5156 ln -s /vagrant /root/go/src/github.com/containerd/containerd
5257 cd /root/go/src/github.com/containerd/containerd
5358
54- # install runc (or crun)
59+ # install runc (or crun) and other components
5560 RUNC_FLAVOR=$RUNC_FLAVOR ./script/setup/install-runc
61+ ./script/setup/install-cni
62+ ./script/setup/install-critools
5663
5764 # install containerd
58- make BUILDTAGS="no_aufs no_btrfs no_devmapper no_zfs" binaries install
65+ make BUILDTAGS="seccomp selinux no_aufs no_btrfs no_devmapper no_zfs" binaries install
66+
67+ # FIXME: enable SELinux
68+ setenforce 0
69+ umount /sys/fs/selinux
70+
71+ # create the daemon config
72+ mkdir -p /etc/containerd
73+ cat > /etc/containerd/config.toml <<EOF
74+ version = 2
75+ [plugins]
76+ [plugins."io.containerd.grpc.v1.cri"]
77+ # FIXME: enable SELinux
78+ enable_selinux = false
79+ EOF
5980
6081 # create /integration.sh
6182 cat > /integration.sh <<EOF
@@ -65,5 +86,19 @@ cd /root/go/src/github.com/containerd/containerd
6586make integration EXTRA_TESTFLAGS=-no-criu TEST_RUNTIME=io.containerd.runc.v2 RUNC_FLAVOR=$RUNC_FLAVOR
6687EOF
6788 chmod +x /integration.sh
89+
90+ # create /critest.sh
91+ cat > /critest.sh <<EOF
92+ #!/bin/bash
93+ set -eux -o pipefail
94+ containerd -log-level debug &> /tmp/containerd-cri.log &
95+ critest --runtime-endpoint=unix:///var/run/containerd/containerd.sock --parallel=2
96+ TEST_RC=\\ $?
97+ test \\ $TEST_RC -ne 0 && cat /tmp/containerd-cri.log
98+ pkill containerd
99+ rm -rf /etc/containerd
100+ exit \\ $TEST_RC
101+ EOF
102+ chmod +x /critest.sh
68103 SHELL
69104end
0 commit comments