Skip to content

Commit

Permalink
CI integration test with podman (#422)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek authored Jul 16, 2021
1 parent 892558b commit ed0c246
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
31 changes: 31 additions & 0 deletions hack/test-integration-podman.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ed0c246

Please sign in to comment.