-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial smoke-test framework for docker testimages
/kind feature /area ci Added small framework that allows to define small test script that allows doing some work around the Docker context. I've added small tests around basic functionalities and binary presence. Script results outputs are collected to the ARTIFACTS directory and if any error occurs, the build loop is interrupted, returning non-zero exit code. The functionality docu is provided for anyone who wants to add another smoke test for new or existing image.
- Loading branch information
Showing
5 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
podman run --arch=amd64 --rm "$IMG" bash -c ' | ||
set -e | ||
go version | ||
ko version | ||
kubebuilder version | ||
kustomize version | ||
jobguard -help | ||
cat<<EOF > /tmp/main.go | ||
package main | ||
import "fmt" | ||
func main() { | ||
fmt.Println("Hello World!") | ||
} | ||
EOF | ||
go run /tmp/main.go | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo ">>> Basic checks" | ||
docker run --rm --privileged \ | ||
"$IMG" bash -c ' | ||
set -e | ||
helm version | ||
jobguard -h | ||
env | ||
' | ||
echo "DinD checks" | ||
docker run --rm --privileged \ | ||
-e DOCKER_IN_DOCKER_ENABLED=true \ | ||
"$IMG" bash -c ' | ||
set -e | ||
cat $ARTIFACTS/docker-info.log | ||
docker run --rm alpine:latest uname -a | ||
' | ||
|
||
echo ">>> K3D test" | ||
docker run --rm --privileged \ | ||
-e DOCKER_IN_DOCKER_ENABLED=true \ | ||
-e K3D_ENABLED=true \ | ||
-e PROVISION_REGISTRY=true \ | ||
"$IMG" bash -c ' | ||
k3d version | ||
k3d cluster get | ||
docker ps | ||
kubectl cluster-info | ||
kubectl run nginx --image=nginx:latest | ||
' | ||
|
||
docker run --rm --privileged \ | ||
"$IMG" bash -c ' | ||
kind version | ||
kind create cluster | ||
docker ps | ||
kubectl cluster-info | ||
kubectl run nginx --image=nginx:latest | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo ">>> Basic checks" | ||
docker run --rm --privileged \ | ||
"$IMG" bash -c ' | ||
set -e | ||
helm version | ||
jobguard -h | ||
env | ||
' | ||
echo "DinD checks" | ||
docker run --rm --privileged \ | ||
-e DOCKER_IN_DOCKER_ENABLED=true \ | ||
"$IMG" bash -c ' | ||
set -e | ||
cat $ARTIFACTS/docker-info.log | ||
docker run --rm alpine:latest uname -a | ||
' | ||
|
||
echo ">>> K3D test" | ||
docker run --rm --privileged \ | ||
-e DOCKER_IN_DOCKER_ENABLED=true \ | ||
-e K3D_ENABLED=true \ | ||
-e PROVISION_REGISTRY=true \ | ||
"$IMG" bash -c ' | ||
k3d version | ||
k3d cluster get | ||
docker ps | ||
kubectl cluster-info | ||
kubectl run nginx --image=nginx:latest | ||
' | ||
echo ">>> NodeJS test" | ||
docker run --rm --privileged \ | ||
"$IMG" bash -c ' | ||
node --version | ||
npm --version | ||
yarn version | ||
' |