mirror of https://github.com/containers/conmon.git
100 lines
2.7 KiB
Bash
Executable File
100 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Check for root
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Please run this script as root"
|
|
exit 1
|
|
fi
|
|
|
|
# Install latest CRI-O
|
|
curl https://raw.githubusercontent.com/cri-o/cri-o/master/scripts/get | bash
|
|
crio --version
|
|
|
|
# Use runc as default runtime
|
|
rm /etc/crio/crio.conf.d/10-crun.conf
|
|
cat <<EOT >>/etc/crio/crio.conf.d/10-config.conf
|
|
[crio.runtime]
|
|
log_level = "debug"
|
|
[crio.runtime.runtimes.runc]
|
|
runtime_path = "/usr/local/bin/runc"
|
|
EOT
|
|
runc --version
|
|
|
|
# Start CRI-O
|
|
systemctl daemon-reload
|
|
systemctl start crio
|
|
systemctl is-active --quiet crio && echo CRI-O is running
|
|
journalctl --no-pager -u crio
|
|
|
|
# Start Kubernetes
|
|
GOROOT="$GOROOT_1_17_X64"
|
|
GOPATH="$HOME/go"
|
|
PATH="$GOROOT/bin:$PATH"
|
|
K8SPATH="$GOPATH/src/k8s.io"
|
|
mkdir -p "$K8SPATH"
|
|
pushd "$K8SPATH"
|
|
git clone --depth=1 https://github.com/kubernetes/kubernetes
|
|
pushd kubernetes
|
|
|
|
LATEST=$(curl -sSfL https://dl.k8s.io/ci/latest.txt)
|
|
echo "Using Kubernetes build $LATEST"
|
|
|
|
URL="https://dl.k8s.io/ci/$LATEST"
|
|
mkdir -p _output/bin
|
|
|
|
echo Downloading server binaries
|
|
curl -sSfL "$URL/kubernetes-server-linux-amd64.tar.gz" -o- | tar xfz -
|
|
cp kubernetes/server/bin/{kubectl,kube-apiserver,kube-controller-manager,kube-proxy,kube-scheduler,kubelet} \
|
|
_output/bin
|
|
|
|
echo Downloading test binaries
|
|
curl -sSfL "$URL/kubernetes-test-linux-amd64.tar.gz" -o- | tar xfz -
|
|
cp kubernetes/test/bin/{ginkgo,e2e.test} _output/bin
|
|
|
|
export CONTAINER_RUNTIME=remote
|
|
export CGROUP_DRIVER=systemd
|
|
export CGROUP_ROOT=/
|
|
export KUBELET_FLAGS='--runtime-cgroups=/system.slice/crio.service --non-masquerade-cidr=0.0.0.0/0'
|
|
export CONTAINER_RUNTIME_ENDPOINT=/var/run/crio/crio.sock
|
|
export ALLOW_PRIVILEGED=1
|
|
|
|
IP=$(ip route get 1.2.3.4 | cut -d ' ' -f7 | tr -d '[:space:]')
|
|
echo "Using IP: $IP"
|
|
export DNS_SERVER_IP=$IP
|
|
export API_HOST_IP=$IP
|
|
|
|
iptables -F
|
|
hack/install-etcd.sh
|
|
export PATH="$GOPATH/src/k8s.io/kubernetes/third_party/etcd:$PATH"
|
|
|
|
OUTPUT=$(mktemp)
|
|
hack/local-up-cluster.sh -O 2>&1 | tee "$OUTPUT" &
|
|
PID=$!
|
|
|
|
until grep -q "Local Kubernetes cluster is running" "$OUTPUT"; do
|
|
echo Waiting for hack/local-up-cluster.sh
|
|
if ! ps $PID >/dev/null; then
|
|
exit 1
|
|
fi
|
|
sleep 5
|
|
done
|
|
|
|
echo Cluster is up and running
|
|
|
|
# Run the tests
|
|
export KUBERUN=/var/run/kubernetes
|
|
export KUBECONFIG=$KUBERUN/admin.kubeconfig
|
|
export PATH="$GOPATH/src/k8s.io/kubernetes/_output/local/bin/linux/amd64:$PATH"
|
|
export KUBE_MASTER_URL=$IP
|
|
export KUBE_MASTER_IP=$IP
|
|
export KUBE_MASTER=$IP
|
|
export HOSTNAME_OVERRIDE=$IP
|
|
|
|
export GINKGO_PARALLEL_NODES=4
|
|
export GINKGO_PARALLEL=y
|
|
|
|
_output/bin/e2e.test --provider=local --host="https://$IP:6443" \
|
|
--ginkgo.focus='\[NodeConformance|NodeFeature:.*\]' \
|
|
--ginkgo.skip='\[Flaky|Slow|Serial|sig-network|NodeFeature:RuntimeHandler\]|exec hook properly'
|