-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ee10903
commit b6ca1b0
Showing
36 changed files
with
391 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
data "oci_exec_test" "runs" { | ||
digest = var.digest | ||
script = "${path.module}/runs.sh" | ||
variable "target_repository" {} | ||
|
||
module "bash_sandbox" { | ||
source = "../../../tflib/imagetest/sandboxes/bash" | ||
target_repository = var.target_repository | ||
} | ||
|
||
module "dind_test" { | ||
source = "../../../tflib/imagetest/tests/docker-in-docker" | ||
|
||
images = { busybox = var.digest } | ||
|
||
tests = [ | ||
{ | ||
name = "basic functionality" | ||
image = module.bash_sandbox.image_ref | ||
content = [{ source = path.module }] | ||
cmd = "./test.sh" | ||
} | ||
] | ||
} | ||
|
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
image=$(echo "$IMAGES" | jq -r '.crane.ref') | ||
|
||
docker run --rm "${image}" manifest cgr.dev/chainguard/static | ||
docker run --rm "${image}" digest cgr.dev/chainguard/static | ||
docker run --rm "${image}" ls --omit-digest-tags cgr.dev/chainguard/static | ||
docker run --rm "${image}" config cgr.dev/chainguard/static |
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 |
---|---|---|
@@ -1,30 +1,31 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
imagetest = { source = "chainguard-dev/imagetest" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
variable "check-dev" { | ||
default = false | ||
} | ||
variable "target_repository" {} | ||
|
||
data "oci_exec_test" "version" { | ||
digest = var.digest | ||
script = "docker run --rm $IMAGE_NAME --version" | ||
module "bash_sandbox" { | ||
source = "../../../tflib/imagetest/sandboxes/bash" | ||
target_repository = var.target_repository | ||
} | ||
|
||
data "oci_exec_test" "submodule" { | ||
count = var.check-dev ? 1 : 0 | ||
module "dind_test" { | ||
source = "../../../tflib/imagetest/tests/docker-in-docker" | ||
|
||
digest = var.digest | ||
script = "docker run --rm $IMAGE_NAME submodule -h" | ||
} | ||
images = { git = var.digest } | ||
|
||
data "oci_exec_test" "clone" { | ||
digest = var.digest | ||
script = "${path.module}/repo-clone.sh" | ||
tests = [ | ||
{ | ||
name = "smoke" | ||
image = module.bash_sandbox.image_ref | ||
content = [{ source = path.module }] | ||
cmd = "./smoke.sh" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o errtrace -o pipefail -x | ||
|
||
image=$(echo "$IMAGES" | jq -r '.git.ref') | ||
|
||
# Test git version | ||
docker run --rm "${image}" --version | ||
|
||
# Test git submodule help | ||
docker run --rm "${image}" submodule -h | ||
|
||
# Test repo cloning | ||
CLONE_URL="https://github.com/chainguard-images/.github.git" | ||
CLONEDIR="$(mktemp -d)" | ||
chmod go+wrx "${CLONEDIR}" | ||
|
||
# Clone and verify | ||
pushd "${CLONEDIR}" | ||
docker run --rm -v "${PWD}":/w -w /w "${image}" clone --depth 1 "${CLONE_URL}" . | ||
popd | ||
|
||
# Verify clone worked | ||
find "${CLONEDIR}/README.md" && echo "Clone test passed." | ||
|
||
# Cleanup | ||
rm -rf "${CLONEDIR}" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.