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
2 changes: 2 additions & 0 deletions tests/integration/ha_tests/test_self_healing.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
await build_and_deploy(ops_test, 3)


@pytest.mark.unstable
@pytest.mark.parametrize("process", [POSTGRESQL_PROCESS])
async def test_freeze_db_process(
ops_test: OpsTest, process: str, continuous_writes, master_start_timeout
Expand Down Expand Up @@ -85,6 +86,7 @@ async def test_freeze_db_process(
), "secondary not up to date with the cluster after restarting."


@pytest.mark.unstable
@pytest.mark.parametrize("process", DB_PROCESSES)
async def test_restart_db_process(
ops_test: OpsTest, process: str, continuous_writes, master_start_timeout
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ async def test_cluster_is_stable_after_leader_deletion(ops_test: OpsTest) -> Non
assert await get_primary(ops_test, down_unit=primary) != "None"


@pytest.mark.unstable
async def test_scale_down_and_up(ops_test: OpsTest):
"""Test data is replicated to new units after a scale up."""
# Ensure the initial number of units in the application.
Expand Down Expand Up @@ -286,6 +287,7 @@ async def test_application_removal(ops_test: OpsTest) -> None:
assert APP_NAME not in ops_test.model.applications


@pytest.mark.unstable
async def test_redeploy_charm_same_model(ops_test: OpsTest):
"""Redeploy the charm in the same model to test that it works."""
charm = await ops_test.build_charm(".")
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.
from asyncio import gather

import pytest
from pytest_operator.plugin import OpsTest

from tests.integration.helpers import (
Expand Down Expand Up @@ -80,6 +81,7 @@ async def test_finos_waltz_db(ops_test: OpsTest) -> None:
await ops_test.model.remove_application(DATABASE_APP_NAME, block_until_done=True)


@pytest.mark.unstable
async def test_indico_db_blocked(ops_test: OpsTest) -> None:
"""Tests if deploying and relating to Indico charm will block due to requested extensions."""
async with ops_test.fast_forward():
Expand Down
25 changes: 10 additions & 15 deletions tests/integration/test_tls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
import pytest as pytest
from pytest_operator.plugin import OpsTest
from tenacity import Retrying, stop_after_delay, wait_exponential

from tests.helpers import METADATA
from tests.integration.helpers import (
CHARM_SERIES,
DATABASE_APP_NAME,
build_and_deploy,
check_database_creation,
check_database_users_existence,
check_tls,
Expand All @@ -28,6 +28,13 @@
DATABASE_UNITS = 3


@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test: OpsTest) -> None:
"""Build and deploy three units of PostgreSQL."""
await build_and_deploy(ops_test, DATABASE_UNITS, wait_for_idle=False)


@pytest.mark.unstable
async def test_mattermost_db(ops_test: OpsTest) -> None:
"""Deploy Mattermost to test the 'db' relation.

Expand All @@ -36,18 +43,7 @@ async def test_mattermost_db(ops_test: OpsTest) -> None:
Args:
ops_test: The ops test framework
"""
charm = await ops_test.build_charm(".")
async with ops_test.fast_forward():
await ops_test.model.deploy(
charm,
resources={
"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"]
},
application_name=DATABASE_APP_NAME,
num_units=DATABASE_UNITS,
series=CHARM_SERIES,
trust=True,
)
# Deploy TLS Certificates operator.
config = {"generate-self-signed-certificates": "true", "ca-common-name": "Test CA"}
await ops_test.model.deploy(TLS_CERTIFICATES_APP_NAME, channel="beta", config=config)
Expand Down Expand Up @@ -117,8 +113,7 @@ async def test_mattermost_db(ops_test: OpsTest) -> None:
await run_command_on_unit(ops_test, primary, "/charm/bin/pebble start postgresql")
logs = await run_command_on_unit(ops_test, replica, "/charm/bin/pebble logs")
assert (
"connection authorized: user=rewind database=postgres"
" SSL enabled (protocol=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384, bits=256)" in logs
"connection authorized: user=rewind database=postgres SSL enabled" in logs
), "TLS is not being used on pg_rewind connections"

# Deploy and check Mattermost user and database existence.
Expand Down