CI integration test with podman (#422)

Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
Matej Vasek 2021-07-16 15:47:09 +02:00 committed by GitHub
parent 892558bf2a
commit ed0c246ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -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

31
hack/test-integration-podman.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
cat <<EOF > 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