-
Notifications
You must be signed in to change notification settings - Fork 154
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
44ba270
commit ea17b47
Showing
8 changed files
with
63 additions
and
33 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
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 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,60 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
imagetest = { source = "chainguard-dev/imagetest" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
locals { parsed = provider::oci::parse(var.digest) } | ||
data "imagetest_inventory" "this" {} | ||
|
||
data "oci_exec_test" "query" { | ||
digest = var.digest | ||
script = "${path.module}/query.sh" | ||
resource "imagetest_container_volume" "this" { | ||
name = "postgresql" | ||
inventory = data.imagetest_inventory.this | ||
} | ||
|
||
data "oci_exec_test" "locale" { | ||
# Avoid name/port collision | ||
depends_on = [data.oci_exec_test.query] | ||
resource "imagetest_harness_docker" "this" { | ||
name = "postgresql-test" | ||
inventory = data.imagetest_inventory.this | ||
|
||
digest = var.digest | ||
script = "${path.module}/locale.sh" | ||
} | ||
privileged = false | ||
|
||
data "oci_exec_test" "tls" { | ||
digest = var.digest | ||
script = "./tls.sh" | ||
working_dir = path.module | ||
envs = { | ||
IMAGE_NAME = var.digest | ||
VOLUME_ID = imagetest_container_volume.this.id | ||
POSTGRES_PASSWORD = "password" | ||
} | ||
mounts = [ | ||
{ | ||
source = path.module | ||
destination = "/tests" | ||
} | ||
] | ||
volumes = [ | ||
{ | ||
source = imagetest_container_volume.this | ||
destination = "/data" | ||
} | ||
] | ||
} | ||
|
||
resource "imagetest_feature" "postgres" { | ||
name = "psql" | ||
description = "Test Postgresql functionalities" | ||
harness = imagetest_harness_docker.this | ||
|
||
steps = [ | ||
{ | ||
name = "Database setup" | ||
cmd = "/tests/query.sh" | ||
}, | ||
{ | ||
name = "TLS enabled Postgres" | ||
cmd = "/tests/tls.sh" | ||
} | ||
] | ||
|
||
labels = { type = "container" } | ||
} |
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