From ed0c246adabc9ae2fb7f6ed90f089723e042db05 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Fri, 16 Jul 2021 15:47:09 +0200 Subject: [PATCH] CI integration test with podman (#422) Signed-off-by: Matej Vasek --- .github/workflows/pull_requests.yaml | 11 ++++++++++ hack/test-integration-podman.sh | 31 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 hack/test-integration-podman.sh diff --git a/.github/workflows/pull_requests.yaml b/.github/workflows/pull_requests.yaml index d91756e2..d662c0e5 100644 --- a/.github/workflows/pull_requests.yaml +++ b/.github/workflows/pull_requests.yaml @@ -78,6 +78,15 @@ jobs: uses: actions/checkout@v2 - name: Setup Go uses: actions/setup-go@v2 + - name: Install Podman + run: | + . /etc/os-release + echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list + curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - + sudo apt-get update + sudo apt-get -y upgrade + sudo apt-get -y install podman + podman info - name: Install Binaries run: ./hack/binaries.sh - name: Allocate Cluster @@ -86,6 +95,8 @@ jobs: run: ./hack/ci.sh - name: Verify Configuration run: ./hack/test.sh + - name: Integration Test Podman + run: ./hack/test-integration-podman.sh - name: Integration Test run: make test-integration diff --git a/hack/test-integration-podman.sh b/hack/test-integration-podman.sh new file mode 100755 index 00000000..8b734065 --- /dev/null +++ b/hack/test-integration-podman.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +cat < registries.conf +unqualified-search-registries = ["docker.io", "quay.io", "registry.fedoraproject.org", "registry.access.redhat.com"] +short-name-mode="permissive" + +[[registry]] +location="localhost:5000" +insecure=true +EOF + +CONTAINERS_REGISTRIES_CONF="$(pwd)/registries.conf" +export CONTAINERS_REGISTRIES_CONF + +podman system service --time=0 --log-level=info > podman_log.txt 2>&1 & +podman_pid=$! + +DOCKER_HOST="unix://$(podman info -f '{{.Host.RemoteSocket.Path}}' 2> /dev/null)" +export DOCKER_HOST +go test -tags integration ./... -v +e=$? + +kill -TERM "$podman_pid" > /dev/null 2>&1 +wait "$podman_pid" > /dev/null 2>&1 + +echo '::group::Podman Output' +cat podman_log.txt +echo '' +echo '::endgroup::' + +exit $e