Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_terraform_modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
secrets: inherit
with:
k8s-controller: true
terraform-directories: '["terraform/charm"]'
terraform-directories: '["terraform/charm", "terraform/product"]'
2 changes: 2 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ CVE-2025-61723
CVE-2025-61724
CVE-2025-61725
CVE-2025-68121
CVE-2026-25679
CVE-2026-27142
# node
CVE-2025-54419
CVE-2025-9288
Expand Down
68 changes: 68 additions & 0 deletions terraform/product/tests/main.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

provider "juju" {
alias = "opencti_db"
}

run "setup_tests" {
module {
source = "./tests/setup"
}
}

run "basic_deploy" {
command = plan

variables {
model_uuid = run.setup_tests.model_uuid
db_model_uuid = run.setup_tests.db_model_uuid
model_user = run.setup_tests.model_user
db_model_user = run.setup_tests.db_model_user
opencti = {
channel = "latest/edge"
# renovate: depName="opencti"
revision = 83
}
opensearch = {
channel = "2/edge"
# renovate: depName="opensearch"
revision = 337
}
self_signed_certificates = {
channel = "latest/edge"
# renovate: depName="self-signed-certificates"
revision = 601
}
rabbitmq_server = {
channel = "3.9/edge"
# renovate: depName="rabbitmq-server"
revision = 190
}
redis_k8s = {
channel = "latest/edge"
# renovate: depName="redis-k8s"
revision = 42
}
s3_integrator = {
channel = "latest/edge"
# renovate: depName="s3-integrator"
revision = 188
}
s3_integrator_opensearch = {
channel = "latest/edge"
# renovate: depName="s3-integrator"
revision = 188
}
sysconfig = {
channel = "latest/edge"
# renovate: depName="sysconfig"
revision = 158
}
}

assert {
condition = output.app_name == "opencti"
error_message = "opencti app_name did not match expected"
}
}
38 changes: 38 additions & 0 deletions terraform/product/tests/setup/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
version = "~> 1.0"
source = "juju/juju"
}
}
}

provider "juju" {}

resource "juju_model" "k8s_model" {
name = "tf-testing-${formatdate("YYYYMMDDhhmmss", timestamp())}"
}

resource "juju_model" "db_model" {
name = "tf-testing-db-${formatdate("YYYYMMDDhhmmss", timestamp())}"
}

output "model_uuid" {
value = juju_model.k8s_model.uuid
}

output "db_model_uuid" {
value = juju_model.db_model.uuid
}

output "model_user" {
value = "admin"
}

output "db_model_user" {
value = "admin"
}
Loading