Skip to content
Merged
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
4 changes: 1 addition & 3 deletions .github/workflows/_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ jobs:
juju-channel: ["3.6/stable"]
scenario: ["tls_full", "tls_external", "tls_internal", "tls_none"]
include:
- juju-channel: "4.0/beta"
scenario: "tls_full"
- juju-channel: "4.1/beta"
scenario: "tls_full"
scenario: "juju_4"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
paths:
- "**/*.tf"
- "tests/integration/**"

jobs:
lint-terraform:
Expand Down
2 changes: 1 addition & 1 deletion terraform/cos-lite/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ terraform {
version = ">= 1.4.0"
}
}
}
}
33 changes: 33 additions & 0 deletions tests/integration/cos/juju_4/test_upgrade_cos_juju_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Test the deployment of COS in full TLS mode for the current track.

Any pytest file within this parent directory will be run against Juju v4."""

import os
from pathlib import Path

import jubilant
from helpers import generic_assertions, no_errors_in_otelcol_logs

TF_FILE = Path(__file__).parent.parent.resolve() / "tls_full/track-dev.tf"
S3_ENDPOINT = {
"s3_endpoint": os.getenv("S3_ENDPOINT"),
"s3_secret_key": os.getenv("S3_SECRET_KEY"),
"s3_access_key": os.getenv("S3_ACCESS_KEY"),
}


def test_envvars():
assert all(S3_ENDPOINT.values()), (
f"export the following env vars (upper case) before running this test: {S3_ENDPOINT.keys()}"
)


def test_deploy_from_track(
tmp_path, tf_manager, ca_model: jubilant.Juju, cos_model: jubilant.Juju
):
# GIVEN a module deployed with full TLS configuration, providing the most coverage of the TLS
# configuration options
tf_manager.init(TF_FILE)
tf_manager.apply(ca_model=ca_model.model, cos_model=cos_model.model, **S3_ENDPOINT)
generic_assertions(cos_model, ca_model, tmp_path)
no_errors_in_otelcol_logs(cos_model)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Test the deployment of COS in full TLS mode for the current track.

Any pytest file within this parent directory will be run against Juju v4."""

from pathlib import Path

import jubilant
from helpers import generic_assertions

TF_FILE = Path(__file__).parent.parent.resolve() / "tls_full/track-dev.tf"


def test_deploy_from_track(
tmp_path, tf_manager, ca_model: jubilant.Juju, cos_model: jubilant.Juju
):
# GIVEN a module deployed with full TLS configuration, providing the most coverage of the TLS
# configuration options
tf_manager.init(TF_FILE)
tf_manager.apply(ca_model=ca_model.model, cos_model=cos_model.model)
generic_assertions(cos_model, ca_model, tmp_path)
2 changes: 1 addition & 1 deletion tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_tls_context(
# Obtain certificate from external-ca
cert_path = temp_path / "ca.pem"

task = juju.run(f"{ca_name}/0", "get-ca-certificate", {"format": "json"})
task = juju.run(f"{ca_name}/0", "get-ca-certificate")
cert = task.results.get("ca-certificate")
cert_path.write_text(cert)

Expand Down
Loading