From ac1db5a7bd8c7d26ce90da9c7b7c61be1f33f45b Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Thu, 5 Nov 2026 10:27:26 -0500 Subject: [PATCH 1/6] Added common vm and k8s with pytest --- pyproject.toml | 6 +- tests/integration/charm/ha_tests/__init__.py | 2 + .../charm/ha_tests/clean-data-dir-k8s.sh | 7 + .../charm/ha_tests/clean-data-dir-vm.sh | 4 + tests/integration/charm/ha_tests/conftest.py | 168 ++ tests/integration/charm/ha_tests/helpers.py | 1597 +++++++++++++++++ .../ha_tests/manifests/chaos_network_loss.yml | 16 + .../manifests/extend_pebble_restart_delay.yml | 5 + .../restore_pebble_restart_delay.yml | 5 + .../ha_tests/scripts/deploy_chaos_mesh.sh | 30 + .../ha_tests/scripts/destroy_chaos_mesh.sh | 55 + .../ha_tests/test_logical_replication.py | 443 +++++ .../test_logical_replication_circular.py | 467 +++++ .../charm/ha_tests/test_replication.py | 200 +++ .../charm/ha_tests/test_self_healing_1.py | 183 ++ .../charm/ha_tests/test_self_healing_2.py | 299 +++ .../charm/ha_tests/test_self_healing_3.py | 406 +++++ .../integration/charm/ha_tests/test_smoke.py | 329 ++++ .../charm/ha_tests/test_synchronous_policy.py | 83 + .../charm/new_relations/__init__.py | 2 + .../charm/new_relations/helpers.py | 183 ++ .../new_relations/test_new_relations_1.py | 761 ++++++++ .../new_relations/test_new_relations_2.py | 207 +++ .../new_relations/test_relations_coherence.py | 136 ++ .../charm/pytest_operator_helpers.py | 335 ++++ tests/integration/conftest.py | 17 +- uv.lock | 804 ++++++++- 27 files changed, 6730 insertions(+), 20 deletions(-) create mode 100644 tests/integration/charm/ha_tests/__init__.py create mode 100755 tests/integration/charm/ha_tests/clean-data-dir-k8s.sh create mode 100755 tests/integration/charm/ha_tests/clean-data-dir-vm.sh create mode 100644 tests/integration/charm/ha_tests/conftest.py create mode 100644 tests/integration/charm/ha_tests/helpers.py create mode 100644 tests/integration/charm/ha_tests/manifests/chaos_network_loss.yml create mode 100644 tests/integration/charm/ha_tests/manifests/extend_pebble_restart_delay.yml create mode 100644 tests/integration/charm/ha_tests/manifests/restore_pebble_restart_delay.yml create mode 100755 tests/integration/charm/ha_tests/scripts/deploy_chaos_mesh.sh create mode 100755 tests/integration/charm/ha_tests/scripts/destroy_chaos_mesh.sh create mode 100644 tests/integration/charm/ha_tests/test_logical_replication.py create mode 100644 tests/integration/charm/ha_tests/test_logical_replication_circular.py create mode 100644 tests/integration/charm/ha_tests/test_replication.py create mode 100644 tests/integration/charm/ha_tests/test_self_healing_1.py create mode 100644 tests/integration/charm/ha_tests/test_self_healing_2.py create mode 100644 tests/integration/charm/ha_tests/test_self_healing_3.py create mode 100644 tests/integration/charm/ha_tests/test_smoke.py create mode 100644 tests/integration/charm/ha_tests/test_synchronous_policy.py create mode 100644 tests/integration/charm/new_relations/__init__.py create mode 100644 tests/integration/charm/new_relations/helpers.py create mode 100644 tests/integration/charm/new_relations/test_new_relations_1.py create mode 100644 tests/integration/charm/new_relations/test_new_relations_2.py create mode 100644 tests/integration/charm/new_relations/test_relations_coherence.py create mode 100644 tests/integration/charm/pytest_operator_helpers.py diff --git a/pyproject.toml b/pyproject.toml index 66986108..752186c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,10 +74,13 @@ lint = [ ] unit = [ "coverage[toml]==7.16.2", - "pytest==9.1.1" + "pytest==9.1.1", + "pytest-asyncio==0.21.2", ] integration = [ "pytest==9.1.1", + "pytest-operator==0.43.2", + "juju==3.6.1.3", "jubilant==1.14.0", "allure-pytest==2.16.2", "allure-pytest-default-results==0.1.4", @@ -101,6 +104,7 @@ show_missing = true [tool.pytest.ini_options] minversion = "6.0" log_cli_level = "INFO" +asyncio_mode = "auto" # Linting tools configuration [tool.ruff] diff --git a/tests/integration/charm/ha_tests/__init__.py b/tests/integration/charm/ha_tests/__init__.py new file mode 100644 index 00000000..fa89e9d7 --- /dev/null +++ b/tests/integration/charm/ha_tests/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2026 Canonical Ltd. +# See LICENSE file for licensing details. diff --git a/tests/integration/charm/ha_tests/clean-data-dir-k8s.sh b/tests/integration/charm/ha_tests/clean-data-dir-k8s.sh new file mode 100755 index 00000000..b3c64c72 --- /dev/null +++ b/tests/integration/charm/ha_tests/clean-data-dir-k8s.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail +find /var/lib/pg/archive -mindepth 1 -delete +find /var/lib/pg/data/16/main -mindepth 1 -delete +find /var/lib/pg/logs -mindepth 1 -delete +find /var/lib/pg/temp -mindepth 1 -delete diff --git a/tests/integration/charm/ha_tests/clean-data-dir-vm.sh b/tests/integration/charm/ha_tests/clean-data-dir-vm.sh new file mode 100755 index 00000000..5a93ad14 --- /dev/null +++ b/tests/integration/charm/ha_tests/clean-data-dir-vm.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail +rm -rf /var/snap/charmed-postgresql/common/var/lib/postgresql/* diff --git a/tests/integration/charm/ha_tests/conftest.py b/tests/integration/charm/ha_tests/conftest.py new file mode 100644 index 00000000..d51f4648 --- /dev/null +++ b/tests/integration/charm/ha_tests/conftest.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +from asyncio import gather + +import pytest as pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + ORIGINAL_RESTART_CONDITION, + RESTART_CONDITION, + change_patroni_setting, + change_wal_settings, + deploy_chaos_mesh, + destroy_chaos_mesh, + get_patroni_setting, + get_postgresql_parameter, + modify_pebble_restart_delay, + remove_instance_isolation, + update_restart_condition, +) +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + app_name, + get_password, + run_command_on_unit, +) +from tests.integration.types import Substrate + + +@pytest.fixture() +async def chaos_mesh(ops_test: OpsTest, substrate: Substrate) -> None: + """Deploys chaos mesh to the namespace and uninstalls it at the end (K8s only).""" + if substrate == Substrate.vm: + yield + return + + deploy_chaos_mesh(ops_test.model.info.name) + + yield + + remove_instance_isolation(ops_test) + destroy_chaos_mesh(ops_test.model.info.name) + + +@pytest.fixture() +async def continuous_writes(ops_test: OpsTest) -> None: + """Deploy the charm that makes continuous writes to PostgreSQL.""" + yield + # Clear the written data at the end. + for attempt in Retrying(stop=stop_after_delay(60 * 5), wait=wait_fixed(3), reraise=True): + with attempt: + action = ( + await ops_test.model + .applications[APPLICATION_NAME] + .units[0] + .run_action("clear-continuous-writes") + ) + await action.wait() + assert action.results["result"] == "True", "Unable to clear up continuous_writes table" + + +@pytest.fixture() +async def loop_wait(ops_test: OpsTest) -> None: + """Temporary change the loop wait configuration.""" + # Change the parameter that makes Patroni wait for some more time before restarting PostgreSQL. + initial_loop_wait = await get_patroni_setting(ops_test, "loop_wait") + yield + # Rollback to the initial configuration. + patroni_password = await get_password(ops_test, "patroni") + await change_patroni_setting( + ops_test, "loop_wait", initial_loop_wait, patroni_password, use_random_unit=True + ) + + +@pytest.fixture(scope="module") +async def primary_start_timeout(ops_test: OpsTest) -> None: + """Temporary change the primary start timeout configuration.""" + # Change the parameter that makes the primary reelection faster. + patroni_password = await get_password(ops_test, "patroni") + initial_primary_start_timeout = await get_patroni_setting(ops_test, "primary_start_timeout") + await change_patroni_setting(ops_test, "primary_start_timeout", 0, patroni_password) + yield + # Rollback to the initial configuration. + await change_patroni_setting( + ops_test, + "primary_start_timeout", + initial_primary_start_timeout, + patroni_password, + use_random_unit=True, + ) + + +@pytest.fixture() +async def reset_restart_condition(ops_test: OpsTest, substrate: Substrate): + """Resets service file delay on all units (VM only).""" + if substrate == Substrate.k8s: + yield + return + + app = await app_name(ops_test) + + awaits = [] + for unit in ops_test.model.applications[app].units: + awaits.append(update_restart_condition(ops_test, unit, RESTART_CONDITION)) + await gather(*awaits) + + yield + + awaits = [] + for unit in ops_test.model.applications[app].units: + awaits.append(update_restart_condition(ops_test, unit, ORIGINAL_RESTART_CONDITION)) + await gather(*awaits) + + +@pytest.fixture() +async def restart_policy(ops_test: OpsTest, substrate: Substrate) -> None: + """Sets and resets service pebble restart policy on all units (K8s only).""" + if substrate == Substrate.vm: + yield + return + + app = await app_name(ops_test) + + for unit in ops_test.model.applications[app].units: + await modify_pebble_restart_delay( + ops_test, + unit.name, + "tests/integration/charm/ha_tests/manifests/extend_pebble_restart_delay.yml", + ) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[app], + status="active", + raise_on_blocked=True, + timeout=5 * 60, + idle_period=30, + ) + + yield + + +@pytest.fixture() +async def wal_settings(ops_test: OpsTest, substrate: Substrate) -> None: + """Restore the WAL settings to the initial values.""" + # Get the value for each setting. + initial_max_wal_size = await get_postgresql_parameter(ops_test, "max_wal_size") + initial_min_wal_size = await get_postgresql_parameter(ops_test, "min_wal_size") + initial_wal_keep_segments = await get_postgresql_parameter(ops_test, "wal_keep_segments") + yield + app = await app_name(ops_test) + for unit in ops_test.model.applications[app].units: + if substrate == Substrate.vm: + # Start Patroni if it was previously stopped. + await run_command_on_unit(ops_test, unit.name, "snap start charmed-postgresql.patroni") + patroni_password = await get_password(ops_test, "patroni") + + # Rollback to the initial settings. + await change_wal_settings( + ops_test, + unit.name, + initial_max_wal_size, + initial_min_wal_size, + initial_wal_keep_segments, + patroni_password, + ) diff --git a/tests/integration/charm/ha_tests/helpers.py b/tests/integration/charm/ha_tests/helpers.py new file mode 100644 index 00000000..0af50ceb --- /dev/null +++ b/tests/integration/charm/ha_tests/helpers.py @@ -0,0 +1,1597 @@ +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import asyncio +import contextlib +import json +import logging +import os +import random +import string +import subprocess +import tarfile +import tempfile +from datetime import datetime +from tempfile import mkstemp + +import kubernetes as kubernetes +import psycopg2 +import requests +import yaml +from juju.model import Model +from kubernetes import config +from kubernetes.client.api import core_v1_api +from kubernetes.stream import stream +from lightkube.core.client import Client, GlobalResource +from lightkube.core.exceptions import ApiError +from lightkube.resources.core_v1 import ( + PersistentVolume, + PersistentVolumeClaim, + Pod, +) +from pytest_operator.plugin import OpsTest +from tenacity import ( + RetryError, + Retrying, + stop_after_attempt, + stop_after_delay, + wait_fixed, +) + +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + KUBECTL, + PGDATA_PATH, + app_name, + get_password, + get_patroni_cluster, + get_primary, + get_substrate, + get_unit_address, + run_command_on_unit, +) +from tests.integration.helpers.postgresql import db_connect, execute_query +from tests.integration.types import Substrate + +logger = logging.getLogger(__name__) + +SERVICE_NAME = "snap.charmed-postgresql.patroni.service" +PATRONI_SERVICE_DEFAULT_PATH = f"/etc/systemd/system/{SERVICE_NAME}" +RESTART_CONDITION = "no" +ORIGINAL_RESTART_CONDITION = "always" + + +class MemberNotListedOnClusterError(Exception): + """Raised when a member is not listed in the cluster.""" + + +class MemberNotUpdatedOnClusterError(Exception): + """Raised when a member is not yet updated in the cluster.""" + + +class ProcessError(Exception): + """Raised when a process fails.""" + + +class ProcessRunningError(Exception): + """Raised when a process is running when it is not expected to be.""" + + +async def are_all_db_processes_down(ops_test: OpsTest, process: str, signal: str) -> bool: + """Verifies that all units of the charm do not have the DB process running.""" + app = await app_name(ops_test) + pgrep_cmd = ("pgrep", "-f", process) if "/" in process else ("pgrep", "-x", process) + + try: + for attempt in Retrying(stop=stop_after_delay(400), wait=wait_fixed(3)): + with attempt: + running_process = False + for unit in ops_test.model.applications[app].units: + if get_substrate(ops_test) == Substrate.vm: + _, processes, _ = await ops_test.juju("ssh", unit.name, *pgrep_cmd) + + # Splitting processes by "\n" results in one or more empty lines, hence we + # need to process these lines accordingly. + processes = [proc for proc in processes.split("\n") if len(proc) > 0] + + # If something was returned, there is a running process. + is_running = len(processes) > 0 + else: + pod_name = unit.name.replace("/", "-") + call = subprocess.run( + f"{KUBECTL} -n {ops_test.model.info.name} exec {pod_name} -c postgresql -- {' '.join(pgrep_cmd)}", + shell=True, + ) + + # If something was returned, there is a running process. + is_running = call.returncode != 1 + + if is_running: + logger.info(f"Unit {unit.name} not yet down") + # Try to rekill the unit + await send_signal_to_process(ops_test, unit.name, process, signal) + running_process = True + if running_process: + raise ProcessRunningError + except RetryError: + return False + + return True + + +async def are_writes_increasing( + ops_test, + down_unit: str | None = None, + use_ip_from_inside: bool = False, + extra_model: Model = None, +) -> None: + """Verify new writes are continuing by counting the number of writes.""" + if get_substrate(ops_test) == Substrate.vm: + down_units = [down_unit] if isinstance(down_unit, str) or not down_unit else down_unit + writes, _ = await count_writes( + ops_test, + down_unit=down_units[0], + use_ip_from_inside=use_ip_from_inside, + extra_model=extra_model, + ) + logger.info(f"Initial writes {writes}") + + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + more_writes, _ = await count_writes( + ops_test, + down_unit=down_units[0], + use_ip_from_inside=use_ip_from_inside, + extra_model=extra_model, + ) + logger.info(f"Retry writes {more_writes}") + for member, count in writes.items(): + if "/".join(member.split(".", 1)[-1].rsplit("-", 1)) in down_units: + continue + assert more_writes[member] > count, ( + f"{member}: writes not continuing to DB (current writes: {more_writes[member]} - previous writes: {count})" + ) + return + + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3), reraise=True): + with attempt: + writes, _ = await count_writes(ops_test, down_unit=down_unit, extra_model=extra_model) + assert len(writes), "No units report count" + logger.info(f"Initial writes {writes}") + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + more_writes, _ = await count_writes( + ops_test, down_unit=down_unit, extra_model=extra_model + ) + logger.info(f"Retry writes {more_writes}") + members_checked = [] + for member, count in writes.items(): + if member in more_writes: + members_checked.append(member) + assert more_writes[member] > count, ( + f"{member}: writes not continuing to DB (current writes: {more_writes[member]} - previous writes: {count})" + ) + assert len(members_checked), "No member checked from the initial writes" + + +async def change_patroni_setting( + ops_test: OpsTest, + setting: str, + value: int | bool, + password: str, + use_random_unit: bool = False, + tls: bool = False, +) -> None: + """Change the value of one of the Patroni settings. + + Args: + ops_test: ops_test instance. + setting: the name of the setting. + value: the value to assign to the setting. + password: Patroni password. + use_random_unit: whether to use a random unit (default is False, + so it uses the primary). + tls: if Patroni is serving using tls. + """ + for attempt in Retrying(stop=stop_after_delay(30 * 2), wait=wait_fixed(3)): + with attempt: + app = await app_name(ops_test) + if use_random_unit: + unit = get_random_unit(ops_test, app) + unit_ip = await get_unit_address(ops_test, unit) + else: + primary_name = await get_primary(ops_test, app) + unit_ip = await get_unit_address(ops_test, primary_name) + requests.patch( + f"https://{unit_ip}:8008/config", + json={setting: value}, + verify=False, + auth=requests.auth.HTTPBasicAuth("patroni", password), + ) + + +async def is_cluster_updated( + ops_test: OpsTest, primary_name: str, use_ip_from_inside: bool = False +) -> None: + # Verify that the old primary is now a replica. + logger.info("checking that the former primary is now a replica") + assert await is_replica(ops_test, primary_name, use_ip_from_inside), ( + "there are more than one primary in the cluster." + ) + + # Verify that all units are part of the same cluster. + logger.info("checking that all units are part of the same cluster") + member_ips = await fetch_cluster_members(ops_test, use_ip_from_inside) + app = primary_name.split("/")[0] + ip_addresses = [ + await ( + get_ip_from_inside_the_unit(ops_test, unit.name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit.name) + ) + for unit in ops_test.model.applications[app].units + ] + assert set(member_ips) == set(ip_addresses), "not all units are part of the same cluster." + + # Verify that no writes to the database were missed after stopping the writes. + logger.info("checking that no writes to the database were missed after stopping the writes") + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + total_expected_writes = await check_writes(ops_test, use_ip_from_inside) + + # Verify that old primary is up-to-date. + logger.info("checking that the former primary is up to date with the cluster after restarting") + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + assert await is_secondary_up_to_date( + ops_test, primary_name, total_expected_writes, use_ip_from_inside + ), f"secondary ({primary_name}) not up to date with the cluster after restarting." + + +async def check_writes( + ops_test, use_ip_from_inside: bool = False, extra_model: Model = None +) -> int: + """Gets the total writes from the test charm and compares to the writes from db.""" + total_expected_writes = await stop_continuous_writes(ops_test) + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + actual_writes, max_number_written = await count_writes( + ops_test, use_ip_from_inside=use_ip_from_inside, extra_model=extra_model + ) + for member, count in actual_writes.items(): + logger.info( + f"member: {member}, count: {count}, max_number_written: {max_number_written[member]}, total_expected_writes: {total_expected_writes}" + ) + assert count == max_number_written[member], ( + f"{member}: writes to the db were missed: count of actual writes ({count}) on {member} different from the max number written ({max_number_written[member]})." + ) + assert total_expected_writes == count, f"{member}: writes to the db were missed." + return total_expected_writes + + +def copy_file_into_pod( + client: kubernetes.client.api.core_v1_api.CoreV1Api, + namespace: str, + pod_name: str, + container_name: str, + destination_path: str, + source_path: str, +) -> None: + """Copy file contents into pod. + + Args: + client: The kubernetes CoreV1Api client + namespace: The namespace of the pod to copy files to + pod_name: The name of the pod to copy files to + container_name: The name of the pod container to copy files to + destination_path: The path to which the file should be copied over + source_path: The path of the file which needs to be copied over + """ + try: + exec_command = ["tar", "xvf", "-", "-C", "/"] + + api_response = kubernetes.stream.stream( + client.connect_get_namespaced_pod_exec, + pod_name, + namespace, + container=container_name, + command=exec_command, + stdin=True, + stdout=True, + stderr=True, + tty=False, + _preload_content=False, + ) + + with tempfile.TemporaryFile() as tar_buffer: + with tarfile.open(fileobj=tar_buffer, mode="w") as tar: + tar.add(source_path, destination_path) + + tar_buffer.seek(0) + commands = [] + commands.append(tar_buffer.read()) + + while api_response.is_open(): + api_response.update(timeout=1) + + if commands: + command = commands.pop(0) + api_response.write_stdin(command.decode()) + else: + break + + api_response.close() + except kubernetes.client.rest.ApiException: + assert False + + +async def count_writes( # noqa: C901 + ops_test: OpsTest, + down_unit: str | None = None, + use_ip_from_inside: bool = False, + extra_model: Model = None, +) -> tuple[dict[str, int], dict[str, int]]: + """Count the number of writes in the database.""" + app = await app_name(ops_test) + password = await get_password(ops_test, database_app_name=app) + members = [] + if get_substrate(ops_test) == Substrate.vm: + for model in [ops_test.model, extra_model]: + if model is None: + continue + for unit in model.applications[app].units: + if unit.name != down_unit: + members_data = get_patroni_cluster( + await ( + get_ip_from_inside_the_unit(ops_test, unit.name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit.name) + ) + )["members"] + for member_data in members_data: + member_data["model"] = model.info.name + members.extend(members_data) + break + down_ips = [] + if down_unit: + for unit in ops_test.model.applications[app].units: + if unit.name == down_unit: + down_ips.append(unit.public_address) + down_ips.append(await get_unit_ip(ops_test, unit.name)) + return count_writes_on_members(members, password, down_ips) + + for model in [ops_test.model, extra_model]: + if model is None: + continue + status = await model.get_status() + for unit_name, unit in status["applications"][app]["units"].items(): + if unit_name != down_unit: + members_data = get_patroni_cluster(unit["address"])["members"] + for _, member_data in enumerate(members_data): + member_data["model"] = model.info.name + members.extend(members_data) + break + + count = {} + maximum = {} + for member in members: + if member["role"] != "replica" and member["host"].split(".")[0] != ( + down_unit or "" + ).replace("/", "-"): + host = member["host"] + + # Translate the service hostname to an IP address. + client = Client(namespace=member["model"]) + service = client.get(Pod, name=host.split(".")[0]) + ip = service.status.podIP + + connection_string = ( + f"dbname='{APPLICATION_NAME.replace('-', '_')}_database' user='operator'" + f" host='{ip}' password='{password}' connect_timeout=10" + ) + + member_name = f"{member['model']}.{member['name']}" + connection = None + try: + with ( + psycopg2.connect(connection_string) as connection, + connection.cursor() as cursor, + ): + cursor.execute("SELECT COUNT(number), MAX(number) FROM continuous_writes;") + results = cursor.fetchone() + count[member_name] = results[0] + maximum[member_name] = results[1] + except psycopg2.Error: + # Error raised when the connection is not possible. + count[member_name] = -1 + maximum[member_name] = -1 + finally: + if connection is not None: + connection.close() + return count, maximum + + +def count_writes_on_members(members, password, down_ips) -> tuple[dict[str, int], dict[str, int]]: + count = {} + maximum = {} + for member in members: + if member["role"] != "replica" and member["host"] not in down_ips: + host = member["host"] + + connection_string = ( + f"dbname='{APPLICATION_NAME.replace('-', '_')}_database' user='operator'" + f" host='{host}' password='{password}' connect_timeout=10" + ) + + member_name = f"{member['model']}.{member['name']}" + connection = None + try: + with ( + psycopg2.connect(connection_string) as connection, + connection.cursor() as cursor, + ): + cursor.execute("SELECT COUNT(number), MAX(number) FROM continuous_writes;") + results = cursor.fetchone() + count[member_name] = results[0] + maximum[member_name] = results[1] + except psycopg2.Error: + # Error raised when the connection is not possible. + count[member_name] = -1 + maximum[member_name] = -1 + finally: + if connection is not None: + connection.close() + return count, maximum + + +async def fetch_cluster_members(ops_test: OpsTest, use_ip_from_inside: bool = False): + """Fetches the IPs listed by Patroni as cluster members. + + Args: + ops_test: OpsTest instance. + use_ip_from_inside: whether to use the IP from inside the unit. + """ + app = await app_name(ops_test) + member_ips = {} + if get_substrate(ops_test) == Substrate.vm: + for unit in ops_test.model.applications[app].units: + unit_ip = await ( + get_ip_from_inside_the_unit(ops_test, unit.name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit.name) + ) + cluster_info = requests.get(f"https://{unit_ip}:8008/cluster", verify=False) + if len(member_ips) > 0: + # If the list of members IPs was already fetched, also compare the + # list provided by other members. + assert member_ips == { + member["host"] for member in cluster_info.json()["members"] + }, "members report different lists of cluster members." + else: + member_ips = {member["host"] for member in cluster_info.json()["members"]} + return member_ips + + def get_host_ip(host: str) -> str: + # Translate the pod hostname to an IP address. + model = ops_test.model.info + client = Client(namespace=model.name) + pod = client.get(Pod, name=host.split(".")[0]) + return pod.status.podIP + + for unit in ops_test.model.applications[app].units: + unit_address = await get_unit_address(ops_test, unit.name) + cluster_info = requests.get(f"https://{unit_address}:8008/cluster", verify=False) + if len(member_ips) > 0: + # If the list of members IPs was already fetched, also compare the + # list provided by other members. + assert member_ips == { + get_host_ip(member["host"]) for member in cluster_info.json()["members"] + }, "members report different lists of cluster members." + else: + member_ips = {get_host_ip(member["host"]) for member in cluster_info.json()["members"]} + return member_ips + + +async def get_ip_from_inside_the_unit(ops_test: OpsTest, unit_name: str) -> str: + command = f"exec --unit {unit_name} -- hostname -I" + return_code, stdout, stderr = await ops_test.juju(*command.split()) + if return_code != 0: + raise ProcessError( + "Expected command %s to succeed instead it failed: %s %s", command, return_code, stderr + ) + return stdout.splitlines()[0].strip() + + +async def get_patroni_setting(ops_test: OpsTest, setting: str, tls: bool = False) -> int | None: + """Get the value of one of the integer Patroni settings. + + Args: + ops_test: ops_test instance. + setting: the name of the setting. + tls: if Patroni is serving using tls. + + Returns: + the value of the configuration or None if it's using the default value. + """ + for attempt in Retrying(stop=stop_after_delay(30 * 2), wait=wait_fixed(3)): + with attempt: + app = await app_name(ops_test) + primary_name = await get_primary(ops_test, app) + unit_ip = await get_unit_address(ops_test, primary_name) + configuration_info = requests.get(f"https://{unit_ip}:8008/config", verify=False) + value = configuration_info.json().get(setting) + return int(value) if value is not None else None + + +def get_random_unit(ops_test: OpsTest, app: str) -> str: + """Returns a random unit name.""" + return random.choice(ops_test.model.applications[app].units).name + + +async def get_unit_ip(ops_test: OpsTest, unit_name: str, model: Model = None) -> str: + """Wrapper for getting unit ip. + + Args: + ops_test: The ops test object passed into every test case + unit_name: The name of the unit to get the address + model: Optional model instance to use + Returns: + The (str) ip of the unit + """ + if get_substrate(ops_test) == Substrate.k8s: + return await get_unit_address(ops_test, unit_name) + if model is None: + application = unit_name.split("/")[0] + for unit in ops_test.model.applications[application].units: + if unit.name == unit_name: + break + return await instance_ip(ops_test, unit.machine.hostname) + else: + return await get_unit_address(ops_test, unit_name) + + +async def is_replica(ops_test: OpsTest, unit_name: str, use_ip_from_inside: bool = False) -> bool: + """Returns whether the unit a replica in the cluster.""" + unit_ip = await ( + get_ip_from_inside_the_unit(ops_test, unit_name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit_name) + ) + member_name = unit_name.replace("/", "-") + + try: + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3)): + with attempt: + cluster_info = requests.get(f"https://{unit_ip}:8008/cluster", verify=False) + + # The unit may take some time to be listed on Patroni REST API cluster endpoint. + if member_name not in { + member["name"] for member in cluster_info.json()["members"] + }: + raise MemberNotListedOnClusterError() + + for member in cluster_info.json()["members"]: + if member["name"] == member_name: + role = member["role"] + + # A member that restarted has the DB process stopped may + # take some time to know that a new primary was elected. + if role != "leader": + return True + else: + raise MemberNotUpdatedOnClusterError() + except RetryError: + return False + + +async def get_cluster_roles( + ops_test: OpsTest, unit_name: str, use_ip_from_inside: bool = False +) -> dict[str, str | list[str] | None]: + """Returns whether the unit a replica in the cluster.""" + unit_ip = await ( + get_ip_from_inside_the_unit(ops_test, unit_name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit_name) + ) + + members = {"replicas": [], "primaries": [], "sync_standbys": []} + member_list = get_patroni_cluster(unit_ip)["members"] + logger.info(f"Cluster members are: {member_list}") + for member in member_list: + role = member["role"] + name = "/".join(member["name"].rsplit("-", 1)) + if role == "leader": + members["primaries"].append(name) + elif role == "sync_standby": + members["sync_standbys"].append(name) + else: + members["replicas"].append(name) + + return members + + +async def instance_ip(ops_test: OpsTest, instance: str) -> str: + """Translate juju instance name to IP. + + Args: + ops_test: pytest ops test helper + instance: The name of the instance + + Returns: + The (str) IP address of the instance + """ + _, output, _ = await ops_test.juju("machines") + + for line in output.splitlines(): + if instance in line: + return line.split()[2] + + +async def modify_pebble_restart_delay( + ops_test: OpsTest, + unit_name: str, + pebble_plan_path: str, + ensure_replan: bool = False, +) -> None: + """Modify the pebble restart delay of the underlying process. + + Args: + ops_test: The ops test framework + unit_name: The name of unit to extend the pebble restart delay for + pebble_plan_path: Path to the file with the modified pebble plan + ensure_replan: Whether to check that the replan command succeeded + """ + kubernetes.config.load_kube_config() + client = kubernetes.client.api.core_v1_api.CoreV1Api() + + pod_name = unit_name.replace("/", "-") + container_name = "postgresql" + service_name = "postgresql" + now = datetime.now().isoformat() + + copy_file_into_pod( + client, + ops_test.model.info.name, + pod_name, + container_name, + f"/tmp/pebble_plan_{now}.yml", + pebble_plan_path, + ) + + add_to_pebble_layer_commands = ( + f"/charm/bin/pebble add --combine {service_name} /tmp/pebble_plan_{now}.yml" + ) + response = kubernetes.stream.stream( + client.connect_get_namespaced_pod_exec, + pod_name, + ops_test.model.info.name, + container=container_name, + command=add_to_pebble_layer_commands.split(), + stdin=False, + stdout=True, + stderr=True, + tty=False, + _preload_content=False, + ) + response.run_forever(timeout=5) + assert response.returncode == 0, ( + f"Failed to add to pebble layer, unit={unit_name}, container={container_name}, service={service_name}" + ) + + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3), reraise=True): + with attempt: + replan_pebble_layer_commands = "/charm/bin/pebble replan" + response = kubernetes.stream.stream( + client.connect_get_namespaced_pod_exec, + pod_name, + ops_test.model.info.name, + container=container_name, + command=replan_pebble_layer_commands.split(), + stdin=False, + stdout=True, + stderr=True, + tty=False, + _preload_content=False, + ) + response.run_forever(timeout=60) + if ensure_replan and response.returncode != 0: + assert response.returncode == 0, ( + f"Failed to replan pebble layer, unit={unit_name}, container={container_name}, service={service_name}" + ) + + +async def send_signal_to_process( # noqa: C901 + ops_test: OpsTest, unit_name: str, process: str, signal: str, use_ssh: bool = False +) -> None: + """Send a signal to an OS process on a specific unit. + + Args: + ops_test: The ops test framework instance + unit_name: The name of the unit to run the command on + process: OS process name + signal: Signal that will be sent to the OS process + (examples: SIGKILL, SIGTERM, SIGSTOP, SIGCONT) + use_ssh: whether to use juju ssh instead of kubernetes client (K8s only). + + Returns: + the command output if it succeeds, otherwise raises an exception. + """ + # Killing or freezing the only instance can be disastrous. + app = await app_name(ops_test) + if len(ops_test.model.applications[app].units) < 2: + await ops_test.model.applications[app].add_unit(count=1) + await ops_test.model.wait_for_idle(apps=[app], status="active", timeout=1000) + + opt = "-f" if "/" in process else "-x" + + if get_substrate(ops_test) == Substrate.vm: + command = f"exec --unit {unit_name} -- pkill --signal {signal} {opt} {process}" + + # Send the signal. + return_code, _, _ = await ops_test.juju(*command.split()) + if signal != "SIGCONT" and return_code != 0: + raise ProcessError( + "Expected command %s to succeed instead it failed: %s", + command, + return_code, + ) + return + + pod_name = unit_name.replace("/", "-") + + if signal not in ["SIGSTOP", "SIGCONT"]: + _, old_pid, _ = await ops_test.juju( + "ssh", "--container", "postgresql", unit_name, "pgrep", opt, process + ) + + command = f"pkill --signal {signal} {opt} {process}" + + if use_ssh: + kill_cmd = f"ssh {unit_name} {command}" + return_code, _, _ = await asyncio.wait_for(ops_test.juju(*kill_cmd.split()), 10) + if return_code != 0: + raise ProcessError( + "Expected command %s to succeed instead it failed: %s", + command, + return_code, + ) + return + + # Load Kubernetes configuration to connect to the cluster. + config.load_kube_config() + + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + # Send the signal. + response = stream( + core_v1_api.CoreV1Api().connect_get_namespaced_pod_exec, + pod_name, + ops_test.model.info.name, + container="postgresql", + command=command.split(), + stderr=True, + stdin=False, + stdout=True, + tty=False, + _preload_content=False, + ) + + response.run_forever(timeout=10) + + if signal not in ["SIGSTOP", "SIGCONT"]: + _, raw_pid, _ = await ops_test.juju( + "ssh", "--container", "postgresql", unit_name, "pgrep", opt, process + ) + + # If the same output was returned, process was not restarted. + if raw_pid == old_pid: + raise ProcessRunningError + elif response.returncode != 0: + raise ProcessError( + "Expected command %s to succeed instead it failed: %s", + command, + response.returncode, + ) + + +async def is_postgresql_ready(ops_test, unit_name: str, use_ip_from_inside: bool = False) -> bool: + """Verifies a PostgreSQL instance is running and available.""" + unit_ip = ( + (await get_ip_from_inside_the_unit(ops_test, unit_name)) + if use_ip_from_inside + else await get_unit_address(ops_test, unit_name) + ) + try: + for attempt in Retrying(stop=stop_after_delay(60 * 10), wait=wait_fixed(3)): + with attempt: + instance_health_info = requests.get(f"https://{unit_ip}:8008/health", verify=False) + assert instance_health_info.status_code == 200 + except RetryError: + return False + + return True + + +async def is_secondary_up_to_date( + ops_test: OpsTest, unit_name: str, expected_writes: int, use_ip_from_inside: bool = False +) -> bool: + """Checks if secondary is up-to-date with the cluster. + + Retries over the period of one minute to give secondary adequate time to copy over data. + """ + app = await app_name(ops_test) + password = await get_password(ops_test, database_app_name=app) + if get_substrate(ops_test) == Substrate.vm: + host = await next( + ( + get_ip_from_inside_the_unit(ops_test, unit.name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit.name) + ) + for unit in ops_test.model.applications[app].units + if unit.name == unit_name + ) + else: + status = await ops_test.model.get_status() + host = status["applications"][app]["units"][unit_name]["address"] + connection_string = ( + f"dbname='{APPLICATION_NAME.replace('-', '_')}_database' user='operator'" + f" host='{host}' password='{password}' connect_timeout=10" + ) + + try: + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3)): + with ( + attempt, + psycopg2.connect(connection_string) as connection, + connection.cursor() as cursor, + ): + cursor.execute("SELECT COUNT(number), MAX(number) FROM continuous_writes;") + results = cursor.fetchone() + if get_substrate(ops_test) == Substrate.vm: + assert results[0] == expected_writes and results[1] == expected_writes + elif results[0] != expected_writes or results[1] != expected_writes: + async with ops_test.fast_forward(fast_interval="30s"): + await ops_test.model.wait_for_idle( + apps=[unit_name.split("/")[0]], idle_period=15, timeout=1000 + ) + raise Exception + except RetryError: + return False + finally: + connection.close() + + return True + + +async def start_continuous_writes(ops_test: OpsTest, app: str, model: Model = None) -> None: + """Start continuous writes to PostgreSQL.""" + # Start the process by relating the application to the database or + # by calling the action if the relation already exists. + if model is None: + model = ops_test.model + relations = [ + relation + for relation in model.applications[app].relations + if not relation.is_peer + and f"{relation.requires.application_name}:{relation.requires.name}" + == f"{APPLICATION_NAME}:database" + ] + if not relations: + await model.relate(app, f"{APPLICATION_NAME}:database") + await model.wait_for_idle( + apps=[APPLICATION_NAME, app], status="active", timeout=1000, idle_period=30 + ) + for attempt in Retrying(stop=stop_after_delay(60 * 5), wait=wait_fixed(3), reraise=True): + with attempt: + action = ( + await model + .applications[APPLICATION_NAME] + .units[0] + .run_action("start-continuous-writes") + ) + await action.wait() + assert action.results["result"] == "True", "Unable to create continuous_writes table" + + +async def stop_continuous_writes(ops_test: OpsTest) -> int: + """Stops continuous writes to PostgreSQL and returns the last written value.""" + action = ( + await ops_test.model + .applications[APPLICATION_NAME] + .units[0] + .run_action("stop-continuous-writes") + ) + action = await action.wait() + return int(action.results["writes"]) + + +async def update_restart_condition(ops_test: OpsTest, unit, condition: str): + """Updates the restart condition in the DB service file. + + When the DB service fails it will now wait for `delay` number of seconds. + """ + # Load the service file from the unit and update it with the new delay. + _, temp_path = mkstemp() + await unit.scp_from(source=PATRONI_SERVICE_DEFAULT_PATH, destination=temp_path) + with open(temp_path) as patroni_service_file: + patroni_service = patroni_service_file.readlines() + + for index, line in enumerate(patroni_service): + if "Restart=" in line: + patroni_service[index] = f"Restart={condition}\n" + + with open(temp_path, "w") as service_file: + service_file.writelines(patroni_service) + + # Upload the changed file back to the unit, we cannot scp this file directly to + # PATRONI_SERVICE_DEFAULT_PATH since this directory has strict permissions, instead we scp it + # elsewhere and then move it to PATRONI_SERVICE_DEFAULT_PATH. + await unit.scp_to(source=temp_path, destination="patroni.service") + mv_cmd = f"mv /home/ubuntu/patroni.service {PATRONI_SERVICE_DEFAULT_PATH}" + await run_command_on_unit(ops_test, unit.name, mv_cmd) + + # Remove temporary file from machine. + os.remove(temp_path) + + # Reload the daemon for systemd otherwise changes are not saved. + reload_cmd = "systemctl daemon-reload" + await run_command_on_unit(ops_test, unit.name, reload_cmd) + start_cmd = f"systemctl start {SERVICE_NAME}" + await run_command_on_unit(ops_test, unit.name, start_cmd) + + await is_postgresql_ready(ops_test, unit.name) + + +def storage_type(ops_test, app): + """Retrieves type of storage associated with an application. + + Note: this function exists as a temporary solution until this issue is ported to libjuju 2: + https://github.com/juju/python-libjuju/issues/694 + """ + model_name = ops_test.model.info.name + proc = subprocess.check_output(f"juju storage --model={model_name}".split()) + proc = proc.decode("utf-8") + for line in proc.splitlines(): + if "Storage" in line: + continue + + if len(line) == 0: + continue + + if "detached" in line: + continue + + unit_name = line.split()[0] + app_name = unit_name.split("/")[0] + if app_name == app: + return line.split()[3] + + +async def get_storage_ids(ops_test: OpsTest, unit_name: str) -> list[str]: + """Retrieves storage ids associated with provided unit (only the data storage on K8s). + + Note: this function exists as a temporary solution until this issue is ported to libjuju 2: + https://github.com/juju/python-libjuju/issues/694 + """ + storage_ids = [] + model_name = ops_test.model.info.name + proc = subprocess.check_output( + f"juju storage --model={ops_test.controller_name}:{model_name}".split() + ) + proc = proc.decode("utf-8") + for line in proc.splitlines(): + if "Storage" in line: + continue + + if len(line) == 0: + continue + + if "detached" in line: + continue + + if line.split()[0] == unit_name and ( + get_substrate(ops_test) == Substrate.vm or line.split()[1].startswith("data") + ): + storage_ids.append(line.split()[1]) + return storage_ids + + +async def add_unit_with_storage(ops_test, app, storages): + """Adds unit with storages. + + Note: this function exists as a temporary solution until this issue is resolved: + https://github.com/juju/python-libjuju/issues/695 + """ + original_units = {unit.name for unit in ops_test.model.applications[app].units} + model_name = ops_test.model.info.name + add_unit_cmd = f"add-unit {app} --model={model_name}" + for storage in storages: + add_unit_cmd = add_unit_cmd + f" --attach-storage={storage}" + add_unit_cmd = add_unit_cmd.split() + return_code, _, _ = await ops_test.juju(*add_unit_cmd) + assert return_code == 0, "Failed to add unit with storage" + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active", timeout=2000) + + # When removing all units sometimes the last unit remain in the list + current_units = {unit.name for unit in ops_test.model.applications[app].units} + original_units.intersection_update(current_units) + assert original_units.issubset(current_units), "New unit not added to model" + + # verify storage attached + new_unit = (current_units - original_units).pop() + assert sorted(await get_storage_ids(ops_test, new_unit)) == sorted(storages), ( + "unit added with incorrect storage" + ) + + # return a reference to newly added unit + for unit in ops_test.model.applications[app].units: + if unit.name == new_unit: + return unit + + +async def reused_replica_storage(ops_test: OpsTest, unit_name) -> bool: + """Returns True if storage provided to Postgresql has been reused. + + Checks Patroni logs for when the database was in archive mode. + """ + await run_command_on_unit( + ops_test, + unit_name, + "grep 'Database cluster state: in archive recovery' " + "/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log*", + ) + return True + + +async def is_storage_exists(ops_test: OpsTest, storage_id: str) -> bool: + """Returns True if storage exists by provided storage ID.""" + complete_command = [ + "show-storage", + "-m", + f"{ops_test.controller_name}:{ops_test.model.info.name}", + storage_id, + "--format=json", + ] + return_code, stdout, _ = await ops_test.juju(*complete_command) + if return_code != 0: + if return_code == 1: + return storage_id in stdout + raise Exception( + "Expected command %s to succeed instead it failed: %s with code: ", + complete_command, + stdout, + return_code, + ) + return storage_id in str(stdout) + + +async def create_db(ops_test: OpsTest, app: str, db: str) -> None: + """Creates database with specified name.""" + unit = ops_test.model.applications[app].units[0] + unit_address = await get_unit_address(ops_test, unit.name) + password = await get_password(ops_test, database_app_name=app) + + conn = db_connect(unit_address, password) + conn.autocommit = True + cursor = conn.cursor() + cursor.execute(f"CREATE DATABASE {db};") + cursor.close() + conn.close() + + +async def check_db(ops_test: OpsTest, app: str, db: str) -> bool: + """Returns True if database with specified name already exists.""" + unit = ops_test.model.applications[app].units[0] + unit_address = await get_unit_address(ops_test, unit.name) + password = await get_password(ops_test, database_app_name=app) + + assert password is not None + + query = execute_query( + unit_address, + password, + f"select datname from pg_catalog.pg_database where datname = '{db}';", + ) + + if "ERROR" in query: + raise Exception(f"Database check is failed with postgresql err: {query}") + + return db in query + + +async def get_detached_storages(ops_test: OpsTest) -> list[str]: + """Returns the current available detached storages (only the data storage on K8s).""" + return_code, storages_list, stderr = await ops_test.juju( + "storage", "-m", f"{ops_test.controller_name}:{ops_test.model.info.name}", "--format=json" + ) + if return_code != 0: + raise Exception(f"failed to get storages info with error: {stderr}") + + parsed_storages_list = json.loads(storages_list) + detached_storages = [] + for storage_name, storage in parsed_storages_list["storage"].items(): + if ( + (get_substrate(ops_test) == Substrate.vm or storage_name.startswith("data")) + and (str(storage["status"]["current"]) == "detached") + and (str(storage["life"] == "alive")) + ): + detached_storages.append(storage_name) + + if len(detached_storages) > 0: + return detached_storages + + raise Exception("failed to get deatached storage") + + +async def check_password_auth(ops_test: OpsTest, unit_name: str) -> bool: + """Checks if "operator" password is valid for current postgresql db.""" + complete_command = [ + "exec", + "--unit", + unit_name, + "--", + "grep", + "-E", + "'password'", + "/var/snap/charmed-postgresql/common/var/log/postgresql/postgresql*", + ] + return_code, stdout, _ = await ops_test.juju(*complete_command) + if return_code != 0: + raise Exception( + "Expected command %s to succeed. Instead it failed: %s with code: ", + complete_command, + stdout, + return_code, + ) + return 'password authentication failed for user "operator"' not in stdout + + +async def check_system_id_mismatch(ops_test: OpsTest, unit_name: str) -> bool: + """Returns True if system id mismatch if found in logs.""" + log_str = f"CRITICAL: system ID mismatch, node {unit_name.replace('/', '-')} belongs to a different cluster" + stdout = await run_command_on_unit( + ops_test, + unit_name, + "cat /var/lib/pg/logs/16/main/patroni_logs/patroni.log*", + ) + + return log_str in str(stdout) + + +def delete_pvc(ops_test: OpsTest, pvc: GlobalResource): + """Deletes PersistentVolumeClaim.""" + client = Client(namespace=ops_test.model.name) + try: + client.delete(PersistentVolumeClaim, namespace=ops_test.model.name, name=pvc.metadata.name) + except ApiError as e: + logger.warning(f"failed to delete pvc {pvc.metadata.name}: {e}") + pass + + +def get_pvcs(ops_test: OpsTest, unit_name: str): + """Get PersistentVolumeClaims for unit.""" + pvcs = {} + client = Client(namespace=ops_test.model.name) + pvc_list = client.list(PersistentVolumeClaim, namespace=ops_test.model.name) + unit_label = unit_name.replace("/", "-") + for pvc in pvc_list: + if unit_label in pvc.metadata.name: + pvc_storage_name = pvc.metadata.name.replace(unit_name.split("/")[0], "").split("-")[1] + logger.info(f"got pvc for {pvc_storage_name} storage: {pvc.metadata.name}") + pvcs[pvc_storage_name] = pvc + return pvcs + + +def get_pvs(ops_test: OpsTest, unit_name: str): + """Get PersistentVolumes for unit.""" + pvs = {} + client = Client(namespace=ops_test.model.name) + pv_list = client.list(PersistentVolume, namespace=ops_test.model.name) + unit_label = unit_name.replace("/", "-") + for pv in pv_list: + if pv.spec.claimRef and pv.spec.claimRef.name.endswith(unit_label): + pvc_storage_name = pv.spec.claimRef.name.replace(unit_name.split("/")[0], "").split( + "-" + )[1] + logger.info(f"got pv for {pvc_storage_name} storage: {pv.metadata.name}") + pvs[pvc_storage_name] = pv + return pvs + + +def change_pvs_reclaim_policy( + ops_test: OpsTest, pvs_configs: dict[str, PersistentVolume], policy: str +): + """Change PersistentVolume reclaim policy config value.""" + client = Client(namespace=ops_test.model.name) + results = {} + for pvc_storage_name, pv_config in pvs_configs.items(): + results[pvc_storage_name] = client.patch( + PersistentVolume, + pv_config.metadata.name, + {"spec": {"persistentVolumeReclaimPolicy": f"{policy}"}}, + namespace=ops_test.model.name, + ) + return results + + +def remove_pv_claimref(ops_test: OpsTest, pv_config: PersistentVolume): + """Remove claimRef config value for PersistentVolume.""" + client = Client(namespace=ops_test.model.name) + client.patch( + PersistentVolume, + pv_config.metadata.name, + {"spec": {"claimRef": None}}, + namespace=ops_test.model.name, + ) + + +def change_pvc_pv_name( + pvc_config: PersistentVolumeClaim, pv_name_new: str +) -> PersistentVolumeClaim: + """Change PersistentVolume name config value for PersistentVolumeClaim.""" + pvc_config.spec.volumeName = pv_name_new + del pvc_config.metadata.annotations["pv.kubernetes.io/bind-completed"] + del pvc_config.metadata.uid + return pvc_config + + +def apply_pvc_config(ops_test: OpsTest, pvc_config: PersistentVolumeClaim): + """Apply provided PersistentVolumeClaim config.""" + client = Client(namespace=ops_test.model.name) + pvc_config.metadata.managedFields = None + client.apply(pvc_config, namespace=ops_test.model.name, field_manager="lightkube") + + +async def remove_unit_force(ops_test: OpsTest, num_units: int): + """Removes unit with --force --no-wait.""" + app_name_str = await app_name(ops_test) + scale = len(ops_test.model.applications[app_name_str].units) - num_units + complete_command = [ + "remove-unit", + f"{app_name_str}", + "--force", + "--no-wait", + "--no-prompt", + "--num-units", + num_units, + ] + return_code, stdout, stderr = await ops_test.juju(*complete_command) + if return_code != 0: + raise Exception( + "Expected command %s to succeed instead it failed: %s with err: %s with code: %s", + complete_command, + stdout, + stderr, + return_code, + ) + + if scale == 0: + await ops_test.model.block_until( + lambda: len(ops_test.model.applications[app_name_str].units) == scale, + timeout=1000, + ) + else: + await ops_test.model.wait_for_idle( + apps=[app_name_str], + status="active", + timeout=1000, + wait_for_exact_units=scale, + ) + + +async def change_wal_settings( + ops_test: OpsTest, + unit_name: str, + max_wal_size: int, + min_wal_size, + wal_keep_segments, + password: str, +) -> None: + """Change WAL settings in the unit. + + Args: + ops_test: ops_test instance. + unit_name: name of the unit to change the WAL settings. + max_wal_size: maximum amount of WAL to keep (MB). + min_wal_size: minimum amount of WAL to keep (MB). + wal_keep_segments: number of WAL segments to keep. + password: Patroni password. + """ + for attempt in Retrying(stop=stop_after_delay(30 * 2), wait=wait_fixed(3)): + with attempt: + unit_ip = await get_unit_address(ops_test, unit_name) + requests.patch( + f"https://{unit_ip}:8008/config", + json={ + "postgresql": { + "parameters": { + "max_wal_size": max_wal_size, + "min_wal_size": min_wal_size, + "wal_keep_segments": wal_keep_segments, + } + } + }, + verify=False, + auth=requests.auth.HTTPBasicAuth("patroni", password), + ) + + +async def get_postgresql_parameter(ops_test: OpsTest, parameter_name: str) -> int | None: + """Get the value of a PostgreSQL parameter from Patroni API. + + Args: + ops_test: ops_test instance. + parameter_name: the name of the parameter to get the value for. + + Returns: + the value of the requested PostgreSQL parameter. + """ + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + app = await app_name(ops_test) + primary_name = await get_primary(ops_test, app) + unit_ip = await get_unit_address(ops_test, primary_name) + configuration_info = requests.get(f"https://{unit_ip}:8008/config", verify=False) + postgresql_dict = configuration_info.json().get("postgresql") + if postgresql_dict is None: + return None + parameters = postgresql_dict.get("parameters") + if parameters is None: + return None + parameter_value = parameters.get(parameter_name) + return parameter_value + + +async def list_wal_files(ops_test: OpsTest, app: str) -> set: + """Returns the list of WAL segment files in each unit.""" + units = [unit.name for unit in ops_test.model.applications[app].units] + files = {} + if get_substrate(ops_test) == Substrate.vm: + command = "ls -1 /var/snap/charmed-postgresql/common/var/lib/postgresql/16/main/pg_wal/" + for unit in units: + stdout = await run_command_on_unit(ops_test, unit, command) + files[unit] = stdout.splitlines() + files[unit] = { + i for i in files[unit] if ".history" not in i and i != "" and i != "archive_status" + } + return files + + command = f"ls -1 {PGDATA_PATH}/pg_wal/" + for unit in units: + complete_command = f"run --unit {unit} -- {command}" + _, stdout, _ = await ops_test.juju(*complete_command.split()) + files[unit] = stdout.splitlines() + files[unit] = { + i for i in files[unit] if ".history" not in i and i != "" and i != "archive_status" + } + return files + + +async def is_connection_possible( + ops_test: OpsTest, unit_name: str, use_ip_from_inside: bool = False +) -> bool: + """Test a connection to a PostgreSQL server.""" + try: + app = unit_name.split("/")[0] + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3)): + with attempt: + password = await asyncio.wait_for( + get_password(ops_test, database_app_name=app), 15 + ) + address = await asyncio.wait_for( + get_ip_from_inside_the_unit(ops_test, unit_name) + if use_ip_from_inside + else get_unit_ip(ops_test, unit_name), + 15, + ) + + with ( + db_connect(host=address, password=password) as connection, + connection.cursor() as cursor, + ): + cursor.execute("SELECT 1;") + success = cursor.fetchone()[0] == 1 + connection.close() + + if not success: + raise Exception + return True + except RetryError: + # Error raised when the connection is not possible. + return False + + +def cut_network_from_unit(machine_name: str) -> None: + """Cut network from a lxc container. + + Args: + machine_name: lxc container hostname + """ + # apply a mask (device type `none`) + cut_network_command = f"lxc config device add {machine_name} eth0 none" + subprocess.check_call(cut_network_command.split()) + + +def cut_network_from_unit_without_ip_change(machine_name: str) -> None: + """Cut network from a lxc container (without causing the change of the unit IP address). + + Args: + machine_name: lxc container hostname + """ + override_command = f"lxc config device override {machine_name} eth0" + # Ignore if the interface was already overridden. + with contextlib.suppress(subprocess.CalledProcessError): + subprocess.check_call(override_command.split()) + limit_set_command = f"lxc config device set {machine_name} eth0 limits.egress=0kbit" + subprocess.check_call(limit_set_command.split()) + limit_set_command = f"lxc config device set {machine_name} eth0 limits.ingress=1kbit" + subprocess.check_call(limit_set_command.split()) + limit_set_command = f"lxc config device set {machine_name} eth0 limits.priority=10" + subprocess.check_call(limit_set_command.split()) + + +async def get_controller_machine(ops_test: OpsTest) -> str: + """Return controller machine hostname. + + Args: + ops_test: The ops test framework instance + + Returns: + Controller hostname (str) + """ + _, raw_controller, _ = await ops_test.juju("show-controller") + + controller = yaml.safe_load(raw_controller.strip()) + + return next( + machine.get("instance-id") + for machine in controller[ops_test.controller_name]["controller-machines"].values() + ) + + +def is_machine_reachable_from(origin_machine: str, target_machine: str) -> bool: + """Test network reachability between hosts. + + Args: + origin_machine: hostname of the machine to test connection from + target_machine: hostname of the machine to test connection to + """ + try: + subprocess.check_call(f"lxc exec {origin_machine} -- ping -c 3 {target_machine}".split()) + return True + except subprocess.CalledProcessError: + return False + + +def restore_network_for_unit(machine_name: str) -> None: + """Restore network from a lxc container. + + Args: + machine_name: lxc container hostname + """ + # remove mask from eth0 + restore_network_command = f"lxc config device remove {machine_name} eth0" + subprocess.check_call(restore_network_command.split()) + + +def restore_network_for_unit_without_ip_change(machine_name: str) -> None: + """Restore network from a lxc container (without causing the change of the unit IP address). + + Args: + machine_name: lxc container hostname + """ + limit_set_command = f"lxc config device set {machine_name} eth0 limits.egress=" + subprocess.check_call(limit_set_command.split()) + limit_set_command = f"lxc config device set {machine_name} eth0 limits.ingress=" + subprocess.check_call(limit_set_command.split()) + limit_set_command = f"lxc config device set {machine_name} eth0 limits.priority=" + subprocess.check_call(limit_set_command.split()) + + +async def wait_network_restore(ops_test: OpsTest, unit_name: str, old_ip: str) -> None: + """Wait until network is restored. + + Args: + ops_test: pytest plugin helper + unit_name: name of the unit + old_ip: old registered IP address + """ + # Retrieve the unit IP from inside the unit because it may not be updated in the + # Juju status too quickly. + if (await get_ip_from_inside_the_unit(ops_test, unit_name)) == old_ip: + raise Exception + + +def get_member_lag(cluster: dict, member_name: str) -> int: + """Return the lag of a specific member.""" + for member in cluster["members"]: + if member["name"] == member_name.replace("/", "-"): + return member.get("lag", 0) + return 0 + + +async def is_member_isolated( + ops_test: OpsTest, not_isolated_member: str, isolated_member: str +) -> bool: + """Check whether the member is isolated from the cluster.""" + # Check if the lag is too high. + unit_ip = await get_unit_address(ops_test, not_isolated_member) + try: + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + cluster_info = get_patroni_cluster(unit_ip) + lag = get_member_lag(cluster_info, isolated_member) + assert lag > 1000 + except RetryError: + return False + + return True + + +def deploy_chaos_mesh(namespace: str) -> None: + """Deploy chaos mesh to the provided namespace. + + Args: + namespace: The namespace to deploy chaos mesh to + """ + env = os.environ + env["KUBECONFIG"] = os.path.expanduser("~/.kube/config") + + subprocess.check_output( + " ".join([ + "tests/integration/charm/ha_tests/scripts/deploy_chaos_mesh.sh", + namespace, + ]), + shell=True, + env=env, + ) + + +def destroy_chaos_mesh(namespace: str) -> None: + """Remove chaos mesh from the provided namespace. + + Args: + namespace: The namespace to deploy chaos mesh to + """ + env = os.environ + env["KUBECONFIG"] = os.path.expanduser("~/.kube/config") + + subprocess.check_output( + f"tests/integration/charm/ha_tests/scripts/destroy_chaos_mesh.sh {namespace}", + shell=True, + env=env, + ) + + +def isolate_instance_from_cluster(ops_test: OpsTest, unit_name: str) -> None: + """Apply a NetworkChaos file to use chaos-mesh to simulate a network cut.""" + with tempfile.NamedTemporaryFile() as temp_file: + with open( + "tests/integration/charm/ha_tests/manifests/chaos_network_loss.yml" + ) as chaos_network_loss_file: + template = string.Template(chaos_network_loss_file.read()) + chaos_network_loss = template.substitute( + namespace=ops_test.model.info.name, + pod=unit_name.replace("/", "-"), + ) + + temp_file.write(str.encode(chaos_network_loss)) + temp_file.flush() + + env = os.environ + env["KUBECONFIG"] = os.path.expanduser("~/.kube/config") + subprocess.check_output( + " ".join([*KUBECTL.split(), "apply", "-f", temp_file.name]), shell=True, env=env + ) + + +def remove_instance_isolation(ops_test: OpsTest) -> None: + """Delete the NetworkChaos that is isolating the primary unit of the cluster.""" + env = os.environ + env["KUBECONFIG"] = os.path.expanduser("~/.kube/config") + subprocess.check_output( + f"{KUBECTL} -n {ops_test.model.info.name} delete --ignore-not-found=true networkchaos network-loss-primary", + shell=True, + env=env, + ) diff --git a/tests/integration/charm/ha_tests/manifests/chaos_network_loss.yml b/tests/integration/charm/ha_tests/manifests/chaos_network_loss.yml new file mode 100644 index 00000000..09691862 --- /dev/null +++ b/tests/integration/charm/ha_tests/manifests/chaos_network_loss.yml @@ -0,0 +1,16 @@ +apiVersion: chaos-mesh.org/v1alpha1 +kind: NetworkChaos +metadata: + name: network-loss-primary + namespace: $namespace +spec: + action: loss + mode: one + selector: + pods: + $namespace: + - $pod + loss: + loss: "100" + correlation: "100" + duration: "60m" diff --git a/tests/integration/charm/ha_tests/manifests/extend_pebble_restart_delay.yml b/tests/integration/charm/ha_tests/manifests/extend_pebble_restart_delay.yml new file mode 100644 index 00000000..e64cd17e --- /dev/null +++ b/tests/integration/charm/ha_tests/manifests/extend_pebble_restart_delay.yml @@ -0,0 +1,5 @@ +services: + postgresql: + override: merge + backoff-delay: 150s + backoff-limit: 150s diff --git a/tests/integration/charm/ha_tests/manifests/restore_pebble_restart_delay.yml b/tests/integration/charm/ha_tests/manifests/restore_pebble_restart_delay.yml new file mode 100644 index 00000000..1b8f8a5e --- /dev/null +++ b/tests/integration/charm/ha_tests/manifests/restore_pebble_restart_delay.yml @@ -0,0 +1,5 @@ +services: + postgresql: + override: merge + backoff-delay: 500ms + backoff-limit: 30s diff --git a/tests/integration/charm/ha_tests/scripts/deploy_chaos_mesh.sh b/tests/integration/charm/ha_tests/scripts/deploy_chaos_mesh.sh new file mode 100755 index 00000000..ad5513d3 --- /dev/null +++ b/tests/integration/charm/ha_tests/scripts/deploy_chaos_mesh.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -Eeuo pipefail + +chaos_mesh_ns=$1 +chaos_mesh_version="2.4.1" + +if [ -z "${chaos_mesh_ns}" ]; then + echo "Error: missing mandatory argument. Aborting" >&2 + exit 1 +fi + +deploy_chaos_mesh() { + echo "adding chaos-mesh helm repo" + sudo k8s helm repo add chaos-mesh https://charts.chaos-mesh.org + + echo "installing chaos-mesh" + sudo k8s helm install chaos-mesh chaos-mesh/chaos-mesh \ + --namespace="${chaos_mesh_ns}" \ + --set chaosDaemon.runtime=containerd \ + --set chaosDaemon.socketPath=/run/containerd/containerd.sock \ + --set dashboard.create=false \ + --version "${chaos_mesh_version}" \ + --set clusterScoped=false \ + --set controllerManager.targetNamespace="${chaos_mesh_ns}" + sleep 10 +} + +echo "namespace=${chaos_mesh_ns}" +deploy_chaos_mesh diff --git a/tests/integration/charm/ha_tests/scripts/destroy_chaos_mesh.sh b/tests/integration/charm/ha_tests/scripts/destroy_chaos_mesh.sh new file mode 100755 index 00000000..e02cbb51 --- /dev/null +++ b/tests/integration/charm/ha_tests/scripts/destroy_chaos_mesh.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -Eeuo pipefail + +chaos_mesh_ns=$1 + +if [ -z "${chaos_mesh_ns}" ]; then + echo "Error: missing mandatory argument. Aborting" >&2 + exit 1 +fi + +destroy_chaos_mesh() { + echo "deleting api-resources" + for i in $(sudo k8s kubectl api-resources | awk '/chaos-mesh/ {print $1}'); do + timeout 30 sudo k8s kubectl delete "${i}" --all --all-namespaces || true + done + + if sudo k8s kubectl get mutatingwebhookconfiguration | grep -q 'chaos-mesh-mutation'; then + timeout 30 sudo k8s kubectl delete mutatingwebhookconfiguration chaos-mesh-mutation || true + fi + + if sudo k8s kubectl get validatingwebhookconfiguration | grep -q 'chaos-mesh-validation-auth'; then + timeout 30 sudo k8s kubectl delete validatingwebhookconfiguration chaos-mesh-validation-auth || true + fi + + if sudo k8s kubectl get validatingwebhookconfiguration | grep -q 'chaos-mesh-validation'; then + timeout 30 sudo k8s kubectl delete validatingwebhookconfiguration chaos-mesh-validation || true + fi + + if sudo k8s kubectl get clusterrolebinding | grep -q 'chaos-mesh'; then + echo "deleting clusterrolebindings" + readarray -t args < <(sudo k8s kubectl get clusterrolebinding | awk '/chaos-mesh/ {print $1}') + timeout 30 sudo k8s kubectl delete clusterrolebinding "${args[@]}" || true + fi + + if sudo k8s kubectl get clusterrole | grep -q 'chaos-mesh'; then + echo "deleting clusterroles" + readarray -t args < <(sudo k8s kubectl get clusterrole | awk '/chaos-mesh/ {print $1}') + timeout 30 sudo k8s kubectl delete clusterrole "${args[@]}" || true + fi + + if sudo k8s kubectl get crd | grep -q 'chaos-mesh.org'; then + echo "deleting crds" + readarray -t args < <(sudo k8s kubectl get crd | awk '/chaos-mesh.org/ {print $1}') + timeout 30 sudo k8s kubectl delete crd "${args[@]}" || true + fi + + if [ -n "${chaos_mesh_ns}" ] && sudo k8s helm repo list --namespace="${chaos_mesh_ns}" | grep -q 'chaos-mesh'; then + echo "uninstalling chaos-mesh helm repo" + sudo k8s helm uninstall chaos-mesh --namespace="${chaos_mesh_ns}" || true + fi +} + +echo "Destroying chaos mesh in ${chaos_mesh_ns}" +destroy_chaos_mesh diff --git a/tests/integration/charm/ha_tests/test_logical_replication.py b/tests/integration/charm/ha_tests/test_logical_replication.py new file mode 100644 index 00000000..905620e9 --- /dev/null +++ b/tests/integration/charm/ha_tests/test_logical_replication.py @@ -0,0 +1,443 @@ +# Copyright 2025 Canonical Ltd. +# See LICENSE file for licensing details. + +import json +from asyncio import gather + +import psycopg2 +import pytest as pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import get_cluster_roles +from tests.integration.charm.new_relations.helpers import build_connection_string +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE, get_leader_unit +from tests.integration.types import Substrate + +DATABASE_APP_NAME = "postgresql" +SECOND_DATABASE_APP_NAME = "postgresql2" +THIRD_DATABASE_APP_NAME = "postgresql3" + +DATA_INTEGRATOR_APP_NAME = "data-integrator" +SECOND_DATA_INTEGRATOR_APP_NAME = "data-integrator2" +THIRD_DATA_INTEGRATOR_APP_NAME = "data-integrator3" +DATA_INTEGRATOR_RELATION = "postgresql" + +DATABASE_APP_CONFIG = {"profile": "testing"} + +TESTING_DATABASE = "testdb" + +FAST_INTERVAL = "60s" +TIMEOUT = 10 * 60 + + +@pytest.mark.abort_on_fail +async def test_deploy(ops_test: OpsTest, charm, charm_resources, substrate: Substrate): + await gather( + ops_test.model.deploy( + charm, + application_name=DATABASE_APP_NAME, + num_units=3, + base=CHARM_BASE, + config=DATABASE_APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + charm, + application_name=SECOND_DATABASE_APP_NAME, + num_units=3, + base=CHARM_BASE, + config=DATABASE_APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + charm, + application_name=THIRD_DATABASE_APP_NAME, + num_units=1, + base=CHARM_BASE, + config=DATABASE_APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + DATA_INTEGRATOR_APP_NAME, + application_name=DATA_INTEGRATOR_APP_NAME, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ops_test.model.deploy( + DATA_INTEGRATOR_APP_NAME, + application_name=SECOND_DATA_INTEGRATOR_APP_NAME, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ops_test.model.deploy( + DATA_INTEGRATOR_APP_NAME, + application_name=THIRD_DATA_INTEGRATOR_APP_NAME, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, SECOND_DATABASE_APP_NAME, THIRD_DATABASE_APP_NAME], + status="active", + timeout=2500, + # There can be error spikes during PostgreSQL deployment, that are not related to Logical Replication + raise_on_error=False, + ) + if substrate == Substrate.vm: + async with ops_test.fast_forward(fast_interval=FAST_INTERVAL): + await gather( + ops_test.model.integrate(DATABASE_APP_NAME, DATA_INTEGRATOR_APP_NAME), + ops_test.model.integrate( + SECOND_DATABASE_APP_NAME, SECOND_DATA_INTEGRATOR_APP_NAME + ), + ops_test.model.integrate(THIRD_DATABASE_APP_NAME, THIRD_DATA_INTEGRATOR_APP_NAME), + ops_test.model.integrate( + f"{DATABASE_APP_NAME}:logical-replication-offer", + f"{SECOND_DATABASE_APP_NAME}:logical-replication", + ), + ) + await ops_test.model.wait_for_idle(status="active", timeout=TIMEOUT) + else: + # No fast_forward: at the 10s update-status cadence every hook runs the + # charm_refresh app-databag flip-flop + DPH status recompute, keeping units + # ~100% "executing" under load, so wait_for_idle never sees an idle window. + # The integration is relation-event driven and needs no cadence. + await gather( + ops_test.model.integrate(DATABASE_APP_NAME, DATA_INTEGRATOR_APP_NAME), + ops_test.model.integrate(SECOND_DATABASE_APP_NAME, SECOND_DATA_INTEGRATOR_APP_NAME), + ops_test.model.integrate(THIRD_DATABASE_APP_NAME, THIRD_DATA_INTEGRATOR_APP_NAME), + ops_test.model.integrate( + f"{DATABASE_APP_NAME}:logical-replication-offer", + f"{SECOND_DATABASE_APP_NAME}:logical-replication", + ), + ) + await ops_test.model.wait_for_idle(status="active", timeout=900) + + +@pytest.mark.abort_on_fail +async def test_pg2_publisher_error(ops_test: OpsTest): + await _create_test_table(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME) + + pg2_config = DATABASE_APP_CONFIG.copy() + pg2_config["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.test_table"] + }) + await ops_test.model.applications[SECOND_DATABASE_APP_NAME].set_config(pg2_config) + + await _wait_for_leader_on_blocked(ops_test, SECOND_DATABASE_APP_NAME) + + +@pytest.mark.abort_on_fail +async def test_pg3_local_error(ops_test: OpsTest): + pg3_config = DATABASE_APP_CONFIG.copy() + pg3_config["logical-replication-subscription-request"] = json.dumps({ + "bad_database": ["bad_format"] + }) + await ops_test.model.applications[THIRD_DATABASE_APP_NAME].set_config(pg3_config) + await _wait_for_leader_on_blocked(ops_test, THIRD_DATABASE_APP_NAME) + + await ops_test.model.integrate( + f"{DATABASE_APP_NAME}:logical-replication-offer", + f"{THIRD_DATABASE_APP_NAME}:logical-replication", + ) + await _wait_for_leader_on_blocked(ops_test, THIRD_DATABASE_APP_NAME) + + pg3_config["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.test_table2"] + }) + await ops_test.model.applications[THIRD_DATABASE_APP_NAME].set_config(pg3_config) + await _wait_for_leader_on_blocked(ops_test, THIRD_DATABASE_APP_NAME) + + +@pytest.mark.abort_on_fail +async def test_resolve_errors(ops_test: OpsTest, substrate: Substrate): + await gather( + _create_test_table(ops_test, DATA_INTEGRATOR_APP_NAME), + _create_test_table(ops_test, DATA_INTEGRATOR_APP_NAME, "test_table2"), + _create_test_table(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "test_table2"), + ) + + await _wait_for_active(ops_test, substrate) + + +@pytest.mark.abort_on_fail +async def test_replication(ops_test: OpsTest): + await gather( + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "first"), + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "first", "test_table2"), + ) + + await gather( + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "first"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "first", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_switchover(ops_test: OpsTest, substrate: Substrate): + publisher_leader = await get_leader_unit(ops_test, DATABASE_APP_NAME) + publisher_roles = await get_cluster_roles(ops_test, publisher_leader.name) + publisher_candidate = ops_test.model.units[publisher_roles["sync_standbys"][0]] + action = await publisher_candidate.run_action("promote-to-primary", scope="unit", force=True) + await action.wait() + + subscriber_leader = await get_leader_unit(ops_test, SECOND_DATABASE_APP_NAME) + subscriber_roles = await get_cluster_roles(ops_test, subscriber_leader.name) + subscriber_candidate = ops_test.model.units[subscriber_roles["sync_standbys"][0]] + action = await subscriber_candidate.run_action("promote-to-primary", scope="unit", force=True) + await action.wait() + + await _wait_for_active(ops_test, substrate) + + +@pytest.mark.abort_on_fail +async def test_replication_after_switchover(ops_test: OpsTest): + await gather( + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "second"), + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "second", "test_table2"), + ) + await gather( + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "second"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "second", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_pg3_extend_subscription(ops_test: OpsTest, substrate: Substrate): + await _create_test_table(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME) + + pg3_config = DATABASE_APP_CONFIG.copy() + pg3_config["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.test_table", "public.test_table2"] + }) + await ops_test.model.applications[THIRD_DATABASE_APP_NAME].set_config(pg3_config) + + await _wait_for_active(ops_test, substrate) + + await gather( + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "second"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "second", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_pg2_change_subscription(ops_test: OpsTest, substrate: Substrate): + await _create_test_table(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "test_table2") + + pg2_config = DATABASE_APP_CONFIG.copy() + pg2_config["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.test_table2"] + }) + await ops_test.model.applications[SECOND_DATABASE_APP_NAME].set_config(pg2_config) + + await _wait_for_active(ops_test, substrate) + + await gather( + _check_test_data( + ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "second" + ), # old data will be left behind + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "second", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_replication_after_subscriptions_changes(ops_test: OpsTest): + await gather( + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "third"), + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "third", "test_table2"), + ) + await gather( + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "second"), + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "third", "test_table2"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "third"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "third", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_pg2_dynamic_error(ops_test: OpsTest): + pg2_config = DATABASE_APP_CONFIG.copy() + pg2_config["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.test_table", "public.test_table2"] + }) + await ops_test.model.applications[SECOND_DATABASE_APP_NAME].set_config(pg2_config) + await _wait_for_leader_on_blocked(ops_test, SECOND_DATABASE_APP_NAME) + + +@pytest.mark.abort_on_fail +async def test_replication_during_dynamic_error(ops_test: OpsTest): + await gather( + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "fourth"), + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "fourth", "test_table2"), + ) + await gather( + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "second"), + _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "fourth", "test_table2"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "fourth"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "fourth", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_pg2_resolve_dynamic_error(ops_test: OpsTest, substrate: Substrate): + connection_string = await build_connection_string( + ops_test, + SECOND_DATA_INTEGRATOR_APP_NAME, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + with ( + psycopg2.connect(connection_string) as connection, + connection.cursor() as cursor, + ): + connection.autocommit = True + cursor.execute("DELETE FROM test_table;") + await _wait_for_active(ops_test, substrate) + await _check_test_data(ops_test, SECOND_DATA_INTEGRATOR_APP_NAME, "fourth") + + +@pytest.mark.abort_on_fail +async def test_pg2_remove(ops_test: OpsTest, substrate: Substrate): + await ops_test.model.remove_application(SECOND_DATA_INTEGRATOR_APP_NAME, block_until_done=True) + await ops_test.model.remove_application(SECOND_DATABASE_APP_NAME, block_until_done=True) + await _wait_for_active(ops_test, substrate, vm_timeout=1000) + connection_string = await build_connection_string( + ops_test, + DATA_INTEGRATOR_APP_NAME, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + cursor.execute("SELECT COUNT(1) FROM pg_replication_slots where slot_type='logical';") + assert cursor.fetchone()[0] == 1, ( + "unused replication slot should be removed in the publisher cluster" + ) + + +@pytest.mark.abort_on_fail +async def test_replication_after_pg2_removal(ops_test: OpsTest): + await gather( + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "fifth"), + _insert_test_data(ops_test, DATA_INTEGRATOR_APP_NAME, "fifth", "test_table2"), + ) + await gather( + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "fifth"), + _check_test_data(ops_test, THIRD_DATA_INTEGRATOR_APP_NAME, "fifth", "test_table2"), + ) + + +@pytest.mark.abort_on_fail +async def test_pg3_remove_relation(ops_test: OpsTest, substrate: Substrate): + await ops_test.model.applications[DATABASE_APP_NAME].remove_relation( + f"{DATABASE_APP_NAME}:logical-replication-offer", + f"{THIRD_DATABASE_APP_NAME}:logical-replication", + ) + await _wait_for_active(ops_test, substrate) + connection_string = await build_connection_string( + ops_test, + THIRD_DATA_INTEGRATOR_APP_NAME, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + cursor.execute("SELECT COUNT(1) FROM pg_subscription;") + assert cursor.fetchone()[0] == 0, ( + "unused PostgreSQL subscription should be removed in the subscriber cluster" + ) + + +async def _wait_for_active( + ops_test: OpsTest, substrate: Substrate, vm_timeout: int = TIMEOUT +) -> None: + if substrate == Substrate.vm: + async with ops_test.fast_forward(fast_interval=FAST_INTERVAL): + await ops_test.model.wait_for_idle(status="active", timeout=vm_timeout) + else: + async with ops_test.fast_forward(): + # Idle windows under fast_forward are 3-9s (10s update-status cadence), + # so juju's default 15s idle requirement is unsatisfiable here. + await ops_test.model.wait_for_idle(status="active", timeout=1800, idle_period=2) + + +async def _wait_for_leader_on_blocked(ops_test: OpsTest, app_name: str) -> None: + leader_unit = await get_leader_unit(ops_test, app_name) + await ops_test.model.block_until(lambda: leader_unit.workload_status == "blocked") + + +async def _create_test_table( + ops_test: OpsTest, data_integrator_app_name: str, table_name: str = "test_table" +) -> None: + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + connection.autocommit = True + with connection.cursor() as cursor: + cursor.execute(f"CREATE TABLE {table_name} (test_column text);") + finally: + if connection is not None: + connection.close() + + +async def _insert_test_data( + ops_test: OpsTest, data_integrator_app_name: str, data: str, table_name: str = "test_table" +) -> None: + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + connection.autocommit = True + with connection.cursor() as cursor: + cursor.execute( + f"INSERT INTO {table_name} (test_column) VALUES (%s);", + (data,), + ) + finally: + if connection is not None: + connection.close() + + +async def _check_test_data( + ops_test: OpsTest, data_integrator_app_name: str, data: str, table_name: str = "test_table" +) -> bool: + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + with connection.cursor() as cursor: + cursor.execute( + f"SELECT EXISTS (SELECT 1 FROM {table_name} WHERE test_column = %s);", + (data,), + ) + return cursor.fetchone()[0] + finally: + if connection is not None: + connection.close() diff --git a/tests/integration/charm/ha_tests/test_logical_replication_circular.py b/tests/integration/charm/ha_tests/test_logical_replication_circular.py new file mode 100644 index 00000000..7e4597cd --- /dev/null +++ b/tests/integration/charm/ha_tests/test_logical_replication_circular.py @@ -0,0 +1,467 @@ +# Copyright 2025 Canonical Ltd. +# See LICENSE file for licensing details. + +"""Integration tests for logical replication circular detection. + +This test module focuses on detecting and preventing circular replication +at the table level for logical replication setups. +""" + +import json +from asyncio import gather + +import psycopg2 +import pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.new_relations.helpers import build_connection_string +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE, get_leader_unit +from tests.integration.types import Substrate + +APP_NAME_A = "postgresql-a" +APP_NAME_B = "postgresql-b" +APP_NAME_C = "postgresql-c" + +DATA_INTEGRATOR_A = "data-integrator-a" +DATA_INTEGRATOR_B = "data-integrator-b" +DATA_INTEGRATOR_C = "data-integrator-c" +DATA_INTEGRATOR_RELATION = "postgresql" + +APP_CONFIG = {"profile": "testing"} +TESTING_DATABASE = "testdb" + + +@pytest.mark.abort_on_fail +async def test_deploy_clusters(ops_test: OpsTest, charm, charm_resources, substrate: Substrate): + """Deploy three PostgreSQL clusters for testing circular replication.""" + await gather( + ops_test.model.deploy( + charm, + application_name=APP_NAME_A, + num_units=1, + base=CHARM_BASE, + config=APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + charm, + application_name=APP_NAME_B, + num_units=1, + base=CHARM_BASE, + config=APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + charm, + application_name=APP_NAME_C, + num_units=1, + base=CHARM_BASE, + config=APP_CONFIG, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + ops_test.model.deploy( + "data-integrator", + application_name=DATA_INTEGRATOR_A, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ops_test.model.deploy( + "data-integrator", + application_name=DATA_INTEGRATOR_B, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ops_test.model.deploy( + "data-integrator", + application_name=DATA_INTEGRATOR_C, + num_units=1, + channel="latest/stable", + config={"database-name": TESTING_DATABASE}, + ), + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B, APP_NAME_C], + status="active", + timeout=2500, + raise_on_error=False, + ) + + # Integrate data integrators with their clusters + async with ops_test.fast_forward(): + await gather( + ops_test.model.integrate(APP_NAME_A, DATA_INTEGRATOR_A), + ops_test.model.integrate(APP_NAME_B, DATA_INTEGRATOR_B), + ops_test.model.integrate(APP_NAME_C, DATA_INTEGRATOR_C), + ) + await ops_test.model.wait_for_idle(status="active", timeout=500) + + +@pytest.mark.abort_on_fail +async def test_setup_tables(ops_test: OpsTest): + """Create test tables in all clusters.""" + await gather( + _create_test_table(ops_test, DATA_INTEGRATOR_A, "users"), + _create_test_table(ops_test, DATA_INTEGRATOR_A, "orders"), + _create_test_table(ops_test, DATA_INTEGRATOR_B, "users"), + _create_test_table(ops_test, DATA_INTEGRATOR_B, "orders"), + _create_test_table(ops_test, DATA_INTEGRATOR_C, "users"), + _create_test_table(ops_test, DATA_INTEGRATOR_C, "orders"), + ) + + +@pytest.mark.abort_on_fail +async def test_bidirectional_same_table_blocked(ops_test: OpsTest): + """Test that bidirectional replication of the same table is blocked. + + Scenario: Cluster A <-> Cluster B (both trying to replicate public.users) + Expected: Blocked with circular replication error + """ + # First, setup the logical replication relation A -> B + async with ops_test.fast_forward(): + await ops_test.model.integrate( + f"{APP_NAME_A}:logical-replication-offer", + f"{APP_NAME_B}:logical-replication", + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], + status="active", + timeout=500, + ) + + # Configure B to subscribe to users from A + config_b = APP_CONFIG.copy() + config_b["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.users"] + }) + await ops_test.model.applications[APP_NAME_B].set_config(config_b) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], + status="active", + timeout=500, + ) + + # Verify B is subscribed and replication works + await _insert_test_data(ops_test, DATA_INTEGRATOR_A, "from_a", "users") + await _check_test_data(ops_test, DATA_INTEGRATOR_B, "from_a", "users") + + # Now setup B -> A replication (reverse direction) + async with ops_test.fast_forward(): + await ops_test.model.integrate( + f"{APP_NAME_B}:logical-replication-offer", + f"{APP_NAME_A}:logical-replication", + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], + timeout=500, + ) + + # Try to configure A to subscribe to the SAME table from B + # This should be blocked due to circular replication + config_a = APP_CONFIG.copy() + config_a["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.users"] + }) + await ops_test.model.applications[APP_NAME_A].set_config(config_a) + + # Wait for the leader unit to go to blocked status + leader_unit_a = await get_leader_unit(ops_test, APP_NAME_A) + await ops_test.model.block_until( + lambda: leader_unit_a.workload_status == "blocked", timeout=120 + ) + + # Verify the status message mentions circular replication + assert "circular replication" in leader_unit_a.workload_status_message.lower() + + +@pytest.mark.abort_on_fail +async def test_bidirectional_different_tables_allowed(ops_test: OpsTest): + """Test that bidirectional replication of different tables is allowed. + + Scenario: Cluster A -> B (public.users), Cluster B -> A (public.orders) + Expected: Both work fine, no circular replication + """ + # A is already subscribed to users from B (but blocked) + # Let's change to orders instead + config_a = APP_CONFIG.copy() + config_a["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.orders"] + }) + await ops_test.model.applications[APP_NAME_A].set_config(config_a) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], status="active", timeout=500 + ) + + # Verify bidirectional replication works for different tables + await _insert_test_data(ops_test, DATA_INTEGRATOR_A, "a_users", "users") + await _insert_test_data(ops_test, DATA_INTEGRATOR_B, "b_orders", "orders") + + # Check A -> B (users) + await _check_test_data(ops_test, DATA_INTEGRATOR_B, "a_users", "users") + + # Check B -> A (orders) + await _check_test_data(ops_test, DATA_INTEGRATOR_A, "b_orders", "orders") + + +@pytest.mark.abort_on_fail +async def test_cleanup_ab_relations(ops_test: OpsTest): + """Clean up A-B relations before testing multi-hop scenario.""" + # Remove all logical replication relations between A and B + await ops_test.model.applications[APP_NAME_A].remove_relation( + f"{APP_NAME_A}:logical-replication-offer", + f"{APP_NAME_B}:logical-replication", + ) + await ops_test.model.applications[APP_NAME_B].remove_relation( + f"{APP_NAME_B}:logical-replication-offer", + f"{APP_NAME_A}:logical-replication", + ) + + # Clear subscription configs + config_a = APP_CONFIG.copy() + config_a["logical-replication-subscription-request"] = "" + await ops_test.model.applications[APP_NAME_A].set_config(config_a) + + config_b = APP_CONFIG.copy() + config_b["logical-replication-subscription-request"] = "" + await ops_test.model.applications[APP_NAME_B].set_config(config_b) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], status="active", timeout=500 + ) + + # Truncate tables to start fresh + await _truncate_table(ops_test, DATA_INTEGRATOR_A, "users") + await _truncate_table(ops_test, DATA_INTEGRATOR_B, "users") + + +@pytest.mark.abort_on_fail +async def test_multihop_circular_blocked(ops_test: OpsTest): + """Test that multi-hop circular replication is blocked. + + Scenario: Cluster A -> B -> C -> A (all for public.users) + Expected: The final A subscription is blocked with circular replication error + """ + # Setup A -> B replication + async with ops_test.fast_forward(): + await ops_test.model.integrate( + f"{APP_NAME_A}:logical-replication-offer", + f"{APP_NAME_B}:logical-replication", + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], + status="active", + timeout=500, + ) + + config_b = APP_CONFIG.copy() + config_b["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.users"] + }) + await ops_test.model.applications[APP_NAME_B].set_config(config_b) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_B], + status="active", + timeout=500, + ) + + # Verify A -> B works + await _insert_test_data(ops_test, DATA_INTEGRATOR_A, "from_a", "users") + await _check_test_data(ops_test, DATA_INTEGRATOR_B, "from_a", "users") + + # Setup B -> C replication + async with ops_test.fast_forward(): + await ops_test.model.integrate( + f"{APP_NAME_B}:logical-replication-offer", + f"{APP_NAME_C}:logical-replication", + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_B, APP_NAME_C], + status="active", + timeout=500, + ) + + config_c = APP_CONFIG.copy() + config_c["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.users"] + }) + await ops_test.model.applications[APP_NAME_C].set_config(config_c) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_B, APP_NAME_C], + status="active", + timeout=500, + ) + + # Verify A -> B -> C works + await _insert_test_data(ops_test, DATA_INTEGRATOR_A, "from_a_via_b", "users") + await _check_test_data(ops_test, DATA_INTEGRATOR_C, "from_a_via_b", "users") + + # Now try to setup C -> A replication (completing the circle) + async with ops_test.fast_forward(): + await ops_test.model.integrate( + f"{APP_NAME_C}:logical-replication-offer", + f"{APP_NAME_A}:logical-replication", + ) + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_C], + timeout=500, + ) + + # Try to configure A to subscribe to users from C + # This should be blocked because the chain is: A -> B -> C -> (back to A) + config_a = APP_CONFIG.copy() + config_a["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.users"] + }) + await ops_test.model.applications[APP_NAME_A].set_config(config_a) + + # Wait for the leader unit to go to blocked status + leader_unit_a = await get_leader_unit(ops_test, APP_NAME_A) + await ops_test.model.block_until( + lambda: leader_unit_a.workload_status == "blocked", timeout=120 + ) + + # Verify the status message mentions circular replication + assert "circular replication" in leader_unit_a.workload_status_message.lower() + + +@pytest.mark.abort_on_fail +async def test_multihop_different_table_allowed(ops_test: OpsTest): + """Test that multi-hop replication of different table works. + + Scenario: A -> B -> C (public.users), C -> A (public.orders) + Expected: Works fine since orders doesn't create a cycle + """ + # Change A's subscription to orders instead of users + config_a = APP_CONFIG.copy() + config_a["logical-replication-subscription-request"] = json.dumps({ + TESTING_DATABASE: ["public.orders"] + }) + await ops_test.model.applications[APP_NAME_A].set_config(config_a) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APP_NAME_A, APP_NAME_C], status="active", timeout=500 + ) + + # Verify the replication works + await _insert_test_data(ops_test, DATA_INTEGRATOR_C, "c_orders", "orders") + await _check_test_data(ops_test, DATA_INTEGRATOR_A, "c_orders", "orders") + + # Verify the A -> B -> C chain still works for users + await _insert_test_data(ops_test, DATA_INTEGRATOR_A, "final_test", "users") + await _check_test_data(ops_test, DATA_INTEGRATOR_C, "final_test", "users") + + +# Helper functions + + +async def _create_test_table( + ops_test: OpsTest, data_integrator_app_name: str, table_name: str +) -> None: + """Create a test table in the specified database.""" + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + connection.autocommit = True + with connection.cursor() as cursor: + cursor.execute(f"CREATE TABLE {table_name} (test_column text);") + finally: + if connection is not None: + connection.close() + + +async def _truncate_table( + ops_test: OpsTest, data_integrator_app_name: str, table_name: str +) -> None: + """Truncate a table in the specified database.""" + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + connection.autocommit = True + with connection.cursor() as cursor: + cursor.execute(f"TRUNCATE TABLE {table_name};") + finally: + if connection is not None: + connection.close() + + +async def _insert_test_data( + ops_test: OpsTest, data_integrator_app_name: str, data: str, table_name: str +) -> None: + """Insert test data into a table.""" + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + connection.autocommit = True + with connection.cursor() as cursor: + cursor.execute( + f"INSERT INTO {table_name} (test_column) VALUES (%s);", + (data,), + ) + finally: + if connection is not None: + connection.close() + + +async def _check_test_data( + ops_test: OpsTest, data_integrator_app_name: str, data: str, table_name: str +) -> bool: + """Check if test data exists in a table.""" + connection_string = await build_connection_string( + ops_test, + data_integrator_app_name, + DATA_INTEGRATOR_RELATION, + database=TESTING_DATABASE, + ) + connection = None + try: + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + connection = psycopg2.connect(connection_string) + with connection.cursor() as cursor: + cursor.execute( + f"SELECT EXISTS (SELECT 1 FROM {table_name} WHERE test_column = %s);", + (data,), + ) + return cursor.fetchone()[0] + finally: + if connection is not None: + connection.close() diff --git a/tests/integration/charm/ha_tests/test_replication.py b/tests/integration/charm/ha_tests/test_replication.py new file mode 100644 index 00000000..74e687a5 --- /dev/null +++ b/tests/integration/charm/ha_tests/test_replication.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. +import psycopg2 +import pytest +from lightkube.core.client import Client +from lightkube.resources.core_v1 import Pod +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, retry_if_exception_type, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + are_writes_increasing, + check_writes, + fetch_cluster_members, + is_cluster_updated, + start_continuous_writes, +) +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + CHARM_BASE, + get_password, + get_primary, + get_unit_address, + scale_application, +) +from tests.integration.helpers.postgresql import db_connect +from tests.integration.types import Substrate + + +@pytest.mark.abort_on_fail +async def test_build_and_deploy( + ops_test: OpsTest, charm, app_name: str, charm_resources, substrate: Substrate +) -> None: + """Build and deploy three unit of PostgreSQL.""" + wait_for_apps = False + # It is possible for users to provide their own cluster for HA testing. Hence, check if there + # is a pre-existing cluster. + if app_name not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=3, + base=CHARM_BASE, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + # Deploy the continuous writes application charm if it wasn't already deployed. + if APPLICATION_NAME not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + APPLICATION_NAME, + application_name=APPLICATION_NAME, + base=CHARM_BASE, + channel="latest/edge", + ) + + if wait_for_apps: + async with ops_test.fast_forward(): + await ops_test.model.relate(app_name, f"{APPLICATION_NAME}:database") + await ops_test.model.wait_for_idle(status="active", timeout=1500) + + +async def test_reelection( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + continuous_writes, + primary_start_timeout, +) -> None: + """Kill primary unit, check reelection.""" + app = app_name + if len(ops_test.model.applications[app].units) < 2: + await scale_application(ops_test, app, 2) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + primary_name = await get_primary(ops_test, app) + if substrate == Substrate.vm: + # Remove the primary unit. + await ops_test.model.destroy_units(primary_name) + else: + # Kill the current primary. + client = Client(namespace=ops_test.model.info.name) + client.delete(Pod, name=primary_name.replace("/", "-")) + + # Wait and get the primary again (which can be any unit, including the previous primary). + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active") + + # Check whether writes are increasing. + await are_writes_increasing(ops_test, primary_name) + + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + new_primary_name = await get_primary(ops_test, app, down_unit=primary_name) + assert new_primary_name != primary_name, "primary reelection hasn't happened" + + if substrate == Substrate.vm: + # Verify that all units are part of the same cluster. + member_ips = await fetch_cluster_members(ops_test) + app = primary_name.split("/")[0] + ip_addresses = [unit.public_address for unit in ops_test.model.applications[app].units] + assert set(member_ips) == set(ip_addresses), "not all units are part of the same cluster." + + # Verify that no writes to the database were missed after stopping the writes. + await check_writes(ops_test) + else: + # Verify that all the units from the first cluster are up-to-date. + await is_cluster_updated(ops_test, primary_name) + + +async def test_consistency(ops_test: OpsTest, app_name: str, continuous_writes) -> None: + """Write to primary, read data from secondaries (check consistency).""" + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Check whether writes are increasing. + await are_writes_increasing(ops_test, primary_name) + + # Verify that no writes to the database were missed after stopping the writes + # (check that all the units have all the writes). + await check_writes(ops_test) + + +async def test_no_data_replicated_between_clusters( + ops_test: OpsTest, + charm, + app_name: str, + charm_resources, + substrate: Substrate, + continuous_writes, +) -> None: + """Check that writes in one cluster are not replicated to another cluster.""" + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Deploy another cluster. + new_cluster_app = f"second-{app}" + if new_cluster_app not in ops_test.model.applications: + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=new_cluster_app, + num_units=2, + base=CHARM_BASE, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + await ops_test.model.wait_for_idle( + apps=[new_cluster_app], status="active", timeout=1500 + ) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Check whether writes are increasing. + await are_writes_increasing(ops_test, primary_name) + + # Verify that no writes to the first cluster were missed after stopping the writes. + await check_writes(ops_test) + + # Verify that the data from the first cluster wasn't replicated to the second cluster. + password = await get_password(ops_test, database_app_name=new_cluster_app) + for unit in ops_test.model.applications[new_cluster_app].units: + address = await get_unit_address(ops_test, unit.name) + for attempt in Retrying( + stop=stop_after_delay(120), + wait=wait_fixed(3), + retry=retry_if_exception_type((psycopg2.InterfaceError, psycopg2.OperationalError)), + reraise=True, + ): + with attempt: + connection = None + try: + with ( + db_connect(host=address, password=password) as connection, + connection.cursor() as cursor, + ): + cursor.execute( + "SELECT EXISTS (SELECT FROM information_schema.tables" + " WHERE table_schema = 'public' AND table_name = 'continuous_writes');" + ) + assert not cursor.fetchone()[0], ( + "table 'continuous_writes' was replicated to the second cluster" + ) + finally: + if connection is not None: + connection.close() diff --git a/tests/integration/charm/ha_tests/test_self_healing_1.py b/tests/integration/charm/ha_tests/test_self_healing_1.py new file mode 100644 index 00000000..87449243 --- /dev/null +++ b/tests/integration/charm/ha_tests/test_self_healing_1.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import logging +from time import sleep + +import pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + add_unit_with_storage, + are_writes_increasing, + check_writes, + get_storage_ids, + is_cluster_updated, + is_postgresql_ready, + is_replica, + is_secondary_up_to_date, + reused_replica_storage, + send_signal_to_process, + start_continuous_writes, + storage_type, +) +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + CHARM_BASE, + get_primary, +) +from tests.integration.types import Substrate + +logger = logging.getLogger(__name__) + +PATRONI_PROCESS = { + Substrate.vm: "/snap/charmed-postgresql/[0-9]*/usr/bin/patroni", + Substrate.k8s: "/usr/bin/patroni", +} +POSTGRESQL_PROCESS = "postgres" +# The Patroni path depends on the substrate, so the tests are parametrized by name. +DB_PROCESSES = [POSTGRESQL_PROCESS, "patroni"] +MEDIAN_ELECTION_TIME = 10 + +VM_STORAGE = { + "archive": {"pool": "lxd-btrfs", "size": 2048}, + "data": {"pool": "lxd-btrfs", "size": 2048}, + "logs": {"pool": "lxd-btrfs", "size": 2048}, + "temp": {"pool": "lxd-btrfs", "size": 2048}, +} + + +@pytest.mark.abort_on_fail +async def test_build_and_deploy( + ops_test: OpsTest, charm, app_name: str, charm_resources, substrate: Substrate +) -> None: + """Build and deploy three unit of PostgreSQL.""" + wait_for_apps = False + # It is possible for users to provide their own cluster for HA testing. Hence, check if there + # is a pre-existing cluster. + if app_name not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=3, + base=CHARM_BASE, + storage=VM_STORAGE if substrate == Substrate.vm else None, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + # Deploy the continuous writes application charm if it wasn't already deployed. + if APPLICATION_NAME not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + APPLICATION_NAME, + application_name=APPLICATION_NAME, + base=CHARM_BASE, + channel="latest/edge", + ) + + if wait_for_apps: + await ops_test.model.relate(app_name, f"{APPLICATION_NAME}:database") + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APPLICATION_NAME, app_name], + status="active", + timeout=1500, + idle_period=30, + ) + + +@pytest.mark.abort_on_fail +@pytest.mark.vm_only +async def test_storage_re_use(ops_test, app_name: str, continuous_writes): + """Verifies that database units with attached storage correctly repurpose storage. + + It is not enough to verify that Juju attaches the storage. Hence test checks that the + postgresql properly uses the storage that was provided. (ie. doesn't just re-sync everything + from primary, but instead computes a diff between current storage and primary storage.) + """ + app = app_name + if storage_type(ops_test, app) == "rootfs": + pytest.skip( + "reuse of storage can only be used on deployments with persistent storage not on rootfs deployments" + ) + + # removing the only replica can be disastrous + if len(ops_test.model.applications[app].units) < 2: + await ops_test.model.applications[app].add_unit(count=1) + await ops_test.model.wait_for_idle(apps=[app], status="active", timeout=1500) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # remove a unit and attach it's storage to a new unit + for unit in ops_test.model.applications[app].units: + if await is_replica(ops_test, unit.name): + break + unit_storage_id = await get_storage_ids(ops_test, unit.name) + expected_units = len(ops_test.model.applications[app].units) - 1 + await ops_test.model.destroy_unit(unit.name) + await ops_test.model.wait_for_idle( + apps=[app], status="active", timeout=1000, wait_for_exact_units=expected_units + ) + new_unit = await add_unit_with_storage(ops_test, app, unit_storage_id) + + assert await reused_replica_storage(ops_test, new_unit.name), ( + "attached storage not properly reused by Postgresql." + ) + + # Verify that no writes to the database were missed after stopping the writes. + total_expected_writes = await check_writes(ops_test) + + # Verify that new instance is up-to-date. + assert await is_secondary_up_to_date(ops_test, new_unit.name, total_expected_writes), ( + "new instance not up to date." + ) + + +@pytest.mark.abort_on_fail +@pytest.mark.parametrize("process", DB_PROCESSES) +@pytest.mark.parametrize("signal", ["SIGTERM", "SIGKILL"]) +async def test_interruption_db_process( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + process: str, + signal: str, + continuous_writes, + primary_start_timeout, + restart_policy, +) -> None: + process = PATRONI_PROCESS[substrate] if process == "patroni" else process + + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Interrupt the database process. + await send_signal_to_process(ops_test, primary_name, process, signal) + + # Wait some time to elect a new primary. + sleep(MEDIAN_ELECTION_TIME * 6) + + async with ops_test.fast_forward(): + await are_writes_increasing(ops_test, primary_name) + + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + new_primary_name = await get_primary(ops_test, app, down_unit=primary_name) + assert new_primary_name != primary_name + + # Verify that the database service got restarted and is ready in the old primary. + logger.info(f"waiting for the database service to restart on {primary_name}") + assert await is_postgresql_ready(ops_test, primary_name) + + await is_cluster_updated(ops_test, primary_name) diff --git a/tests/integration/charm/ha_tests/test_self_healing_2.py b/tests/integration/charm/ha_tests/test_self_healing_2.py new file mode 100644 index 00000000..6062a274 --- /dev/null +++ b/tests/integration/charm/ha_tests/test_self_healing_2.py @@ -0,0 +1,299 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import asyncio +import logging +from time import sleep + +import pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + ORIGINAL_RESTART_CONDITION, + are_all_db_processes_down, + are_writes_increasing, + change_patroni_setting, + check_writes, + fetch_cluster_members, + get_patroni_setting, + is_cluster_updated, + is_postgresql_ready, + modify_pebble_restart_delay, + send_signal_to_process, + start_continuous_writes, + update_restart_condition, +) +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + CHARM_BASE, + get_password, + get_primary, + get_unit_address, + scale_application, +) +from tests.integration.types import Substrate + +logger = logging.getLogger(__name__) + +PATRONI_PROCESS = { + Substrate.vm: "/snap/charmed-postgresql/[0-9]*/usr/bin/patroni", + Substrate.k8s: "/usr/bin/patroni", +} +POSTGRESQL_PROCESS = "postgres" +# The Patroni path depends on the substrate, so the tests are parametrized by name. +DB_PROCESSES = [POSTGRESQL_PROCESS, "patroni"] +MEDIAN_ELECTION_TIME = 10 + +VM_STORAGE = { + "archive": {"pool": "lxd-btrfs", "size": 2048}, + "data": {"pool": "lxd-btrfs", "size": 2048}, + "logs": {"pool": "lxd-btrfs", "size": 2048}, + "temp": {"pool": "lxd-btrfs", "size": 2048}, +} + + +@pytest.mark.abort_on_fail +async def test_build_and_deploy( + ops_test: OpsTest, charm, app_name: str, charm_resources, substrate: Substrate +) -> None: + """Build and deploy three unit of PostgreSQL.""" + wait_for_apps = False + # It is possible for users to provide their own cluster for HA testing. Hence, check if there + # is a pre-existing cluster. + if app_name not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=3, + base=CHARM_BASE, + storage=VM_STORAGE if substrate == Substrate.vm else None, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + # Deploy the continuous writes application charm if it wasn't already deployed. + if APPLICATION_NAME not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + APPLICATION_NAME, + application_name=APPLICATION_NAME, + base=CHARM_BASE, + channel="latest/edge", + ) + + if wait_for_apps: + await ops_test.model.relate(app_name, f"{APPLICATION_NAME}:database") + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APPLICATION_NAME, app_name], + status="active", + timeout=1500, + idle_period=30, + ) + + +@pytest.mark.abort_on_fail +@pytest.mark.parametrize("process", DB_PROCESSES) +async def test_freeze_db_process( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + process: str, + continuous_writes, + primary_start_timeout, +) -> None: + process = PATRONI_PROCESS[substrate] if process == "patroni" else process + + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Freeze the database process. + await send_signal_to_process(ops_test, primary_name, process, "SIGSTOP") + + # Wait some time to elect a new primary. + sleep(MEDIAN_ELECTION_TIME * 6) + + async with ops_test.fast_forward(): + # Verify new writes are continuing by counting the number of writes before and after a + # 3 minutes wait (this is a little more than the loop wait configuration, that is + # considered to trigger a fail-over after primary_start_timeout is changed, and also + # when freezing the DB process it take some more time to trigger the fail-over). + try: + await are_writes_increasing(ops_test, primary_name) + + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3)): + with attempt: + new_primary_name = await get_primary(ops_test, app, down_unit=primary_name) + assert new_primary_name != primary_name + finally: + # Un-freeze the old primary. + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3)): + with attempt: + use_ssh = (attempt.retry_state.attempt_number % 2) == 0 + logger.info(f"unfreezing {process}") + await send_signal_to_process( + ops_test, primary_name, process, "SIGCONT", use_ssh + ) + + # Verify that the database service got restarted and is ready in the old primary. + logger.info(f"waiting for the database service to restart on {primary_name}") + assert await is_postgresql_ready(ops_test, primary_name) + + await is_cluster_updated(ops_test, primary_name) + + +@pytest.mark.abort_on_fail +@pytest.mark.parametrize("process", DB_PROCESSES) +@pytest.mark.parametrize("signal", ["SIGTERM", "SIGKILL"]) +async def test_full_cluster_restart( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + process: str, + signal: str, + continuous_writes, + reset_restart_condition, + restart_policy, + loop_wait, +) -> None: + """This tests checks that a cluster recovers from a full cluster restart. + + The test can be called a full cluster crash when the signal sent to the OS process + is SIGKILL. + """ + process = PATRONI_PROCESS[substrate] if process == "patroni" else process + + # Locate primary unit. + app = app_name + patroni_password = await get_password(ops_test, "patroni") + + # Change the loop wait setting to make Patroni wait more time before restarting PostgreSQL. + initial_loop_wait = await get_patroni_setting(ops_test, "loop_wait") + if substrate == Substrate.vm: + initial_ttl = await get_patroni_setting(ops_test, "ttl") + # loop_wait parameter is limited by ttl value, thus we should increase it first + await change_patroni_setting(ops_test, "ttl", 600, patroni_password, use_random_unit=True) + await change_patroni_setting( + ops_test, "loop_wait", 300, patroni_password, use_random_unit=True + ) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Restart all units "simultaneously". + await asyncio.gather(*[ + send_signal_to_process(ops_test, unit.name, process, signal) + for unit in ops_test.model.applications[app].units + ]) + + # This test serves to verify behavior when all replicas are down at the same time that when + # they come back online they operate as expected. This check verifies that we meet the criteria + # of all replicas being down at the same time. + try: + assert await are_all_db_processes_down(ops_test, process, signal), ( + "Not all units down at the same time." + ) + finally: + if substrate == Substrate.vm: + if process == PATRONI_PROCESS[substrate]: + awaits = [] + for unit in ops_test.model.applications[app].units: + awaits.append( + update_restart_condition(ops_test, unit, ORIGINAL_RESTART_CONDITION) + ) + await asyncio.gather(*awaits) + else: + for unit in ops_test.model.applications[app].units: + await modify_pebble_restart_delay( + ops_test, + unit.name, + "tests/integration/charm/ha_tests/manifests/restore_pebble_restart_delay.yml", + ensure_replan=True, + ) + await change_patroni_setting( + ops_test, "loop_wait", initial_loop_wait, patroni_password, use_random_unit=True + ) + if substrate == Substrate.vm: + await change_patroni_setting( + ops_test, "ttl", initial_ttl, patroni_password, use_random_unit=True + ) + + # Verify all units are up and running. + sleep(30) + for unit in ops_test.model.applications[app].units: + assert await is_postgresql_ready(ops_test, unit.name), ( + f"unit {unit.name} not restarted after cluster restart." + ) + + # Check if a primary is elected + for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3)): + with attempt: + new_primary_name = await get_primary(ops_test, app) + assert new_primary_name is not None, "Could not get primary from any unit" + + async with ops_test.fast_forward("60s"): + await ops_test.model.wait_for_idle(status="active", timeout=1000) + await are_writes_increasing(ops_test) + + # Verify that all units are part of the same cluster. + member_ips = await fetch_cluster_members(ops_test) + ip_addresses = [ + await get_unit_address(ops_test, unit.name) + for unit in ops_test.model.applications[app].units + ] + assert set(member_ips) == set(ip_addresses), "not all units are part of the same cluster." + + # Verify that no writes to the database were missed after stopping the writes. + async with ops_test.fast_forward(): + await check_writes(ops_test) + + +@pytest.mark.abort_on_fail +@pytest.mark.k8s_only +async def test_scaling_to_zero(ops_test: OpsTest, app_name: str, continuous_writes) -> None: + """Scale the database to zero units and scale up again.""" + # Locate primary unit. + app = app_name + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Scale the database to zero units. + logger.info("scaling database to zero units") + await scale_application(ops_test, app, 0) + + # Scale the database to three units. + logger.info("scaling database to three units") + await scale_application(ops_test, app, 3) + + # Verify all units are up and running. + logger.info("waiting for the database service to start in all units") + for unit in ops_test.model.applications[app].units: + assert await is_postgresql_ready(ops_test, unit.name), ( + f"unit {unit.name} not restarted after cluster restart." + ) + + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test) + + # Verify that all units are part of the same cluster. + logger.info("checking whether all units are part of the same cluster") + member_ips = await fetch_cluster_members(ops_test) + ip_addresses = [ + await get_unit_address(ops_test, unit.name) + for unit in ops_test.model.applications[app].units + ] + assert set(member_ips) == set(ip_addresses), "not all units are part of the same cluster." + + # Verify that no writes to the database were missed after stopping the writes. + logger.info("checking whether no writes to the database were missed after stopping the writes") + await check_writes(ops_test) diff --git a/tests/integration/charm/ha_tests/test_self_healing_3.py b/tests/integration/charm/ha_tests/test_self_healing_3.py new file mode 100644 index 00000000..3c82fbba --- /dev/null +++ b/tests/integration/charm/ha_tests/test_self_healing_3.py @@ -0,0 +1,406 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import logging +from time import sleep + +import pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + are_writes_increasing, + change_wal_settings, + cut_network_from_unit, + cut_network_from_unit_without_ip_change, + get_controller_machine, + get_unit_ip, + is_cluster_updated, + is_connection_possible, + is_machine_reachable_from, + is_member_isolated, + is_postgresql_ready, + isolate_instance_from_cluster, + list_wal_files, + remove_instance_isolation, + restore_network_for_unit, + restore_network_for_unit_without_ip_change, + start_continuous_writes, + wait_network_restore, +) +from tests.integration.charm.pytest_operator_helpers import ( + APPLICATION_NAME, + CHARM_BASE, + get_machine_from_unit, + get_password, + get_primary, + get_unit_address, + run_command_on_unit, +) +from tests.integration.helpers.postgresql import db_connect +from tests.integration.types import Substrate + +logger = logging.getLogger(__name__) + +MEDIAN_ELECTION_TIME = 10 + +CLEAN_DATA_DIR_SCRIPT = { + Substrate.vm: "tests/integration/charm/ha_tests/clean-data-dir-vm.sh", + Substrate.k8s: "tests/integration/charm/ha_tests/clean-data-dir-k8s.sh", +} + +VM_STORAGE = { + "archive": {"pool": "lxd-btrfs", "size": 2048}, + "data": {"pool": "lxd-btrfs", "size": 2048}, + "logs": {"pool": "lxd-btrfs", "size": 2048}, + "temp": {"pool": "lxd-btrfs", "size": 2048}, +} + + +@pytest.mark.abort_on_fail +async def test_build_and_deploy( + ops_test: OpsTest, charm, app_name: str, charm_resources, substrate: Substrate +) -> None: + """Build and deploy three unit of PostgreSQL.""" + wait_for_apps = False + # It is possible for users to provide their own cluster for HA testing. Hence, check if there + # is a pre-existing cluster. + if app_name not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=3, + base=CHARM_BASE, + storage=VM_STORAGE if substrate == Substrate.vm else None, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + # Deploy the continuous writes application charm if it wasn't already deployed. + if APPLICATION_NAME not in ops_test.model.applications: + wait_for_apps = True + async with ops_test.fast_forward(): + await ops_test.model.deploy( + APPLICATION_NAME, + application_name=APPLICATION_NAME, + base=CHARM_BASE, + channel="latest/edge", + ) + + if wait_for_apps: + await ops_test.model.relate(app_name, f"{APPLICATION_NAME}:database") + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[APPLICATION_NAME, app_name], + status="active", + timeout=1500, + idle_period=30, + ) + + +@pytest.mark.abort_on_fail +async def test_forceful_restart_without_data_and_transaction_logs( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + continuous_writes, + primary_start_timeout, + wal_settings, +) -> None: + """A forceful restart with deleted data and without transaction logs (forced clone).""" + if substrate == Substrate.vm: + pytest.skip("Unstable") + + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + patroni_password = await get_password(ops_test, "patroni") + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Copy data dir content removal script. + await ops_test.juju( + "scp", CLEAN_DATA_DIR_SCRIPT[substrate], f"{primary_name}:/tmp/clean-data-dir.sh" + ) + + # Halts the execution of `update-status` hook so the pebble service doesn't get restarted + # (on K8s). + async with ops_test.fast_forward("24h" if substrate == Substrate.k8s else "10s"): + # Stop the systemd service on the primary unit. + logger.info(f"stopping database from {primary_name}") + if substrate == Substrate.vm: + await run_command_on_unit( + ops_test, primary_name, "snap stop charmed-postgresql.patroni" + ) + else: + await run_command_on_unit(ops_test, primary_name, "/charm/bin/pebble stop postgresql") + + # Data removal runs within a script, so it allows `*` expansion. + logger.info(f"removing data from {primary_name}") + return_code, _, _ = await ops_test.juju( + "ssh", + primary_name, + "sudo" if substrate == Substrate.vm else "bash", + "/tmp/clean-data-dir.sh", + ) + assert return_code == 0, "Failed to remove data directory" + + # Wait some time to elect a new primary. + sleep(MEDIAN_ELECTION_TIME * 2) + + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test, primary_name) + + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + logger.info("checking whether a new primary was elected") + new_primary_name = await get_primary(ops_test, app) + assert new_primary_name is not None + assert new_primary_name != primary_name + + # Change some settings to enable WAL rotation and remove the old WAL files. + for unit in ops_test.model.applications[app].units: + if unit.name == primary_name: + continue + logger.info(f"enabling WAL rotation on {primary_name}") + await change_wal_settings(ops_test, unit.name, 32, 32, 1, patroni_password) + + # Rotate the WAL segments. + logger.info(f"rotating WAL segments on {new_primary_name}") + files = await list_wal_files(ops_test, app) + host = await get_unit_address(ops_test, new_primary_name) + password = await get_password(ops_test) + with db_connect(host, password) as connection: + connection.autocommit = True + with connection.cursor() as cursor: + # Run some commands to make PostgreSQL do WAL rotation. + cursor.execute("SELECT pg_switch_wal();") + cursor.execute("CHECKPOINT;") + cursor.execute("SELECT pg_switch_wal();") + connection.close() + new_files = await list_wal_files(ops_test, app) + + # Check that the WAL was correctly rotated. + for unit_name in files: + assert not files[unit_name].intersection(new_files), ( + f"WAL segments weren't correctly rotated on {unit_name}" + ) + + # Database service in old primary should recover (after update-status run on K8s). + async with ops_test.fast_forward("10s"): + if substrate == Substrate.vm: + # Start the systemd service in the old primary. + await run_command_on_unit( + ops_test, primary_name, "snap start charmed-postgresql.patroni" + ) + + logger.info(f"Checking the database service on {primary_name}") + assert await is_postgresql_ready(ops_test, primary_name) + + await is_cluster_updated(ops_test, primary_name) + + +@pytest.mark.abort_on_fail +async def test_network_cut( + ops_test: OpsTest, + app_name: str, + substrate: Substrate, + architecture: str, + continuous_writes, + primary_start_timeout, + chaos_mesh, +): + """Completely cut and restore network.""" + if substrate == Substrate.k8s and architecture != "amd64": + pytest.skip("Chaos Mesh is only deployed on amd64") + + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + if substrate == Substrate.vm: + # Get unit hostname and IP. + primary_hostname = await get_machine_from_unit(ops_test, primary_name) + primary_ip = await get_unit_ip(ops_test, primary_name) + + # Verify that connection is possible. + logger.info("checking whether the connectivity to the database is working") + assert await is_connection_possible(ops_test, primary_name), ( + f"Connection {primary_name} is not possible" + ) + + if substrate == Substrate.vm: + logger.info(f"Cutting network for {primary_name}") + cut_network_from_unit(primary_hostname) + + # Verify machine is not reachable from peer units. + all_units_names = [unit.name for unit in ops_test.model.applications[app].units] + for unit_name in set(all_units_names) - {primary_name}: + logger.info(f"checking for no connectivity between {primary_name} and {unit_name}") + hostname = await get_machine_from_unit(ops_test, unit_name) + assert not is_machine_reachable_from(hostname, primary_hostname), ( + "unit is reachable from peer" + ) + + # Verify machine is not reachable from controller. + logger.info(f"checking for no connectivity between {primary_name} and the controller") + controller = await get_controller_machine(ops_test) + assert not is_machine_reachable_from(controller, primary_hostname), ( + "unit is reachable from controller" + ) + else: + # Confirm that the primary is not isolated from the cluster. + logger.info("confirming that the primary is not isolated from the cluster") + assert not await is_member_isolated(ops_test, primary_name, primary_name) + + # Create network chaos policy to isolate instance from cluster + logger.info(f"Cutting network for {primary_name}") + isolate_instance_from_cluster(ops_test, primary_name) + + # Verify that connection is not possible. + logger.info("checking whether the connectivity to the database is not working") + assert not await is_connection_possible(ops_test, primary_name), ( + "Connection is possible after network cut" + ) + + async with ops_test.fast_forward(): + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test, primary_name) + + logger.info("checking whether a new primary was elected") + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + new_primary_name = await get_primary(ops_test, app, down_unit=primary_name) + assert new_primary_name != primary_name + + if substrate == Substrate.vm: + logger.info(f"Restoring network for {primary_name}") + restore_network_for_unit(primary_hostname) + + # Wait until the cluster becomes idle (some operations like updating the member + # IP are made). + logger.info("waiting for cluster to become idle after updating member IP") + async with ops_test.fast_forward(fast_interval="60s"): + await ops_test.model.wait_for_idle( + apps=[app], + status="active", + timeout=1000, + idle_period=30, + raise_on_error=False, + ) + + # Wait the LXD unit has its IP updated. + logger.info("waiting for IP address to be updated on Juju unit") + await wait_network_restore(ops_test, primary_name, primary_ip) + else: + # Confirm that the former primary is isolated from the cluster. + logger.info("confirming that the former primary is isolated from the cluster") + assert await is_member_isolated(ops_test, new_primary_name, primary_name) + + # Remove network chaos policy isolating instance from cluster. + logger.info(f"Restoring network for {primary_name}") + remove_instance_isolation(ops_test) + + # The unit IP changes on VM, so it's retrieved from inside the unit. + use_ip_from_inside = substrate == Substrate.vm + + # Verify that the database service got restarted and is ready in the old primary. + logger.info(f"waiting for the database service to be ready on {primary_name}") + assert await is_postgresql_ready(ops_test, primary_name, use_ip_from_inside=use_ip_from_inside) + + # Verify that connection is possible. + logger.info("checking whether the connectivity to the database is working") + assert await is_connection_possible( + ops_test, primary_name, use_ip_from_inside=use_ip_from_inside + ), "Connection is not possible after network restore" + + await is_cluster_updated(ops_test, primary_name, use_ip_from_inside=use_ip_from_inside) + + +@pytest.mark.abort_on_fail +@pytest.mark.vm_only +async def test_network_cut_without_ip_change( + ops_test: OpsTest, app_name: str, continuous_writes, primary_start_timeout +): + """Completely cut and restore network (situation when the unit IP doesn't change).""" + # Locate primary unit. + app = app_name + primary_name = await get_primary(ops_test, app) + + # Start an application that continuously writes data to the database. + await start_continuous_writes(ops_test, app) + + # Get unit hostname and IP. + primary_hostname = await get_machine_from_unit(ops_test, primary_name) + + # Verify that connection is possible. + logger.info("checking whether the connectivity to the database is working") + assert await is_connection_possible(ops_test, primary_name), ( + f"Connection {primary_name} is not possible" + ) + + logger.info(f"Cutting network for {primary_name}") + cut_network_from_unit_without_ip_change(primary_hostname) + + # Verify machine is not reachable from peer units. + all_units_names = [unit.name for unit in ops_test.model.applications[app].units] + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + for unit_name in set(all_units_names) - {primary_name}: + logger.info(f"checking for no connectivity between {primary_name} and {unit_name}") + hostname = await get_machine_from_unit(ops_test, unit_name) + assert not is_machine_reachable_from(hostname, primary_hostname), ( + "unit is reachable from peer" + ) + + # Verify machine is not reachable from controller. + logger.info(f"checking for no connectivity between {primary_name} and the controller") + controller = await get_controller_machine(ops_test) + assert not is_machine_reachable_from(controller, primary_hostname), ( + "unit is reachable from controller" + ) + + # Verify that connection is not possible. + logger.info("checking whether the connectivity to the database is not working") + assert not await is_connection_possible(ops_test, primary_name), ( + "Connection is possible after network cut" + ) + + async with ops_test.fast_forward(): + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test, primary_name, use_ip_from_inside=True) + + logger.info("checking whether a new primary was elected") + # Verify that a new primary gets elected (ie old primary is secondary). + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): + with attempt: + new_primary_name = await get_primary(ops_test, app, down_unit=primary_name) + assert new_primary_name != primary_name + + logger.info(f"Restoring network for {primary_name}") + restore_network_for_unit_without_ip_change(primary_hostname) + + # Wait until the cluster becomes idle. + logger.info("waiting for cluster to become idle") + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active") + + # Verify that the database service got restarted and is ready in the old primary. + logger.info(f"waiting for the database service to be ready on {primary_name}") + assert await is_postgresql_ready(ops_test, primary_name) + + # Verify that connection is possible. + logger.info("checking whether the connectivity to the database is working") + assert await is_connection_possible(ops_test, primary_name), ( + "Connection is not possible after network restore" + ) + + await is_cluster_updated(ops_test, primary_name, use_ip_from_inside=True) diff --git a/tests/integration/charm/ha_tests/test_smoke.py b/tests/integration/charm/ha_tests/test_smoke.py new file mode 100644 index 00000000..df23a276 --- /dev/null +++ b/tests/integration/charm/ha_tests/test_smoke.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python3 +# Copyright 2021 Canonical Ltd. +# See LICENSE file for licensing details. + +import logging + +import pytest +from juju import tag +from lightkube.core.client import Client +from lightkube.core.exceptions import ApiError +from lightkube.resources.core_v1 import PersistentVolumeClaim +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.charm.ha_tests.helpers import ( + add_unit_with_storage, + apply_pvc_config, + change_pvc_pv_name, + change_pvs_reclaim_policy, + check_db, + check_password_auth, + check_system_id_mismatch, + create_db, + delete_pvc, + get_detached_storages, + get_pvcs, + get_pvs, + get_storage_ids, + is_postgresql_ready, + is_storage_exists, + remove_pv_claimref, + remove_unit_force, +) +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE, scale_application +from tests.integration.types import Substrate + +TEST_DATABASE_NAME = "test_database" +DUP_DATABASE_APP_NAME = "postgres-test-dup" + +VM_STORAGE = { + "archive": {"pool": "lxd-btrfs", "size": 2048}, + "data": {"pool": "lxd-btrfs", "size": 2048}, + "logs": {"pool": "lxd-btrfs", "size": 2048}, + "temp": {"pool": "lxd-btrfs", "size": 2048}, +} + +logger = logging.getLogger(__name__) + + +@pytest.mark.abort_on_fail +async def test_app_force_removal( + ops_test: OpsTest, charm: str, app_name: str, charm_resources, substrate: Substrate +): + """Remove unit with force while storage is alive.""" + global primary_pvs, primary_pvcs + async with ops_test.fast_forward(): + # Deploy the charm. + logger.info("deploying charm") + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=1, + base=CHARM_BASE, + storage=VM_STORAGE if substrate == Substrate.vm else None, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + + logger.info("waiting for idle") + await ops_test.model.wait_for_idle(apps=[app_name], status="active", timeout=1500) + assert ops_test.model.applications[app_name].units[0].workload_status == "active" + + primary_name = ops_test.model.applications[app_name].units[0].name + + logger.info("waiting for postgresql") + for attempt in Retrying(stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + assert await is_postgresql_ready(ops_test, primary_name) + + if substrate == Substrate.k8s: + logger.info(f"get pvc for {primary_name}") + primary_pvcs = get_pvcs(ops_test, primary_name) + + assert primary_pvcs + + logger.info(f"get pv for {primary_name}") + primary_pvs = get_pvs(ops_test, primary_name) + + assert len(primary_pvs) + + logger.info("getting storage id") + storage_ids = await get_storage_ids(ops_test, primary_name) + + assert len(storage_ids) + + # Check if storage exists after application deployed + logger.info("verifying that storage exists") + for storage_id in storage_ids: + for attempt in Retrying( + stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True + ): + with attempt: + assert await is_storage_exists(ops_test, storage_id) + + # Create test database to check there is no resources conflicts + logger.info("creating db") + await create_db(ops_test, app_name, TEST_DATABASE_NAME) + + # Check that test database is not exists for new unit + logger.info("checking db") + assert await check_db(ops_test, app_name, TEST_DATABASE_NAME) + + # Force remove unit without storage removal + if substrate == Substrate.vm: + logger.info("force removing charm") + await ops_test.model.destroy_unit( + primary_name, force=True, destroy_storage=False, max_wait=1500 + ) + else: + logger.info("scale to 0 with force") + await remove_unit_force(ops_test, 1) + + # Storage should remain + logger.info("verifying that storage exists") + for storage_id in storage_ids: + for attempt in Retrying( + stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True + ): + with attempt: + assert await is_storage_exists(ops_test, storage_id) + + +@pytest.mark.abort_on_fail +async def test_app_garbage_ignorance(ops_test: OpsTest, app_name: str, substrate: Substrate): + """Test charm deploy in dirty environment with garbage storage.""" + global primary_pvs, primary_pvcs + async with ops_test.fast_forward(): + logger.info("checking garbage storage") + garbage_storages = None + for attempt in Retrying(stop=stop_after_delay(30 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + garbage_storages = await get_detached_storages(ops_test) + if substrate == Substrate.vm: + assert len(garbage_storages) == 4 + logger.info(f"Collected storages: {garbage_storages}") + + if substrate == Substrate.vm: + logger.info("add unit with attached storage") + await add_unit_with_storage(ops_test, app_name, garbage_storages) + else: + logger.info("scale to 1") + await scale_application(ops_test, app_name, 1) + + # Timeout is increeced due to k8s Init:CrashLoopBackOff status of postgresql pod + logger.info("waiting for idle") + await ops_test.model.wait_for_idle(status="active", timeout=2000) + assert ops_test.model.applications[app_name].units[0].workload_status == "active" + + primary_name = ops_test.model.applications[app_name].units[0].name + + logger.info("waiting for postgresql") + for attempt in Retrying(stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + assert await is_postgresql_ready(ops_test, primary_name) + + logger.info("getting storage id") + storage_ids = await get_storage_ids(ops_test, primary_name) + + assert len(storage_ids) + + for storage_id in storage_ids: + assert storage_id in garbage_storages + + # Check if storage exists after application deployed + logger.info("verifying is storage exists") + for storage_id in storage_ids: + for attempt in Retrying( + stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True + ): + with attempt: + assert await is_storage_exists(ops_test, storage_id) + + # Check that test database exists for new unit + logger.info("checking db") + assert await check_db(ops_test, app_name, TEST_DATABASE_NAME) + + if substrate == Substrate.vm: + logger.info("removing charm") + await ops_test.model.destroy_unit(primary_name) + else: + logger.info("scale to 0") + await scale_application(ops_test, app_name, 0) + + logger.info("changing pv reclaim policy") + primary_pvs = change_pvs_reclaim_policy(ops_test, primary_pvs, "Retain") + + logger.info("remove application") + await ops_test.model.remove_application(app_name, block_until_done=True) + + for _, primary_pvc in primary_pvcs.items(): + logger.info(f"delete pvc {primary_pvc.metadata.name}") + delete_pvc(ops_test, primary_pvc) + + +@pytest.mark.vm_only +@pytest.mark.abort_on_fail +@pytest.mark.skip(reason="Unstable") +async def test_app_resources_conflicts_v3(ops_test: OpsTest, charm: str): + """Test application deploy in dirty environment with garbage storage from another application.""" + async with ops_test.fast_forward(): + logger.info("checking garbage storage") + garbage_storages = None + for attempt in Retrying(stop=stop_after_delay(30 * 3), wait=wait_fixed(3), reraise=True): + with attempt: + garbage_storages = await get_detached_storages(ops_test) + assert len(garbage_storages) == 4 + logger.info(f"Collected storages: {garbage_storages}") + + logger.info("deploying duplicate application with attached storage") + await ops_test.model.deploy( + charm, + application_name=DUP_DATABASE_APP_NAME, + num_units=1, + base=CHARM_BASE, + attach_storage=[tag.storage(storage) for storage in garbage_storages], + config={"profile": "testing"}, + ) + + # Reducing the update status frequency to speed up the triggering of deferred events. + await ops_test.model.set_config({"update-status-hook-interval": "10s"}) + + logger.info("waiting for duplicate application to be waiting") + try: + await ops_test.model.wait_for_idle( + apps=[DUP_DATABASE_APP_NAME], timeout=60, idle_period=30, status="waiting" + ) + except TimeoutError: + logger.info("Application is not in waiting state. Checking logs...") + + for attempt in Retrying(stop=stop_after_delay(60 * 10), wait=wait_fixed(3), reraise=True): + with attempt: + # Since application have postgresql db in storage from external application it should not be able to connect due to new password + assert not await check_password_auth( + ops_test, ops_test.model.applications[DUP_DATABASE_APP_NAME].units[0].name + ) + + +@pytest.mark.k8s_only +@pytest.mark.abort_on_fail +async def test_app_resources_conflicts(ops_test: OpsTest, charm: str, charm_resources): # noqa: C901 + """Test application deploy in dirty environment with garbage storage from another application.""" + global primary_pvs, primary_pvcs + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + resources=charm_resources, + application_name=DUP_DATABASE_APP_NAME, + num_units=1, + base=CHARM_BASE, + trust=True, + config={"profile": "testing"}, + ) + + logger.info("waiting for idle") + await ops_test.model.wait_for_idle(status="active", timeout=1000) + assert ( + ops_test.model.applications[DUP_DATABASE_APP_NAME].units[0].workload_status == "active" + ) + + dup_primary_name = ops_test.model.applications[DUP_DATABASE_APP_NAME].units[0].name + + assert dup_primary_name + + logger.info(f"get pvc for {dup_primary_name}") + dup_primary_pvcs = get_pvcs(ops_test, dup_primary_name) + + assert len(dup_primary_pvcs) + + logger.info("scale to 0") + await scale_application(ops_test, DUP_DATABASE_APP_NAME, 0) + + for pvc_storage_name, pvc in dup_primary_pvcs.items(): + logger.info(f"load and change pv-name config for pvc {pvc.metadata.name}") + dup_primary_pvcs[pvc_storage_name] = change_pvc_pv_name( + pvc, primary_pvs[pvc_storage_name].metadata.name + ) + + for _, dup_primary_pvc in dup_primary_pvcs.items(): + logger.info(f"delete pvc {dup_primary_pvc.metadata.name}") + delete_pvc(ops_test, dup_primary_pvc) + + client = Client(namespace=ops_test.model.name) + for _, dup_primary_pvc in dup_primary_pvcs.items(): + logger.info(f"waiting for pvc {dup_primary_pvc.metadata.name} to be deleted") + for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3), reraise=True): + with attempt: + try: + client.get(PersistentVolumeClaim, name=dup_primary_pvc.metadata.name) + except ApiError as e: + if e.status.code == 404: + break + raise + raise Exception(f"pvc {dup_primary_pvc.metadata.name} still exists") + + for _, primary_pv in primary_pvs.items(): + logger.info(f"remove claimref from pv {primary_pv.metadata.name}") + remove_pv_claimref(ops_test, primary_pv) + + for _, dup_primary_pvc in dup_primary_pvcs.items(): + logger.info(f"apply pvc {dup_primary_pvc.metadata.name}") + apply_pvc_config(ops_test, dup_primary_pvc) + + logger.info("scale to 1") + await ops_test.model.applications[DUP_DATABASE_APP_NAME].scale(1) + + logger.info("waiting for duplicate application to be blocked") + try: + await ops_test.model.wait_for_idle( + apps=[DUP_DATABASE_APP_NAME], timeout=500, status="blocked" + ) + except TimeoutError: + logger.info("Application is not in blocked state. Checking logs...") + + # Since application have postgresql db in storage from external application it should not be able to connect due to new password + logger.info("checking operator password auth") + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3), reraise=True): + with attempt: + assert await check_system_id_mismatch(ops_test, dup_primary_name) diff --git a/tests/integration/charm/ha_tests/test_synchronous_policy.py b/tests/integration/charm/ha_tests/test_synchronous_policy.py new file mode 100644 index 00000000..cd7768dc --- /dev/null +++ b/tests/integration/charm/ha_tests/test_synchronous_policy.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +# Copyright 2024 Canonical Ltd. +# See LICENSE file for licensing details. +import pytest +from pytest_operator.plugin import OpsTest +from tenacity import Retrying, stop_after_attempt, wait_fixed + +from tests.integration.charm.ha_tests.helpers import get_cluster_roles +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE +from tests.integration.types import Substrate + + +@pytest.mark.abort_on_fail +async def test_build_and_deploy( + ops_test: OpsTest, charm: str, app_name: str, charm_resources, substrate: Substrate +) -> None: + """Build and deploy three units of PostgreSQL.""" + async with ops_test.fast_forward(): + await ops_test.model.deploy( + charm, + application_name=app_name, + num_units=3, + base=CHARM_BASE, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ) + await ops_test.model.wait_for_idle(status="active", timeout=1500) + + +async def test_default_all(ops_test: OpsTest, app_name: str) -> None: + app = app_name + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active", timeout=300) + + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + roles = await get_cluster_roles( + ops_test, ops_test.model.applications[app].units[0].name + ) + + assert len(roles["primaries"]) == 1 + assert len(roles["sync_standbys"]) == 2 + assert len(roles["replicas"]) == 0 + + +async def test_majority(ops_test: OpsTest, app_name: str) -> None: + app = app_name + + await ops_test.model.applications[app].set_config({"synchronous-node-count": "majority"}) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active") + + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + roles = await get_cluster_roles( + ops_test, ops_test.model.applications[app].units[0].name + ) + + assert len(roles["primaries"]) == 1 + assert len(roles["sync_standbys"]) == 1 + assert len(roles["replicas"]) == 1 + + +async def test_constant(ops_test: OpsTest, app_name: str) -> None: + app = app_name + + await ops_test.model.applications[app].set_config({"synchronous-node-count": "2"}) + + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=[app], status="active", timeout=300) + + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(5), reraise=True): + with attempt: + roles = await get_cluster_roles( + ops_test, ops_test.model.applications[app].units[0].name + ) + + assert len(roles["primaries"]) == 1 + assert len(roles["sync_standbys"]) == 2 + assert len(roles["replicas"]) == 0 diff --git a/tests/integration/charm/new_relations/__init__.py b/tests/integration/charm/new_relations/__init__.py new file mode 100644 index 00000000..fa89e9d7 --- /dev/null +++ b/tests/integration/charm/new_relations/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2026 Canonical Ltd. +# See LICENSE file for licensing details. diff --git a/tests/integration/charm/new_relations/helpers.py b/tests/integration/charm/new_relations/helpers.py new file mode 100644 index 00000000..1f8ae6c0 --- /dev/null +++ b/tests/integration/charm/new_relations/helpers.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import json + +import yaml +from lightkube import AsyncClient +from lightkube.resources.core_v1 import Service +from pytest_operator.plugin import OpsTest + +from tests.integration.charm.pytest_operator_helpers import get_substrate +from tests.integration.types import Substrate + + +async def get_juju_secret(ops_test: OpsTest, secret_uri: str) -> dict[str, str]: + """Retrieve juju secret.""" + secret_unique_id = secret_uri.split("/")[-1] + complete_command = f"show-secret {secret_uri} --reveal --format=json" + _, stdout, _ = await ops_test.juju(*complete_command.split()) + return json.loads(stdout)[secret_unique_id]["content"]["Data"] + + +async def build_connection_string( + ops_test: OpsTest, + application_name: str, + relation_name: str, + *, + relation_id: str | None = None, + relation_alias: str | None = None, + read_only_endpoint: bool = False, + database: str | None = None, +) -> str: + """Build a PostgreSQL connection string. + + Args: + ops_test: The ops test framework instance + application_name: The name of the application + relation_name: name of the relation to get connection data from + relation_id: id of the relation to get connection data from + relation_alias: alias of the relation (like a connection name) + to get connection data from + read_only_endpoint: whether to choose the read-only endpoint + instead of the read/write endpoint + database: optional database to be used in the connection string + + Returns: + a PostgreSQL connection string + """ + # Get the connection data exposed to the application through the relation. + if database is None: + database = f"{application_name.replace('-', '_')}_{relation_name.replace('-', '_')}" + + if secret_uri := await get_application_relation_data( + ops_test, + application_name, + relation_name, + "secret-user", + relation_id, + relation_alias, + ): + secret_data = await get_juju_secret(ops_test, secret_uri) + username = secret_data["username"] + password = secret_data["password"] + else: + username = await get_application_relation_data( + ops_test, application_name, relation_name, "username", relation_id, relation_alias + ) + password = await get_application_relation_data( + ops_test, application_name, relation_name, "password", relation_id, relation_alias + ) + + endpoints = await get_application_relation_data( + ops_test, + application_name, + relation_name, + "read-only-endpoints" if read_only_endpoint else "endpoints", + relation_id, + relation_alias, + ) + host = endpoints.split(",")[0].split(":")[0] + + if get_substrate(ops_test) == Substrate.k8s: + # Translate the service hostname to an IP address. + model = ops_test.model.info + client = AsyncClient(namespace=model.name) + service = await client.get(Service, name=host.split(".")[0]) + host = service.spec.clusterIP + + # Build the complete connection string to connect to the database. + return f"dbname='{database}' user='{username}' host='{host}' password='{password}' connect_timeout=10" + + +async def get_alias_from_relation_data( + ops_test: OpsTest, unit_name: str, related_unit_name: str +) -> str | None: + """Get the alias that the unit assigned to the related unit application/cluster. + + Args: + ops_test: The ops test framework instance + unit_name: The name of the unit + related_unit_name: name of the related unit + + Returns: + the alias for the application/cluster of + the related unit + + Raises: + ValueError if it's not possible to get unit data + or if there is no alias on that. + """ + raw_data = (await ops_test.juju("show-unit", related_unit_name))[1] + if not raw_data: + raise ValueError(f"no unit info could be grabbed for {related_unit_name}") + data = yaml.safe_load(raw_data) + + # Retrieve the relation data from the unit. + relation_data = {} + for relation in data[related_unit_name]["relation-info"]: + for name, unit in relation["related-units"].items(): + if name == unit_name: + relation_data = unit["data"] + break + + # Check whether the unit has set an alias for the related unit application/cluster. + if "alias" not in relation_data: + raise ValueError(f"no alias could be grabbed for {related_unit_name} application/cluster") + + return relation_data["alias"] + + +async def get_application_relation_data( + ops_test: OpsTest, + application_name: str, + relation_name: str, + key: str, + relation_id: str | None = None, + relation_alias: str | None = None, +) -> str | None: + """Get relation data for an application. + + Args: + ops_test: The ops test framework instance + application_name: The name of the application + relation_name: name of the relation to get connection data from + key: key of data to be retrieved + relation_id: id of the relation to get connection data from + relation_alias: alias of the relation (like a connection name) + to get connection data from + + Returns: + the data that was requested or None + if no data in the relation + + Raises: + ValueError if it's not possible to get application data + or if there is no data for the particular relation endpoint + and/or alias. + """ + unit_name = f"{application_name}/0" + raw_data = (await ops_test.juju("show-unit", unit_name))[1] + if not raw_data: + raise ValueError(f"no unit info could be grabbed for {unit_name}") + data = yaml.safe_load(raw_data) + # Filter the data based on the relation name. + relation_data = [v for v in data[unit_name]["relation-info"] if v["endpoint"] == relation_name] + if relation_id: + # Filter the data based on the relation id. + relation_data = [v for v in relation_data if v["relation-id"] == relation_id] + if relation_alias: + # Filter the data based on the cluster/relation alias. + relation_data = [ + v + for v in relation_data + if await get_alias_from_relation_data( + ops_test, unit_name, next(iter(v["related-units"])) + ) + == relation_alias + ] + if len(relation_data) == 0: + raise ValueError( + f"no relation data could be grabbed on relation with endpoint {relation_name} and alias {relation_alias}" + ) + return relation_data[0]["application-data"].get(key) diff --git a/tests/integration/charm/new_relations/test_new_relations_1.py b/tests/integration/charm/new_relations/test_new_relations_1.py new file mode 100644 index 00000000..087e408e --- /dev/null +++ b/tests/integration/charm/new_relations/test_new_relations_1.py @@ -0,0 +1,761 @@ +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import asyncio +import logging + +import psycopg2 +import pytest +from pytest_operator.plugin import OpsTest +from single_kernel_postgresql.config.literals import DATABASE_DEFAULT_NAME +from tenacity import Retrying, stop_after_attempt, wait_fixed + +from tests.integration.charm.new_relations.helpers import ( + build_connection_string, + get_application_relation_data, +) +from tests.integration.charm.pytest_operator_helpers import ( + CHARM_BASE, + assert_sync_standbys, + check_database_users_existence, + get_leader_unit, + get_machine_from_unit, + get_primary, + scale_application, + start_machine, + stop_machine, +) + +logger = logging.getLogger(__name__) + +APPLICATION_APP_NAME = "postgresql-test-app" +DATABASE_APP_NAME = "database" +ANOTHER_DATABASE_APP_NAME = "another-database" +DATA_INTEGRATOR_APP_NAME = "data-integrator" +APP_NAMES = [APPLICATION_APP_NAME, DATABASE_APP_NAME, ANOTHER_DATABASE_APP_NAME] +FIRST_DATABASE_RELATION_NAME = "database" +SECOND_DATABASE_RELATION_NAME = "second-database" +MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME = "multiple-database-clusters" +ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME = "aliased-multiple-database-clusters" +NO_DATABASE_RELATION_NAME = "no-database" +INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles" + + +@pytest.mark.vm_only +@pytest.mark.abort_on_fail +async def test_deploy_charms(ops_test: OpsTest, charm): + """Deploy both charms (application and database) to use in the tests.""" + # Deploy both charms (multiple units for each application to test that later they correctly + # set data in the relation application databag using only the leader unit). + async with ops_test.fast_forward(): + await asyncio.gather( + ops_test.model.deploy( + APPLICATION_APP_NAME, + application_name=APPLICATION_APP_NAME, + num_units=2, + channel="latest/edge", + series="noble", + ), + ops_test.model.deploy( + charm, + application_name=DATABASE_APP_NAME, + num_units=1, + base=CHARM_BASE, + config={"profile": "testing"}, + ), + ops_test.model.deploy( + charm, + application_name=ANOTHER_DATABASE_APP_NAME, + num_units=2, + base=CHARM_BASE, + config={"profile": "testing"}, + ), + ) + + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, ANOTHER_DATABASE_APP_NAME], status="active", timeout=3000 + ) + + +@pytest.mark.k8s_only +@pytest.mark.abort_on_fail +async def test_database_relation_with_charm_libraries_k8s( + ops_test: OpsTest, charm, charm_resources +): + """Test basic functionality of database relation interface.""" + # Deploy both charms (multiple units for each application to test that later they correctly + # set data in the relation application databag using only the leader unit). + async with ops_test.fast_forward(): + await asyncio.gather( + ops_test.model.deploy( + APPLICATION_APP_NAME, + application_name=APPLICATION_APP_NAME, + num_units=2, + base=CHARM_BASE, + channel="latest/edge", + ), + ops_test.model.deploy( + charm, + resources=charm_resources, + application_name=DATABASE_APP_NAME, + num_units=3, + base=CHARM_BASE, + trust=True, + config={"profile": "testing"}, + ), + ops_test.model.deploy( + charm, + resources=charm_resources, + application_name=ANOTHER_DATABASE_APP_NAME, + num_units=3, + base=CHARM_BASE, + trust=True, + config={"profile": "testing"}, + ), + ) + # Relate the charms and wait for them exchanging some connection data. + await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], + status="active", + raise_on_blocked=True, + raise_on_error=False, + timeout=1000, + ) + + # Check that on juju 3 we have secrets and no username and password in the rel databag + if hasattr(ops_test.model, "list_secrets"): + logger.info("checking for secrets") + secret_uri, password = await asyncio.gather( + get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "secret-user", + ), + get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "password", + ), + ) + assert secret_uri is not None + assert password is None + + # Get the connection string to connect to the database using the read/write endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + + # Connect to the database using the read/write endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Check that it's possible to write and read data from the database that + # was created for the application. + connection.autocommit = True + cursor.execute("DROP TABLE IF EXISTS test;") + cursor.execute("CREATE TABLE test(data TEXT);") + cursor.execute("INSERT INTO test(data) VALUES('some data');") + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Check the version that the application received is the same on the database server. + cursor.execute("SELECT version();") + data = cursor.fetchone()[0].split(" ")[1] + + # Get the version of the database and compare with the information that + # was retrieved directly from the database. + version = await get_application_relation_data( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, "version" + ) + assert version == data + + # Get the connection string to connect to the database using the read-only endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, read_only_endpoint=True + ) + + # Connect to the database using the read-only endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Read some data. + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Try to alter some data in a read-only transaction. + with pytest.raises(psycopg2.errors.ReadOnlySqlTransaction): + cursor.execute("DROP TABLE test;") + + +@pytest.mark.vm_only +async def test_primary_read_only_endpoint_in_standalone_cluster_vm(ops_test: OpsTest): + """Test that there is no read-only endpoint in a standalone cluster.""" + async with ops_test.fast_forward(): + # Ensure the cluster starts with only one member. + # We can't scale down a running cluster to 1 unit because the way + # Patroni raft implementation works (to scale from 2 units to 1 Patroni + # needs at least one mode unit that run only raft to have quorum). + assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 1 + + # Relate the charms and wait for them exchanging some connection data. + await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active") + + # Check that on juju 3 we have secrets and no username and password in the rel databag + logger.info("checking for secrets") + secret_uri, password = await asyncio.gather( + get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "secret-user", + ), + get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "password", + ), + ) + assert secret_uri is not None + assert password is None + + # Try to get the connection string of the database using the read-only endpoint. + # It should be the primary. + primary_unit = ops_test.model.applications[DATABASE_APP_NAME].units[0] + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(3), reraise=True): + with attempt: + data = await get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "read-only-endpoints", + ) + assert data == f"{primary_unit.public_address}:5432" + + +@pytest.mark.vm_only +async def test_read_only_endpoint_in_scaled_up_cluster_vm(ops_test: OpsTest): + """Test that there is read-only endpoint in a scaled up cluster.""" + async with ops_test.fast_forward(): + # Scale up the database. + await scale_application(ops_test, DATABASE_APP_NAME, 2) + primary = await get_primary(ops_test, DATABASE_APP_NAME) + replica = next( + unit + for unit in ops_test.model.applications[DATABASE_APP_NAME].units + if unit.name != primary + ) + + # Try to get the connection string of the database using the read-only endpoint. + # It should be the replica unit. + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(3), reraise=True): + with attempt: + data = await get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "read-only-endpoints", + ) + assert data == f"{replica.public_address}:5432" + + +@pytest.mark.vm_only +async def test_database_relation_with_charm_libraries_vm(ops_test: OpsTest): + """Test basic functionality of database relation interface.""" + # Get the connection string to connect to the database using the read/write endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + + # Connect to the database using the read/write endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Check that it's possible to write and read data from the database that + # was created for the application. + connection.autocommit = True + cursor.execute("DROP TABLE IF EXISTS test;") + cursor.execute("CREATE TABLE test(data TEXT);") + cursor.execute("INSERT INTO test(data) VALUES('some data');") + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Check the version that the application received is the same on the database server. + cursor.execute("SELECT version();") + data = cursor.fetchone()[0].split(" ")[1] + + # Get the version of the database and compare with the information that + # was retrieved directly from the database. + version = await get_application_relation_data( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, "version" + ) + assert version == data + + # Get the connection string to connect to the database using the read-only endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, read_only_endpoint=True + ) + + # Connect to the database using the read-only endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Read some data. + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Try to alter some data in a read-only transaction. + with pytest.raises(psycopg2.errors.ReadOnlySqlTransaction): + cursor.execute("DROP TABLE test;") + + +@pytest.mark.vm_only +@pytest.mark.abort_on_fail +async def test_filter_out_degraded_replicas(ops_test: OpsTest): + primary = await get_primary(ops_test, DATABASE_APP_NAME) + replica = next( + unit.name + for unit in ops_test.model.applications[DATABASE_APP_NAME].units + if unit.name != primary + ) + machine = await get_machine_from_unit(ops_test, replica) + await stop_machine(ops_test, machine) + + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(3), reraise=True): + # Topology observer runs every half a minute + await asyncio.sleep(60) + with attempt: + data = await get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "read-only-endpoints", + ) + assert data == f"{ops_test.model.units[primary].public_address}:5432" + + await start_machine(ops_test, machine) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], status="active", timeout=200, raise_on_error=False + ) + + +async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: OpsTest): + """Test that two different application connect to the database with different credentials.""" + # Set some variables to use in this test. + another_application_app_name = "another-application" + all_app_names = [another_application_app_name] + all_app_names.extend(APP_NAMES) + + # Deploy another application. + await ops_test.model.deploy( + APPLICATION_APP_NAME, + application_name=another_application_app_name, + base=CHARM_BASE, + channel="latest/edge", + ) + + # Relate the new application with the database + # and wait for them exchanging some connection data. + await ops_test.model.add_relation( + f"{another_application_app_name}:{FIRST_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle(apps=all_app_names, status="active", idle_period=30) + + # Assert the two application have different relation (connection) data. + application_connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + another_application_connection_string = await build_connection_string( + ops_test, another_application_app_name, FIRST_DATABASE_RELATION_NAME + ) + + assert application_connection_string != another_application_connection_string + + # Check that the user cannot access other databases. + for application, other_application_database in [ + (APPLICATION_APP_NAME, "another_application_database"), + (another_application_app_name, f"{APPLICATION_APP_NAME.replace('-', '_')}_database"), + ]: + connection_string = await build_connection_string( + ops_test, + application, + FIRST_DATABASE_RELATION_NAME, + database=DATABASE_DEFAULT_NAME, + ) + with pytest.raises(psycopg2.Error): + psycopg2.connect(connection_string) + connection_string = await build_connection_string( + ops_test, + application, + FIRST_DATABASE_RELATION_NAME, + database=other_application_database, + ) + with pytest.raises(psycopg2.Error): + psycopg2.connect(connection_string) + + +async def test_an_application_can_connect_to_multiple_database_clusters(ops_test: OpsTest): + """Test that an application can connect to different clusters of the same database.""" + # Relate the application with both database clusters + # and wait for them exchanging some connection data. + first_cluster_relation = await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME}", DATABASE_APP_NAME + ) + second_cluster_relation = await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME}", + ANOTHER_DATABASE_APP_NAME, + ) + await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", idle_period=30) + + # Retrieve the connection string to both database clusters using the relation aliases + # and assert they are different. + application_connection_string = await build_connection_string( + ops_test, + APPLICATION_APP_NAME, + MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME, + relation_id=first_cluster_relation.id, + ) + another_application_connection_string = await build_connection_string( + ops_test, + APPLICATION_APP_NAME, + MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME, + relation_id=second_cluster_relation.id, + ) + assert application_connection_string != another_application_connection_string + + +# @pytest.mark.skip(reason="Unstable") +# async def test_an_application_can_connect_to_multiple_aliased_database_clusters( +# ops_test: OpsTest, +# ): +# """Test that an application can connect to different clusters of the same database.""" +# # Relate the application with both database clusters +# # and wait for them exchanging some connection data. +# await asyncio.gather( +# ops_test.model.add_relation( +# f"{APPLICATION_APP_NAME}:{ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME}", +# DATABASE_APP_NAME, +# ), +# ops_test.model.add_relation( +# f"{APPLICATION_APP_NAME}:{ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME}", +# ANOTHER_DATABASE_APP_NAME, +# ), +# ) +# await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active") +# +# # Retrieve the connection string to both database clusters using the relation aliases +# # and assert they are different. +# for attempt in Retrying(stop=stop_after_attempt(5), wait=wait_fixed(3), reraise=True): +# with attempt: +# application_connection_string = await build_connection_string( +# ops_test, +# APPLICATION_APP_NAME, +# ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME, +# relation_alias="cluster1", +# ) +# another_application_connection_string = await build_connection_string( +# ops_test, +# APPLICATION_APP_NAME, +# ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME, +# relation_alias="cluster2", +# ) +# assert application_connection_string != another_application_connection_string + + +@pytest.mark.abort_on_fail +async def test_an_application_can_request_multiple_databases(ops_test: OpsTest): + """Test that an application can request additional databases using the same interface.""" + # Relate the charms using another relation and wait for them exchanging some connection data. + await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{SECOND_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle( + apps=APP_NAMES, status="active", timeout=15 * 60, idle_period=30 + ) + + # Get the connection strings to connect to both databases. + for attempt in Retrying(stop=stop_after_attempt(15), wait=wait_fixed(3), reraise=True): + with attempt: + first_database_connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + second_database_connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, SECOND_DATABASE_RELATION_NAME + ) + + # Assert the two application have different relation (connection) data. + assert first_database_connection_string != second_database_connection_string + + +@pytest.mark.k8s_only +async def test_primary_read_only_endpoint_in_standalone_cluster_k8s(ops_test: OpsTest): + """Test that there is no read-only endpoint in a standalone cluster.""" + async with ops_test.fast_forward(): + # Scale down the database. + await scale_application(ops_test, DATABASE_APP_NAME, 1) + + # Try to get the connection string of the database using the read-only endpoint. + # It should not be available anymore. + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(3), reraise=True): + with attempt: + data = await get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "read-only-endpoints", + ) + assert ( + data + == f"{DATABASE_APP_NAME}-primary.{ops_test.model.name}.svc.cluster.local:5432" + ) + + +@pytest.mark.k8s_only +async def test_read_only_endpoint_in_scaled_up_cluster_k8s(ops_test: OpsTest): + """Test that there is read-only endpoint in a scaled up cluster.""" + async with ops_test.fast_forward(): + # Scale up the database. + await scale_application(ops_test, DATABASE_APP_NAME, 3) + + # Try to get the connection string of the database using the read-only endpoint. + # It should be available again. + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(3), reraise=True): + with attempt: + data = await get_application_relation_data( + ops_test, + APPLICATION_APP_NAME, + FIRST_DATABASE_RELATION_NAME, + "read-only-endpoints", + ) + assert ( + data + == f"{DATABASE_APP_NAME}-replicas.{ops_test.model.name}.svc.cluster.local:5432" + ) + + +@pytest.mark.k8s_only +async def test_relation_broken(ops_test: OpsTest): + """Test that the user is removed when the relation is broken.""" + async with ops_test.fast_forward(): + # Retrieve the relation user. + relation_user = await get_application_relation_data( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, "username" + ) + + # Break the relation. + await ops_test.model.applications[DATABASE_APP_NAME].remove_relation( + f"{DATABASE_APP_NAME}", f"{APPLICATION_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}" + ) + await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True) + + # Check that the relation user was removed from the database. + await check_database_users_existence( + ops_test, [], [relation_user], database_app_name=DATABASE_APP_NAME + ) + + +@pytest.mark.k8s_only +async def test_restablish_relation(ops_test: OpsTest): + """Test that a previously broken relation would be functional if restored.""" + # Relate the charms and wait for them exchanging some connection data. + async with ops_test.fast_forward(): + await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle( + apps=APP_NAMES, status="active", idle_period=30, raise_on_blocked=True + ) + + # Get the connection string to connect to the database using the read-only endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, read_only_endpoint=True + ) + + # Connect to the database using the read-only endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Check that preexisting data is still accessible. + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Get the connection string to connect to the database using the read/write endpoint. + connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + + # Connect to the database using the read/write endpoint. + with psycopg2.connect(connection_string) as connection, connection.cursor() as cursor: + # Check that it's possible to write and read data from the database. + connection.autocommit = True + cursor.execute("DELETE FROM test;") + cursor.execute("INSERT INTO test(data) VALUES('other data');") + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "other data" + + +@pytest.mark.vm_only +@pytest.mark.abort_on_fail +async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest): + """Test that relation data, like connection data, is updated correctly when scaling.""" + # Retrieve the list of current database unit names. + units_to_remove = [unit.name for unit in ops_test.model.applications[DATABASE_APP_NAME].units] + + async with ops_test.fast_forward(fast_interval="60s"): + # Add two more units. + await ops_test.model.applications[DATABASE_APP_NAME].add_units(2) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], status="active", timeout=3000, wait_for_exact_units=4 + ) + + assert_sync_standbys( + ops_test.model.applications[DATABASE_APP_NAME].units[0].public_address, 2 + ) + + # Remove the original units. + leader_unit = await get_leader_unit(ops_test, DATABASE_APP_NAME) + await ops_test.model.applications[DATABASE_APP_NAME].destroy_units(*[ + unit for unit in units_to_remove if unit != leader_unit.name + ]) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], status="active", timeout=600, wait_for_exact_units=3 + ) + await ops_test.model.applications[DATABASE_APP_NAME].destroy_units(leader_unit.name) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], status="active", timeout=600, wait_for_exact_units=2 + ) + + # Get the updated connection data and assert it can be used + # to write and read some data properly. + primary_connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME + ) + replica_connection_string = await build_connection_string( + ops_test, APPLICATION_APP_NAME, FIRST_DATABASE_RELATION_NAME, read_only_endpoint=True + ) + + # Connect to the database using the primary connection string. + with psycopg2.connect(primary_connection_string) as connection: + connection.autocommit = True + with connection.cursor() as cursor: + # Check that it's possible to write and read data from the database that + # was created for the application. + cursor.execute("DROP TABLE IF EXISTS test;") + cursor.execute("CREATE TABLE test(data TEXT);") + cursor.execute("INSERT INTO test(data) VALUES('some data');") + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + connection.close() + + # Connect to the database using the replica endpoint. + with ( + psycopg2.connect(replica_connection_string) as connection, + connection.cursor() as cursor, + ): + # Read some data. + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Try to alter some data in a read-only transaction. + with pytest.raises(psycopg2.errors.ReadOnlySqlTransaction): + cursor.execute("DROP TABLE test;") + connection.close() + + async with ops_test.fast_forward(): + # Remove the relation and test that its user was deleted + # (by checking that the connection string doesn't work anymore). + await ops_test.model.applications[DATABASE_APP_NAME].remove_relation( + f"{DATABASE_APP_NAME}:database", + f"{APPLICATION_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}", + ) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], status="active", timeout=1000, idle_period=30 + ) + with pytest.raises(psycopg2.OperationalError): + psycopg2.connect(primary_connection_string) + + +@pytest.mark.abort_on_fail +async def test_relation_with_no_database_name(ops_test: OpsTest): + """Test that a relation with no database name doesn't block the charm.""" + async with ops_test.fast_forward(): + # Relate the charms using a relation that doesn't provide a database name. + await ops_test.model.add_relation( + f"{APPLICATION_APP_NAME}:{NO_DATABASE_RELATION_NAME}", DATABASE_APP_NAME + ) + await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True) + + # Break the relation. + await ops_test.model.applications[DATABASE_APP_NAME].remove_relation( + f"{DATABASE_APP_NAME}", f"{APPLICATION_APP_NAME}:{NO_DATABASE_RELATION_NAME}" + ) + await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True) + + +@pytest.mark.abort_on_fail +async def test_invalid_extra_user_roles(ops_test: OpsTest): + async with ops_test.fast_forward(): + # Base is ignored + await ops_test.model.deploy( + DATA_INTEGRATOR_APP_NAME, channel="latest/edge", series="noble" + ) + await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked") + + another_data_integrator_app_name = f"another-{DATA_INTEGRATOR_APP_NAME}" + data_integrator_apps_names = [DATA_INTEGRATOR_APP_NAME, another_data_integrator_app_name] + # Base is ignored + await ops_test.model.deploy( + DATA_INTEGRATOR_APP_NAME, + application_name=another_data_integrator_app_name, + channel="latest/edge", + series="noble", + ) + await ops_test.model.wait_for_idle( + apps=[another_data_integrator_app_name], status="blocked" + ) + for app in data_integrator_apps_names: + await ops_test.model.applications[app].set_config({ + "database-name": app.replace("-", "_"), + "extra-user-roles": "test", + }) + await ops_test.model.wait_for_idle(apps=data_integrator_apps_names, status="blocked") + for app in data_integrator_apps_names: + await ops_test.model.add_relation(f"{app}:postgresql", f"{DATABASE_APP_NAME}:database") + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME]) + await ops_test.model.block_until( + lambda: any( + unit.workload_status_message == INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE + for unit in ops_test.model.applications[DATABASE_APP_NAME].units + ), + timeout=1000, + ) + + # Verify that the charm remains blocked if there are still other relations with invalid + # extra user roles. + await ops_test.model.applications[DATABASE_APP_NAME].destroy_relation( + f"{DATABASE_APP_NAME}:database", f"{DATA_INTEGRATOR_APP_NAME}:postgresql" + ) + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME]) + await ops_test.model.block_until( + lambda: any( + unit.workload_status_message == INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE + for unit in ops_test.model.applications[DATABASE_APP_NAME].units + ), + timeout=1000, + ) + + # Verify that active status is restored after all relations are removed. + await ops_test.model.applications[DATABASE_APP_NAME].destroy_relation( + f"{DATABASE_APP_NAME}:database", f"{another_data_integrator_app_name}:postgresql" + ) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], + status="active", + raise_on_blocked=False, + timeout=1000, + ) diff --git a/tests/integration/charm/new_relations/test_new_relations_2.py b/tests/integration/charm/new_relations/test_new_relations_2.py new file mode 100644 index 00000000..b2350c6e --- /dev/null +++ b/tests/integration/charm/new_relations/test_new_relations_2.py @@ -0,0 +1,207 @@ +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import asyncio +import logging +from asyncio import gather + +import pytest +from pytest_operator.plugin import OpsTest + +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE + +logger = logging.getLogger(__name__) + +DATABASE_APP_NAME = "database" +DISCOURSE_APP_NAME = "discourse-k8s" +REDIS_APP_NAME = "redis-k8s" + + +@pytest.mark.vm_only +@pytest.mark.skip(reason="Unstable") +async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str, architecture: str) -> None: + if architecture != "amd64": + pytest.skip("nextcloud charm not available for arm64") + # Deploy Database Charm and Nextcloud + await asyncio.gather( + ops_test.model.deploy( + charm, + application_name=DATABASE_APP_NAME, + num_units=1, + base=CHARM_BASE, + config={"profile": "testing"}, + ), + ops_test.model.deploy( + "nextcloud", + channel="edge", + application_name="nextcloud", + num_units=1, + base=CHARM_BASE, + ), + ) + await asyncio.gather( + ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=2000), + ops_test.model.wait_for_idle( + apps=["nextcloud"], + status="blocked", + raise_on_blocked=False, + timeout=2000, + ), + ) + + await ops_test.model.relate("nextcloud:database", f"{DATABASE_APP_NAME}:database") + + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, "nextcloud"], + status="active", + raise_on_blocked=False, + timeout=1000, + ) + + +@pytest.mark.k8s_only +@pytest.mark.abort_on_fail +async def test_database_deploy_clientapps(ops_test: OpsTest, charm, charm_resources): + """Test basic functionality of database relation interface.""" + # Deploy both charms (multiple units for each application to test that later they correctly + # set data in the relation application databag using only the leader unit). + async with ops_test.fast_forward(): + await asyncio.gather( + ops_test.model.deploy( + charm, + resources=charm_resources, + application_name=DATABASE_APP_NAME, + num_units=3, + base=CHARM_BASE, + trust=True, + config={"profile": "testing"}, + ), + ) + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME], + status="active", + raise_on_blocked=True, + raise_on_error=False, + timeout=1000, + ) + + +@pytest.mark.k8s_only +async def test_discourse(ops_test: OpsTest, architecture: str): + if architecture != "amd64": + pytest.skip("discourse-k8s charm not available for arm64") + # Deploy Discourse and Redis. + await gather( + ops_test.model.deploy(DISCOURSE_APP_NAME, application_name=DISCOURSE_APP_NAME), + ops_test.model.deploy( + REDIS_APP_NAME, application_name=REDIS_APP_NAME, channel="latest/edge", series="jammy" + ), + ) + + async with ops_test.fast_forward(): + # Enable the plugins/extensions required by Discourse. + logger.info("Enabling the plugins/extensions required by Discourse") + config = {"plugin-hstore-enable": "True", "plugin-pg-trgm-enable": "True"} + await ops_test.model.applications[DATABASE_APP_NAME].set_config(config) + await gather( + ops_test.model.wait_for_idle(apps=[DISCOURSE_APP_NAME], status="waiting"), + ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, REDIS_APP_NAME], status="active" + ), + ) + # Add both relations to Discourse (PostgreSQL and Redis) + # and wait for it to be ready. + logger.info("Adding relations") + await gather( + ops_test.model.add_relation(DATABASE_APP_NAME, DISCOURSE_APP_NAME), + ops_test.model.add_relation(REDIS_APP_NAME, DISCOURSE_APP_NAME), + ) + await gather( + ops_test.model.wait_for_idle(apps=[DISCOURSE_APP_NAME], timeout=2000), + ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, REDIS_APP_NAME], status="active" + ), + ) + logger.info("Configuring Discourse") + config = { + "developer_emails": "noreply@canonical.com", + "external_hostname": "discourse-k8s", + "smtp_address": "test.local", + "smtp_domain": "test.local", + "s3_install_cors_rule": "false", + } + await ops_test.model.applications[DISCOURSE_APP_NAME].set_config(config) + await ops_test.model.wait_for_idle(apps=[DISCOURSE_APP_NAME], status="active") + + # Deploy a new discourse application (https://github.com/canonical/data-platform-libs/issues/118 + # prevents from re-relating the same Discourse application; Discourse uses the old secret and fails). + await ops_test.model.applications[DISCOURSE_APP_NAME].remove() + other_discourse_app_name = f"other-{DISCOURSE_APP_NAME}" + await ops_test.model.deploy(DISCOURSE_APP_NAME, application_name=other_discourse_app_name) + + # Add both relations to Discourse (PostgreSQL and Redis) + # and wait for it to be ready. + logger.info("Adding relations") + await gather( + ops_test.model.add_relation(DATABASE_APP_NAME, other_discourse_app_name), + ops_test.model.add_relation(REDIS_APP_NAME, other_discourse_app_name), + ) + await gather( + ops_test.model.wait_for_idle(apps=[other_discourse_app_name], timeout=2000), + ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, REDIS_APP_NAME], status="active" + ), + ) + logger.info("Configuring Discourse") + config = { + "developer_emails": "noreply@canonical.com", + "external_hostname": "discourse-k8s", + "smtp_address": "test.local", + "smtp_domain": "test.local", + "s3_install_cors_rule": "false", + } + await ops_test.model.applications[other_discourse_app_name].set_config(config) + await ops_test.model.wait_for_idle(apps=[other_discourse_app_name], status="active") + + +@pytest.mark.k8s_only +async def test_indico_datatabase(ops_test: OpsTest, architecture: str) -> None: + """Tests deploying and relating to the Indico charm.""" + if architecture != "amd64": + pytest.skip("indico charm not available for arm64") + async with ops_test.fast_forward(fast_interval="30s"): + await ops_test.model.deploy( + "indico", + channel="latest/edge", + application_name="indico", + num_units=1, + series="focal", + ) + await ops_test.model.deploy( + REDIS_APP_NAME, application_name="redis-broker", channel="latest/edge", series="jammy" + ) + await ops_test.model.deploy( + REDIS_APP_NAME, application_name="redis-cache", channel="latest/edge", series="jammy" + ) + await asyncio.gather( + ops_test.model.relate("redis-broker", "indico:redis-broker"), + ops_test.model.relate("redis-cache", "indico:redis-cache"), + ) + + # Wait for model to stabilise + await ops_test.model.wait_for_idle( + apps=["indico"], + status="waiting", + timeout=1000, + ) + + # Verify that the charm doesn't block when the extensions are enabled. + logger.info("Verifying that the charm doesn't block when the extensions are enabled") + config = {"plugin-pg-trgm-enable": "True", "plugin-unaccent-enable": "True"} + await ops_test.model.applications[DATABASE_APP_NAME].set_config(config) + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active") + await ops_test.model.relate(DATABASE_APP_NAME, "indico") + await ops_test.model.wait_for_idle( + apps=[DATABASE_APP_NAME, "indico"], + status="active", + timeout=2000, + ) diff --git a/tests/integration/charm/new_relations/test_relations_coherence.py b/tests/integration/charm/new_relations/test_relations_coherence.py new file mode 100644 index 00000000..76c5dc12 --- /dev/null +++ b/tests/integration/charm/new_relations/test_relations_coherence.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. +import logging +import secrets +import string +from asyncio import gather + +import psycopg2 +import pytest +from pytest_operator.plugin import OpsTest +from single_kernel_postgresql.config.literals import DATABASE_DEFAULT_NAME + +from tests.integration.charm.new_relations.helpers import build_connection_string +from tests.integration.charm.new_relations.test_new_relations_1 import DATA_INTEGRATOR_APP_NAME +from tests.integration.charm.pytest_operator_helpers import CHARM_BASE +from tests.integration.types import Substrate + +logger = logging.getLogger(__name__) + +APPLICATION_APP_NAME = "postgresql-test-app" +FIRST_DATABASE_RELATION_NAME = "database" + + +@pytest.mark.abort_on_fail +async def test_relations( + ops_test: OpsTest, charm, app_name: str, charm_resources, substrate: Substrate +): + """Test that check relation data.""" + app_names = [app_name, DATA_INTEGRATOR_APP_NAME] + async with ops_test.fast_forward(): + await gather( + ops_test.model.deploy( + charm, + application_name=app_name, + num_units=1, + base=CHARM_BASE, + config={"profile": "testing"}, + resources=charm_resources, + trust=substrate == Substrate.k8s, + ), + # Creating first time relation with user role + # Base is ignored + ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, series="noble"), + ) + await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({ + "database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"), + }) + await ops_test.model.add_relation(DATA_INTEGRATOR_APP_NAME, app_name) + await ops_test.model.wait_for_idle(apps=app_names, status="active", timeout=3000) + + connection_string = await build_connection_string( + ops_test, + DATA_INTEGRATOR_APP_NAME, + "postgresql", + database=DATA_INTEGRATOR_APP_NAME.replace("-", "_"), + ) + + connection = psycopg2.connect(connection_string) + connection.autocommit = True + cursor = connection.cursor() + try: + random_name = ( + f"test_{''.join(secrets.choice(string.ascii_lowercase) for _ in range(10))}" + ) + cursor.execute(f"CREATE DATABASE {random_name};") + assert False, "user role was able to create database" + except psycopg2.errors.InsufficientPrivilege: + pass + finally: + connection.close() + + with psycopg2.connect(connection_string) as connection: + connection.autocommit = True + with connection.cursor() as cursor: + # Check that it's possible to write and read data from the database that + # was created for the application. + cursor.execute("DROP TABLE IF EXISTS test;") + cursor.execute("CREATE TABLE test(data TEXT);") + cursor.execute("INSERT INTO test(data) VALUES('some data');") + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + connection.close() + + await ops_test.model.applications[app_name].remove_relation( + f"{app_name}:database", f"{DATA_INTEGRATOR_APP_NAME}:postgresql" + ) + + # Re-relation again with user role and checking write data + await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({ + "database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"), + "extra-user-roles": "", + }) + await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked") + await ops_test.model.add_relation(DATA_INTEGRATOR_APP_NAME, app_name) + await ops_test.model.wait_for_idle(apps=app_names, status="active") + + for database in [ + DATA_INTEGRATOR_APP_NAME.replace("-", "_"), + DATABASE_DEFAULT_NAME, + ]: + logger.info(f"connecting to the following database: {database}") + connection_string = await build_connection_string( + ops_test, DATA_INTEGRATOR_APP_NAME, "postgresql", database=database + ) + connection = None + should_fail = database == DATABASE_DEFAULT_NAME + try: + with ( + psycopg2.connect(connection_string) as connection, + connection.cursor() as cursor, + ): + cursor.execute("SELECT data FROM test;") + data = cursor.fetchone() + assert data[0] == "some data" + + # Write some data (it should fail in the default database name). + random_name = f"test_{''.join(secrets.choice(string.ascii_lowercase) for _ in range(10))}" + cursor.execute(f"CREATE TABLE {random_name}(data TEXT);") + if should_fail: + assert False, ( + f"failed to run a statement in the following database: {database}" + ) + except psycopg2.errors.InsufficientPrivilege as e: + if not should_fail: + logger.exception(e) + assert False, ( + f"failed to connect to or run a statement in the following database: {database}" + ) + except psycopg2.OperationalError as e: + if not should_fail: + logger.exception(e) + finally: + if connection is not None: + connection.close() diff --git a/tests/integration/charm/pytest_operator_helpers.py b/tests/integration/charm/pytest_operator_helpers.py new file mode 100644 index 00000000..d5385d3a --- /dev/null +++ b/tests/integration/charm/pytest_operator_helpers.py @@ -0,0 +1,335 @@ +#!/usr/bin/env python3 +# Copyright 2022 Canonical Ltd. +# See LICENSE file for licensing details. + +"""pytest-operator helpers shared by the VM and K8s tests (tests/integration/helpers.py of both repos). + +Only for the tests that use pytest-operator in both repos; the rest use charm/helpers.py. +""" + +import json +import logging +import subprocess +from subprocess import check_call + +import requests +from juju.model import Model +from juju.unit import Unit +from pytest_operator.plugin import OpsTest +from single_kernel_postgresql.config.literals import PEER_RELATION +from tenacity import Retrying, stop_after_delay, wait_fixed + +from tests.integration.helpers.postgresql import execute_query +from tests.integration.types import Substrate + +CHARM_BASE = "ubuntu@24.04" +APPLICATION_NAME = "postgresql-test-app" +PGDATA_PATH = "/var/lib/postgresql/16/main" + + +class SecretNotFoundError(Exception): + """Raised when a secret is not found.""" + + +try: + check_call(["kubectl", "version", "--client=true"]) + KUBECTL = "kubectl" +except FileNotFoundError: + KUBECTL = "sudo k8s kubectl" + +logger = logging.getLogger(__name__) + + +def get_substrate(ops_test: OpsTest) -> Substrate: + """Return the substrate of the ops_test model (a caas model on K8s).""" + return Substrate.k8s if ops_test.model.info.type_ == "caas" else Substrate.vm + + +async def app_name( + ops_test: OpsTest, application_name: str = "postgresql", model: Model = None +) -> str | None: + """Returns the name of the cluster running PostgreSQL. + + This is important since not all deployments of the PostgreSQL charm have the application name + "postgresql". + + Note: if multiple clusters are running PostgreSQL this will return the one first found. + """ + if model is None: + model = ops_test.model + status = await model.get_status() + for app in model.applications: + if ( + application_name in status["applications"][app]["charm"] + and APPLICATION_NAME not in status["applications"][app]["charm"] + ): + return app + + return None + + +async def get_leader_unit(ops_test: OpsTest, app: str, model: Model = None) -> Unit | None: + if model is None: + model = ops_test.model + + leader_unit = None + for unit in model.applications[app].units: + if await unit.is_leader_from_status(): + leader_unit = unit + break + + return leader_unit + + +def get_patroni_cluster(unit_ip: str) -> dict[str, str]: + for attempt in Retrying(stop=stop_after_delay(30), wait=wait_fixed(3)): + with attempt: + resp = requests.get(f"https://{unit_ip}:8008/cluster", verify=False) + return resp.json() + + +async def get_machine_from_unit(ops_test: OpsTest, unit_name: str) -> str: + """Get the name of the machine from a specific unit. + + Args: + ops_test: The ops test framework instance + unit_name: The name of the unit to get the machine + + Returns: + The name of the machine. + """ + raw_hostname = await run_command_on_unit(ops_test, unit_name, "hostname") + return raw_hostname.strip() + + +async def get_password( + ops_test: OpsTest, + username: str = "operator", + database_app_name: str | None = None, +) -> str: + """Retrieve a user password from the secret. + + Args: + ops_test: ops_test instance. + username: the user to get the password. + database_app_name: the app for getting the secret (defaults to the PostgreSQL cluster) + + Returns: + the user password. + """ + if database_app_name is None: + database_app_name = await app_name(ops_test) + secret = await get_secret_by_label(ops_test, label=f"{PEER_RELATION}.{database_app_name}.app") + password = secret.get(f"{username}-password") + + return password + + +async def get_secret_by_label(ops_test: OpsTest, label: str) -> dict[str, str]: + secrets_raw = await ops_test.juju("list-secrets") + secret_ids = [ + secret_line.split()[0] for secret_line in secrets_raw[1].split("\n")[1:] if secret_line + ] + + for secret_id in secret_ids: + secret_data_raw = await ops_test.juju( + "show-secret", "--format", "json", "--reveal", secret_id + ) + secret_data = json.loads(secret_data_raw[1]) + + if label == secret_data[secret_id].get("label"): + return secret_data[secret_id]["content"]["Data"] + + raise SecretNotFoundError(f"Secret with label {label} not found") + + +async def get_primary(ops_test: OpsTest, app, down_unit: str | None = None) -> str: + """Use the charm action to retrieve the primary from provided application. + + Args: + ops_test: OpsTest instance. + app: database application name. + down_unit: unit that is offline and the action won't run on. + + Returns: + primary unit name. + """ + for unit in ops_test.model.applications[app].units: + if unit.name != down_unit: + action = await unit.run_action("get-primary") + action = await action.wait() + primary = action.results.get("primary", "None") + if primary == "None": + continue + return primary + return None + + +async def get_unit_address(ops_test: OpsTest, unit_name: str) -> str: + """Get unit IP address. + + Args: + ops_test: The ops test framework instance + unit_name: The name of the unit + + Returns: + IP address of the unit + """ + if get_substrate(ops_test) == Substrate.vm: + return ops_test.model.units.get(unit_name).public_address + status = await ops_test.model.get_status() + return status["applications"][unit_name.split("/")[0]].units[unit_name]["address"] + + +async def run_command_on_unit(ops_test: OpsTest, unit_name: str, command: str) -> str: + """Run a command on a specific unit (in the postgresql container on K8s). + + Args: + ops_test: The ops test framework instance + unit_name: The name of the unit to run the command on + command: The command to run + + Returns: + the command output if it succeeds, otherwise raises an exception. + """ + if get_substrate(ops_test) == Substrate.vm: + complete_command = ["exec", "--unit", unit_name, "--", *command.split()] + return_code, stdout, _ = await ops_test.juju(*complete_command) + if return_code != 0: + logger.error(stdout) + raise Exception( + f"Expected command '{command}' to succeed instead it failed: {return_code}" + ) + return stdout + + complete_command = f"ssh --container postgresql {unit_name} {command}" + return_code, stdout, stderr = await ops_test.juju(*complete_command.split()) + if return_code != 0: + raise Exception( + f"Expected command {command} to succeed instead it failed: {stderr}. Code: {return_code}" + ) + return stdout + + +async def scale_application( + ops_test: OpsTest, application_name: str, count: int, model: Model = None +) -> None: + """Scale a given application to a specific unit count. + + Args: + ops_test: The ops test framework instance + application_name: The name of the application + count: The desired number of units to scale to + model: The model to scale the application in + """ + if model is None: + model = ops_test.model + if get_substrate(ops_test) == Substrate.vm: + change = count - len(model.applications[application_name].units) + if change > 0: + await model.applications[application_name].add_units(change) + elif change < 0: + units = [unit.name for unit in model.applications[application_name].units[0:-change]] + await model.applications[application_name].destroy_units(*units) + await model.wait_for_idle( + apps=[application_name], + status="active", + timeout=2000, + idle_period=30, + wait_for_exact_units=count, + ) + return + + await model.applications[application_name].scale(count) + if count == 0: + await model.block_until( + lambda: len(model.applications[application_name].units) == count, timeout=1200 + ) + else: + await model.wait_for_idle( + apps=[application_name], + status="active", + timeout=1200, + wait_for_exact_units=count, + idle_period=2, + ) + + +def assert_sync_standbys(unit_ip: str, standbys: int) -> None: + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3), reraise=True): + with attempt: + cluster = get_patroni_cluster(unit_ip) + cluster_standbys = 0 + for member in cluster["members"]: + if member["role"] == "sync_standby": + cluster_standbys += 1 + assert cluster_standbys >= standbys, "Less than expected standbys" + + +async def check_database_users_existence( + ops_test: OpsTest, + users_that_should_exist: list[str], + users_that_should_not_exist: list[str], + admin: bool = False, + database_app_name: str | None = None, +) -> None: + """Checks that applications users exist in the database. + + Args: + ops_test: The ops test framework + users_that_should_exist: List of users that should exist in the database + users_that_should_not_exist: List of users that should not exist in the database + admin: Whether to check if the existing users are superusers + database_app_name: Optional database app name + (defaults to the PostgreSQL cluster) + """ + if database_app_name is None: + database_app_name = await app_name(ops_test) + unit = ops_test.model.applications[database_app_name].units[0] + unit_address = await get_unit_address(ops_test, unit.name) + password = await get_password(ops_test, database_app_name=database_app_name) + + # Retrieve all users in the database. + output = execute_query( + unit_address, + password, + ( + "SELECT CONCAT(usename, ':', usesuper) FROM pg_catalog.pg_user;" + if admin + else "SELECT usename FROM pg_catalog.pg_user;" + ), + ) + + # Assert users that should exist. + for user in users_that_should_exist: + if admin: + # The t flag indicates the user is a superuser. + assert f"{user}:t" in output + else: + assert user in output + + # Assert users that should not exist. + for user in users_that_should_not_exist: + assert user not in output + + +async def start_machine(ops_test: OpsTest, machine_name: str) -> None: + """Start the machine where a unit run on. + + Args: + ops_test: The ops test framework instance + machine_name: The name of the machine to start + """ + start_machine_command = f"lxc start {machine_name}" + subprocess.check_call(start_machine_command.split()) + + +async def stop_machine(ops_test: OpsTest, machine_name: str) -> None: + """Stop the machine where a unit run on. + + Args: + ops_test: The ops test framework instance + machine_name: The name of the machine to stop + """ + stop_machine_command = f"lxc stop {machine_name}" + subprocess.check_call(stop_machine_command.split()) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index c24c9a74..33b3a97d 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -19,28 +19,13 @@ def pytest_addoption(parser: pytest.Parser) -> None: + # --controller, --model and --keep-models come from pytest-operator. parser.addoption( "--substrate", choices=[substrate.value for substrate in Substrate], required=True, help="Substrate to run the integration tests on.", ) - parser.addoption( - "--controller", - default=None, - help="Juju controller to use (defaults to the current one).", - ) - parser.addoption( - "--model", - default=None, - help="Use this existing Juju model instead of creating a temporary one.", - ) - parser.addoption( - "--keep-models", - action="store_true", - default=False, - help="Keep the temporary models after the tests finish.", - ) def pytest_configure(config: pytest.Config) -> None: diff --git a/uv.lock b/uv.lock index 5428291b..6eb0869d 100644 --- a/uv.lock +++ b/uv.lock @@ -2,7 +2,8 @@ version = 1 revision = 5 requires-python = ">=3.8, <4.0" resolution-markers = [ - "python_full_version >= '3.12'", + "python_full_version >= '3.14'", + "python_full_version >= '3.12' and python_full_version < '3.14'", "python_full_version >= '3.10' and python_full_version < '3.12'", "python_full_version > '3.9' and python_full_version < '3.10'", "python_full_version == '3.9'", @@ -74,6 +75,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/da/35/f2287558c17e29fafc8ef3daf819bb9834061cfa43bff8014f7df7f63bdc/anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494", size = 125813, upload-time = "2026-07-12T20:29:05.763Z" }, ] +[[package]] +name = "asttokens" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/25/1e/faf0f247f6f881b98fc4d6d07e14085cb89d13665084e6d6ac1dc2c03d0b/asttokens-3.0.2.tar.gz", hash = "sha256:3ecdbd8f2cc195f53ccada3a613538bb5f9ef6f6869129f13e03c30a677b8fe2", size = 63136, upload-time = "2026-07-12T03:31:49.084Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/2b/04b8a15f3a1c77bc79ddf5c73875327f34b4fa75982df2b76e45e402d364/asttokens-3.0.2-py3-none-any.whl", hash = "sha256:9da13157f5b28becde0bd374fc677dcd3c290614264eff096f167c469cd9f933", size = 28702, upload-time = "2026-07-12T03:31:47.542Z" }, +] + [[package]] name = "attrs" version = "26.1.0" @@ -83,6 +93,130 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" }, ] +[[package]] +name = "backports-datetime-fromisoformat" +version = "2.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/71/81/eff3184acb1d9dc3ce95a98b6f3c81a49b4be296e664db8e1c2eeabef3d9/backports_datetime_fromisoformat-2.0.3.tar.gz", hash = "sha256:b58edc8f517b66b397abc250ecc737969486703a66eb97e01e6d51291b1a139d", size = 23588, upload-time = "2024-12-28T20:18:15.017Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/4b/d6b051ca4b3d76f23c2c436a9669f3be616b8cf6461a7e8061c7c4269642/backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f681f638f10588fa3c101ee9ae2b63d3734713202ddfcfb6ec6cea0778a29d4", size = 27561, upload-time = "2024-12-28T20:16:47.974Z" }, + { url = "https://files.pythonhosted.org/packages/6d/40/e39b0d471e55eb1b5c7c81edab605c02f71c786d59fb875f0a6f23318747/backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:cd681460e9142f1249408e5aee6d178c6d89b49e06d44913c8fdfb6defda8d1c", size = 34448, upload-time = "2024-12-28T20:16:50.712Z" }, + { url = "https://files.pythonhosted.org/packages/f2/28/7a5c87c5561d14f1c9af979231fdf85d8f9fad7a95ff94e56d2205e2520a/backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:ee68bc8735ae5058695b76d3bb2aee1d137c052a11c8303f1e966aa23b72b65b", size = 27093, upload-time = "2024-12-28T20:16:52.994Z" }, + { url = "https://files.pythonhosted.org/packages/80/ba/f00296c5c4536967c7d1136107fdb91c48404fe769a4a6fd5ab045629af8/backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8273fe7932db65d952a43e238318966eab9e49e8dd546550a41df12175cc2be4", size = 52836, upload-time = "2024-12-28T20:16:55.283Z" }, + { url = "https://files.pythonhosted.org/packages/e3/92/bb1da57a069ddd601aee352a87262c7ae93467e66721d5762f59df5021a6/backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39d57ea50aa5a524bb239688adc1d1d824c31b6094ebd39aa164d6cadb85de22", size = 52798, upload-time = "2024-12-28T20:16:56.64Z" }, + { url = "https://files.pythonhosted.org/packages/df/ef/b6cfd355982e817ccdb8d8d109f720cab6e06f900784b034b30efa8fa832/backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ac6272f87693e78209dc72e84cf9ab58052027733cd0721c55356d3c881791cf", size = 52891, upload-time = "2024-12-28T20:16:58.887Z" }, + { url = "https://files.pythonhosted.org/packages/37/39/b13e3ae8a7c5d88b68a6e9248ffe7066534b0cfe504bf521963e61b6282d/backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:44c497a71f80cd2bcfc26faae8857cf8e79388e3d5fbf79d2354b8c360547d58", size = 52955, upload-time = "2024-12-28T20:17:00.028Z" }, + { url = "https://files.pythonhosted.org/packages/1e/e4/70cffa3ce1eb4f2ff0c0d6f5d56285aacead6bd3879b27a2ba57ab261172/backports_datetime_fromisoformat-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:6335a4c9e8af329cb1ded5ab41a666e1448116161905a94e054f205aa6d263bc", size = 29323, upload-time = "2024-12-28T20:17:01.125Z" }, + { url = "https://files.pythonhosted.org/packages/62/f5/5bc92030deadf34c365d908d4533709341fb05d0082db318774fdf1b2bcb/backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2e4b66e017253cdbe5a1de49e0eecff3f66cd72bcb1229d7db6e6b1832c0443", size = 27626, upload-time = "2024-12-28T20:17:03.448Z" }, + { url = "https://files.pythonhosted.org/packages/28/45/5885737d51f81dfcd0911dd5c16b510b249d4c4cf6f4a991176e0358a42a/backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:43e2d648e150777e13bbc2549cc960373e37bf65bd8a5d2e0cef40e16e5d8dd0", size = 34588, upload-time = "2024-12-28T20:17:04.459Z" }, + { url = "https://files.pythonhosted.org/packages/bc/6d/bd74de70953f5dd3e768c8fc774af942af0ce9f211e7c38dd478fa7ea910/backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:4ce6326fd86d5bae37813c7bf1543bae9e4c215ec6f5afe4c518be2635e2e005", size = 27162, upload-time = "2024-12-28T20:17:06.752Z" }, + { url = "https://files.pythonhosted.org/packages/47/ba/1d14b097f13cce45b2b35db9898957578b7fcc984e79af3b35189e0d332f/backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7c8fac333bf860208fd522a5394369ee3c790d0aa4311f515fcc4b6c5ef8d75", size = 54482, upload-time = "2024-12-28T20:17:08.15Z" }, + { url = "https://files.pythonhosted.org/packages/25/e9/a2a7927d053b6fa148b64b5e13ca741ca254c13edca99d8251e9a8a09cfe/backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24a4da5ab3aa0cc293dc0662a0c6d1da1a011dc1edcbc3122a288cfed13a0b45", size = 54362, upload-time = "2024-12-28T20:17:10.605Z" }, + { url = "https://files.pythonhosted.org/packages/c1/99/394fb5e80131a7d58c49b89e78a61733a9994885804a0bb582416dd10c6f/backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:58ea11e3bf912bd0a36b0519eae2c5b560b3cb972ea756e66b73fb9be460af01", size = 54162, upload-time = "2024-12-28T20:17:12.301Z" }, + { url = "https://files.pythonhosted.org/packages/88/25/1940369de573c752889646d70b3fe8645e77b9e17984e72a554b9b51ffc4/backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8a375c7dbee4734318714a799b6c697223e4bbb57232af37fbfff88fb48a14c6", size = 54118, upload-time = "2024-12-28T20:17:13.609Z" }, + { url = "https://files.pythonhosted.org/packages/b7/46/f275bf6c61683414acaf42b2df7286d68cfef03e98b45c168323d7707778/backports_datetime_fromisoformat-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:ac677b1664c4585c2e014739f6678137c8336815406052349c85898206ec7061", size = 29329, upload-time = "2024-12-28T20:17:16.124Z" }, + { url = "https://files.pythonhosted.org/packages/a2/0f/69bbdde2e1e57c09b5f01788804c50e68b29890aada999f2b1a40519def9/backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:66ce47ee1ba91e146149cf40565c3d750ea1be94faf660ca733d8601e0848147", size = 27630, upload-time = "2024-12-28T20:17:19.442Z" }, + { url = "https://files.pythonhosted.org/packages/d5/1d/1c84a50c673c87518b1adfeafcfd149991ed1f7aedc45d6e5eac2f7d19d7/backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:8b7e069910a66b3bba61df35b5f879e5253ff0821a70375b9daf06444d046fa4", size = 34707, upload-time = "2024-12-28T20:17:21.79Z" }, + { url = "https://files.pythonhosted.org/packages/71/44/27eae384e7e045cda83f70b551d04b4a0b294f9822d32dea1cbf1592de59/backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_x86_64.whl", hash = "sha256:a3b5d1d04a9e0f7b15aa1e647c750631a873b298cdd1255687bb68779fe8eb35", size = 27280, upload-time = "2024-12-28T20:17:24.503Z" }, + { url = "https://files.pythonhosted.org/packages/a7/7a/a4075187eb6bbb1ff6beb7229db5f66d1070e6968abeb61e056fa51afa5e/backports_datetime_fromisoformat-2.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec1b95986430e789c076610aea704db20874f0781b8624f648ca9fb6ef67c6e1", size = 55094, upload-time = "2024-12-28T20:17:25.546Z" }, + { url = "https://files.pythonhosted.org/packages/71/03/3fced4230c10af14aacadc195fe58e2ced91d011217b450c2e16a09a98c8/backports_datetime_fromisoformat-2.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffe5f793db59e2f1d45ec35a1cf51404fdd69df9f6952a0c87c3060af4c00e32", size = 55605, upload-time = "2024-12-28T20:17:29.208Z" }, + { url = "https://files.pythonhosted.org/packages/f6/0a/4b34a838c57bd16d3e5861ab963845e73a1041034651f7459e9935289cfd/backports_datetime_fromisoformat-2.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:620e8e73bd2595dfff1b4d256a12b67fce90ece3de87b38e1dde46b910f46f4d", size = 55353, upload-time = "2024-12-28T20:17:32.433Z" }, + { url = "https://files.pythonhosted.org/packages/d9/68/07d13c6e98e1cad85606a876367ede2de46af859833a1da12c413c201d78/backports_datetime_fromisoformat-2.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4cf9c0a985d68476c1cabd6385c691201dda2337d7453fb4da9679ce9f23f4e7", size = 55298, upload-time = "2024-12-28T20:17:34.919Z" }, + { url = "https://files.pythonhosted.org/packages/60/33/45b4d5311f42360f9b900dea53ab2bb20a3d61d7f9b7c37ddfcb3962f86f/backports_datetime_fromisoformat-2.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:d144868a73002e6e2e6fef72333e7b0129cecdd121aa8f1edba7107fd067255d", size = 29375, upload-time = "2024-12-28T20:17:36.018Z" }, + { url = "https://files.pythonhosted.org/packages/d0/d6/5f85db8ffa880ddfbb551a4a30a7d0fcb496431ed5ec06b15d67b4ce75d7/backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e81b26497a17c29595bc7df20bc6a872ceea5f8c9d6537283945d4b6396aec10", size = 27545, upload-time = "2024-12-28T20:17:38.707Z" }, + { url = "https://files.pythonhosted.org/packages/c9/0e/7e520925029fcc4c8fc7d0272d105c2e7230c29009c62ce15503ada714b2/backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:5ba00ead8d9d82fd6123eb4891c566d30a293454e54e32ff7ead7644f5f7e575", size = 34454, upload-time = "2024-12-28T20:17:41.209Z" }, + { url = "https://files.pythonhosted.org/packages/ef/b7/b8f6e8dda72b224601918dc6e58d7e7c4f1373494b641c4a7c04a8d7469f/backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:24d574cb4072e1640b00864e94c4c89858033936ece3fc0e1c6f7179f120d0a8", size = 27090, upload-time = "2024-12-28T20:17:43.609Z" }, + { url = "https://files.pythonhosted.org/packages/72/5a/346715e3a36e6dbe6f76238c8d42d2f606f7bd53371b829568ff012469a5/backports_datetime_fromisoformat-2.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9735695a66aad654500b0193525e590c693ab3368478ce07b34b443a1ea5e824", size = 52425, upload-time = "2024-12-28T20:17:44.656Z" }, + { url = "https://files.pythonhosted.org/packages/ce/fb/ce8c282da10f3e42c9677a825038f4904ff3ef34e384adb2fedb35754192/backports_datetime_fromisoformat-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63d39709e17eb72685d052ac82acf0763e047f57c86af1b791505b1fec96915d", size = 52357, upload-time = "2024-12-28T20:17:47.239Z" }, + { url = "https://files.pythonhosted.org/packages/4d/fb/80b12b769aa9af01e4f5653e05d820dffc99e28f47b9429c4a707cb94c47/backports_datetime_fromisoformat-2.0.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:1ea2cc84224937d6b9b4c07f5cb7c667f2bde28c255645ba27f8a675a7af8234", size = 51887, upload-time = "2024-12-28T20:17:48.361Z" }, + { url = "https://files.pythonhosted.org/packages/58/29/ec772891233d09f9e2bcec24c3d1c43a122315e55de0010fdaa14a8ef7b3/backports_datetime_fromisoformat-2.0.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4024e6d35a9fdc1b3fd6ac7a673bd16cb176c7e0b952af6428b7129a70f72cce", size = 52060, upload-time = "2024-12-28T20:17:49.545Z" }, + { url = "https://files.pythonhosted.org/packages/08/5c/10eb5e8aee03f97485a8c7eed148420d70f6cc14a3de72e10fb9ba02b9e9/backports_datetime_fromisoformat-2.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:5e2dcc94dc9c9ab8704409d86fcb5236316e9dcef6feed8162287634e3568f4c", size = 29331, upload-time = "2024-12-28T20:17:53.405Z" }, + { url = "https://files.pythonhosted.org/packages/36/bf/990ac5a4f86fdb92d435511bb80a9e66f0a8dd87e76ae00dd062db2cf649/backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fa2de871801d824c255fac7e5e7e50f2be6c9c376fd9268b40c54b5e9da91f42", size = 27548, upload-time = "2024-12-28T20:17:55.065Z" }, + { url = "https://files.pythonhosted.org/packages/c6/e8/8f49cfc187df0231a1c1bcf780bbdb3d1c391dccafc3510cd033b637f836/backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:1314d4923c1509aa9696712a7bc0c7160d3b7acf72adafbbe6c558d523f5d491", size = 34445, upload-time = "2024-12-28T20:17:56.134Z" }, + { url = "https://files.pythonhosted.org/packages/06/25/4ac60683f383d51337620ef6f5ff56438174b18f5d6a66f71da2ea4acd26/backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:b750ecba3a8815ad8bc48311552f3f8ab99dd2326d29df7ff670d9c49321f48f", size = 27093, upload-time = "2024-12-28T20:17:57.17Z" }, + { url = "https://files.pythonhosted.org/packages/c7/ea/561edac54f9a1440a4bce0aecc291e5155e734ab42db88ce24cd1cccf288/backports_datetime_fromisoformat-2.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2d5117dce805d8a2f78baeddc8c6127281fa0a5e2c40c6dd992ba6b2b367876", size = 52352, upload-time = "2024-12-28T20:17:59.642Z" }, + { url = "https://files.pythonhosted.org/packages/43/aa/98ed742a9a1bd88f5ead7852eb1d2fc828cba96b46340b70fc216a7f4b70/backports_datetime_fromisoformat-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb35f607bd1cbe37b896379d5f5ed4dc298b536f4b959cb63180e05cacc0539d", size = 52314, upload-time = "2024-12-28T20:18:00.771Z" }, + { url = "https://files.pythonhosted.org/packages/c7/ab/5b8f8c0be6a563f00bf2ecefff18beb6daf1e78025c0d823f581bf0a879f/backports_datetime_fromisoformat-2.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:61c74710900602637d2d145dda9720c94e303380803bf68811b2a151deec75c2", size = 52488, upload-time = "2024-12-28T20:18:01.888Z" }, + { url = "https://files.pythonhosted.org/packages/20/14/fef93556a022530525c77729f94eab3452568a11f7893cbcd76e06b398e8/backports_datetime_fromisoformat-2.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:ece59af54ebf67ecbfbbf3ca9066f5687879e36527ad69d8b6e3ac565d565a62", size = 52555, upload-time = "2024-12-28T20:18:03.065Z" }, + { url = "https://files.pythonhosted.org/packages/2f/bf/e1a2fe6ec0ce2b983d7cc93c43b41334f595fd7793aa35afbd02737c5e75/backports_datetime_fromisoformat-2.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:d0a7c5f875068efe106f62233bc712d50db4d07c13c7db570175c7857a7b5dbd", size = 29331, upload-time = "2024-12-28T20:18:05.494Z" }, + { url = "https://files.pythonhosted.org/packages/be/03/7eaa9f9bf290395d57fd30d7f1f2f9dff60c06a31c237dc2beb477e8f899/backports_datetime_fromisoformat-2.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90e202e72a3d5aae673fcc8c9a4267d56b2f532beeb9173361293625fe4d2039", size = 28980, upload-time = "2024-12-28T20:18:06.554Z" }, + { url = "https://files.pythonhosted.org/packages/47/80/a0ecf33446c7349e79f54cc532933780341d20cff0ee12b5bfdcaa47067e/backports_datetime_fromisoformat-2.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2df98ef1b76f5a58bb493dda552259ba60c3a37557d848e039524203951c9f06", size = 28449, upload-time = "2024-12-28T20:18:07.77Z" }, + { url = "https://files.pythonhosted.org/packages/3b/7b/588dc0ab9d01638de461c18390756c1337c14f8f28451d5e8fc62341724c/backports_datetime_fromisoformat-2.0.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7100adcda5e818b5a894ad0626e38118bb896a347f40ebed8981155675b9ba7b", size = 28977, upload-time = "2024-12-28T20:18:08.875Z" }, + { url = "https://files.pythonhosted.org/packages/18/32/33ee65947b6e07918de4a2aa30a37e8bf7a0a726579cc3f21498bc3841dd/backports_datetime_fromisoformat-2.0.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e410383f5d6a449a529d074e88af8bc80020bb42b402265f9c02c8358c11da5", size = 28385, upload-time = "2024-12-28T20:18:11.335Z" }, + { url = "https://files.pythonhosted.org/packages/93/a3/ef965bee678d5dfbabfd85283d8a9caf125b11c394174eceb76707e64334/backports_datetime_fromisoformat-2.0.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2797593760da6bcc32c4a13fa825af183cd4bfd333c60b3dbf84711afca26ef", size = 28978, upload-time = "2024-12-28T20:18:12.441Z" }, + { url = "https://files.pythonhosted.org/packages/dc/e7/910935727b5c0e4975820d0ae5c9489d111859c651109f72208a8a28105b/backports_datetime_fromisoformat-2.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35a144fd681a0bea1013ccc4cd3fd4dc758ea17ee23dca019c02b82ec46fc0c4", size = 28437, upload-time = "2024-12-28T20:18:13.465Z" }, +] + +[[package]] +name = "bcrypt" +version = "5.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d4/36/3329e2518d70ad8e2e5817d5a4cac6bba05a47767ec416c7d020a965f408/bcrypt-5.0.0.tar.gz", hash = "sha256:f748f7c2d6fd375cc93d3fba7ef4a9e3a092421b8dbf34d8d4dc06be9492dfdd", size = 25386, upload-time = "2025-09-25T19:50:47.829Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/13/85/3e65e01985fddf25b64ca67275bb5bdb4040bd1a53b66d355c6c37c8a680/bcrypt-5.0.0-cp313-cp313t-macosx_10_12_universal2.whl", hash = "sha256:f3c08197f3039bec79cee59a606d62b96b16669cff3949f21e74796b6e3cd2be", size = 481806, upload-time = "2025-09-25T19:49:05.102Z" }, + { url = "https://files.pythonhosted.org/packages/44/dc/01eb79f12b177017a726cbf78330eb0eb442fae0e7b3dfd84ea2849552f3/bcrypt-5.0.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:200af71bc25f22006f4069060c88ed36f8aa4ff7f53e67ff04d2ab3f1e79a5b2", size = 268626, upload-time = "2025-09-25T19:49:06.723Z" }, + { url = "https://files.pythonhosted.org/packages/8c/cf/e82388ad5959c40d6afd94fb4743cc077129d45b952d46bdc3180310e2df/bcrypt-5.0.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:baade0a5657654c2984468efb7d6c110db87ea63ef5a4b54732e7e337253e44f", size = 271853, upload-time = "2025-09-25T19:49:08.028Z" }, + { url = "https://files.pythonhosted.org/packages/ec/86/7134b9dae7cf0efa85671651341f6afa695857fae172615e960fb6a466fa/bcrypt-5.0.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:c58b56cdfb03202b3bcc9fd8daee8e8e9b6d7e3163aa97c631dfcfcc24d36c86", size = 269793, upload-time = "2025-09-25T19:49:09.727Z" }, + { url = "https://files.pythonhosted.org/packages/cc/82/6296688ac1b9e503d034e7d0614d56e80c5d1a08402ff856a4549cb59207/bcrypt-5.0.0-cp313-cp313t-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4bfd2a34de661f34d0bda43c3e4e79df586e4716ef401fe31ea39d69d581ef23", size = 289930, upload-time = "2025-09-25T19:49:11.204Z" }, + { url = "https://files.pythonhosted.org/packages/d1/18/884a44aa47f2a3b88dd09bc05a1e40b57878ecd111d17e5bba6f09f8bb77/bcrypt-5.0.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:ed2e1365e31fc73f1825fa830f1c8f8917ca1b3ca6185773b349c20fd606cec2", size = 272194, upload-time = "2025-09-25T19:49:12.524Z" }, + { url = "https://files.pythonhosted.org/packages/0e/8f/371a3ab33c6982070b674f1788e05b656cfbf5685894acbfef0c65483a59/bcrypt-5.0.0-cp313-cp313t-manylinux_2_34_aarch64.whl", hash = "sha256:83e787d7a84dbbfba6f250dd7a5efd689e935f03dd83b0f919d39349e1f23f83", size = 269381, upload-time = "2025-09-25T19:49:14.308Z" }, + { url = "https://files.pythonhosted.org/packages/b1/34/7e4e6abb7a8778db6422e88b1f06eb07c47682313997ee8a8f9352e5a6f1/bcrypt-5.0.0-cp313-cp313t-manylinux_2_34_x86_64.whl", hash = "sha256:137c5156524328a24b9fac1cb5db0ba618bc97d11970b39184c1d87dc4bf1746", size = 271750, upload-time = "2025-09-25T19:49:15.584Z" }, + { url = "https://files.pythonhosted.org/packages/c0/1b/54f416be2499bd72123c70d98d36c6cd61a4e33d9b89562c22481c81bb30/bcrypt-5.0.0-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:38cac74101777a6a7d3b3e3cfefa57089b5ada650dce2baf0cbdd9d65db22a9e", size = 303757, upload-time = "2025-09-25T19:49:17.244Z" }, + { url = "https://files.pythonhosted.org/packages/13/62/062c24c7bcf9d2826a1a843d0d605c65a755bc98002923d01fd61270705a/bcrypt-5.0.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:d8d65b564ec849643d9f7ea05c6d9f0cd7ca23bdd4ac0c2dbef1104ab504543d", size = 306740, upload-time = "2025-09-25T19:49:18.693Z" }, + { url = "https://files.pythonhosted.org/packages/d5/c8/1fdbfc8c0f20875b6b4020f3c7dc447b8de60aa0be5faaf009d24242aec9/bcrypt-5.0.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:741449132f64b3524e95cd30e5cd3343006ce146088f074f31ab26b94e6c75ba", size = 334197, upload-time = "2025-09-25T19:49:20.523Z" }, + { url = "https://files.pythonhosted.org/packages/a6/c1/8b84545382d75bef226fbc6588af0f7b7d095f7cd6a670b42a86243183cd/bcrypt-5.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:212139484ab3207b1f0c00633d3be92fef3c5f0af17cad155679d03ff2ee1e41", size = 352974, upload-time = "2025-09-25T19:49:22.254Z" }, + { url = "https://files.pythonhosted.org/packages/10/a6/ffb49d4254ed085e62e3e5dd05982b4393e32fe1e49bb1130186617c29cd/bcrypt-5.0.0-cp313-cp313t-win32.whl", hash = "sha256:9d52ed507c2488eddd6a95bccee4e808d3234fa78dd370e24bac65a21212b861", size = 148498, upload-time = "2025-09-25T19:49:24.134Z" }, + { url = "https://files.pythonhosted.org/packages/48/a9/259559edc85258b6d5fc5471a62a3299a6aa37a6611a169756bf4689323c/bcrypt-5.0.0-cp313-cp313t-win_amd64.whl", hash = "sha256:f6984a24db30548fd39a44360532898c33528b74aedf81c26cf29c51ee47057e", size = 145853, upload-time = "2025-09-25T19:49:25.702Z" }, + { url = "https://files.pythonhosted.org/packages/2d/df/9714173403c7e8b245acf8e4be8876aac64a209d1b392af457c79e60492e/bcrypt-5.0.0-cp313-cp313t-win_arm64.whl", hash = "sha256:9fffdb387abe6aa775af36ef16f55e318dcda4194ddbf82007a6f21da29de8f5", size = 139626, upload-time = "2025-09-25T19:49:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/f8/14/c18006f91816606a4abe294ccc5d1e6f0e42304df5a33710e9e8e95416e1/bcrypt-5.0.0-cp314-cp314t-macosx_10_12_universal2.whl", hash = "sha256:4870a52610537037adb382444fefd3706d96d663ac44cbb2f37e3919dca3d7ef", size = 481862, upload-time = "2025-09-25T19:49:28.365Z" }, + { url = "https://files.pythonhosted.org/packages/67/49/dd074d831f00e589537e07a0725cf0e220d1f0d5d8e85ad5bbff251c45aa/bcrypt-5.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:48f753100931605686f74e27a7b49238122aa761a9aefe9373265b8b7aa43ea4", size = 268544, upload-time = "2025-09-25T19:49:30.39Z" }, + { url = "https://files.pythonhosted.org/packages/f5/91/50ccba088b8c474545b034a1424d05195d9fcbaaf802ab8bfe2be5a4e0d7/bcrypt-5.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f70aadb7a809305226daedf75d90379c397b094755a710d7014b8b117df1ebbf", size = 271787, upload-time = "2025-09-25T19:49:32.144Z" }, + { url = "https://files.pythonhosted.org/packages/aa/e7/d7dba133e02abcda3b52087a7eea8c0d4f64d3e593b4fffc10c31b7061f3/bcrypt-5.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:744d3c6b164caa658adcb72cb8cc9ad9b4b75c7db507ab4bc2480474a51989da", size = 269753, upload-time = "2025-09-25T19:49:33.885Z" }, + { url = "https://files.pythonhosted.org/packages/33/fc/5b145673c4b8d01018307b5c2c1fc87a6f5a436f0ad56607aee389de8ee3/bcrypt-5.0.0-cp314-cp314t-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a28bc05039bdf3289d757f49d616ab3efe8cf40d8e8001ccdd621cd4f98f4fc9", size = 289587, upload-time = "2025-09-25T19:49:35.144Z" }, + { url = "https://files.pythonhosted.org/packages/27/d7/1ff22703ec6d4f90e62f1a5654b8867ef96bafb8e8102c2288333e1a6ca6/bcrypt-5.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:7f277a4b3390ab4bebe597800a90da0edae882c6196d3038a73adf446c4f969f", size = 272178, upload-time = "2025-09-25T19:49:36.793Z" }, + { url = "https://files.pythonhosted.org/packages/c8/88/815b6d558a1e4d40ece04a2f84865b0fef233513bd85fd0e40c294272d62/bcrypt-5.0.0-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:79cfa161eda8d2ddf29acad370356b47f02387153b11d46042e93a0a95127493", size = 269295, upload-time = "2025-09-25T19:49:38.164Z" }, + { url = "https://files.pythonhosted.org/packages/51/8c/e0db387c79ab4931fc89827d37608c31cc57b6edc08ccd2386139028dc0d/bcrypt-5.0.0-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:a5393eae5722bcef046a990b84dff02b954904c36a194f6cfc817d7dca6c6f0b", size = 271700, upload-time = "2025-09-25T19:49:39.917Z" }, + { url = "https://files.pythonhosted.org/packages/06/83/1570edddd150f572dbe9fc00f6203a89fc7d4226821f67328a85c330f239/bcrypt-5.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7f4c94dec1b5ab5d522750cb059bb9409ea8872d4494fd152b53cca99f1ddd8c", size = 334034, upload-time = "2025-09-25T19:49:41.227Z" }, + { url = "https://files.pythonhosted.org/packages/c9/f2/ea64e51a65e56ae7a8a4ec236c2bfbdd4b23008abd50ac33fbb2d1d15424/bcrypt-5.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0cae4cb350934dfd74c020525eeae0a5f79257e8a201c0c176f4b84fdbf2a4b4", size = 352766, upload-time = "2025-09-25T19:49:43.08Z" }, + { url = "https://files.pythonhosted.org/packages/d7/d4/1a388d21ee66876f27d1a1f41287897d0c0f1712ef97d395d708ba93004c/bcrypt-5.0.0-cp314-cp314t-win32.whl", hash = "sha256:b17366316c654e1ad0306a6858e189fc835eca39f7eb2cafd6aaca8ce0c40a2e", size = 152449, upload-time = "2025-09-25T19:49:44.971Z" }, + { url = "https://files.pythonhosted.org/packages/3f/61/3291c2243ae0229e5bca5d19f4032cecad5dfb05a2557169d3a69dc0ba91/bcrypt-5.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:92864f54fb48b4c718fc92a32825d0e42265a627f956bc0361fe869f1adc3e7d", size = 149310, upload-time = "2025-09-25T19:49:46.162Z" }, + { url = "https://files.pythonhosted.org/packages/3e/89/4b01c52ae0c1a681d4021e5dd3e45b111a8fb47254a274fa9a378d8d834b/bcrypt-5.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:dd19cf5184a90c873009244586396a6a884d591a5323f0e8a5922560718d4993", size = 143761, upload-time = "2025-09-25T19:49:47.345Z" }, + { url = "https://files.pythonhosted.org/packages/84/29/6237f151fbfe295fe3e074ecc6d44228faa1e842a81f6d34a02937ee1736/bcrypt-5.0.0-cp38-abi3-macosx_10_12_universal2.whl", hash = "sha256:fc746432b951e92b58317af8e0ca746efe93e66555f1b40888865ef5bf56446b", size = 494553, upload-time = "2025-09-25T19:49:49.006Z" }, + { url = "https://files.pythonhosted.org/packages/45/b6/4c1205dde5e464ea3bd88e8742e19f899c16fa8916fb8510a851fae985b5/bcrypt-5.0.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c2388ca94ffee269b6038d48747f4ce8df0ffbea43f31abfa18ac72f0218effb", size = 275009, upload-time = "2025-09-25T19:49:50.581Z" }, + { url = "https://files.pythonhosted.org/packages/3b/71/427945e6ead72ccffe77894b2655b695ccf14ae1866cd977e185d606dd2f/bcrypt-5.0.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:560ddb6ec730386e7b3b26b8b4c88197aaed924430e7b74666a586ac997249ef", size = 278029, upload-time = "2025-09-25T19:49:52.533Z" }, + { url = "https://files.pythonhosted.org/packages/17/72/c344825e3b83c5389a369c8a8e58ffe1480b8a699f46c127c34580c4666b/bcrypt-5.0.0-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d79e5c65dcc9af213594d6f7f1fa2c98ad3fc10431e7aa53c176b441943efbdd", size = 275907, upload-time = "2025-09-25T19:49:54.709Z" }, + { url = "https://files.pythonhosted.org/packages/0b/7e/d4e47d2df1641a36d1212e5c0514f5291e1a956a7749f1e595c07a972038/bcrypt-5.0.0-cp38-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2b732e7d388fa22d48920baa267ba5d97cca38070b69c0e2d37087b381c681fd", size = 296500, upload-time = "2025-09-25T19:49:56.013Z" }, + { url = "https://files.pythonhosted.org/packages/0f/c3/0ae57a68be2039287ec28bc463b82e4b8dc23f9d12c0be331f4782e19108/bcrypt-5.0.0-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:0c8e093ea2532601a6f686edbc2c6b2ec24131ff5c52f7610dd64fa4553b5464", size = 278412, upload-time = "2025-09-25T19:49:57.356Z" }, + { url = "https://files.pythonhosted.org/packages/45/2b/77424511adb11e6a99e3a00dcc7745034bee89036ad7d7e255a7e47be7d8/bcrypt-5.0.0-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:5b1589f4839a0899c146e8892efe320c0fa096568abd9b95593efac50a87cb75", size = 275486, upload-time = "2025-09-25T19:49:59.116Z" }, + { url = "https://files.pythonhosted.org/packages/43/0a/405c753f6158e0f3f14b00b462d8bca31296f7ecfc8fc8bc7919c0c7d73a/bcrypt-5.0.0-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:89042e61b5e808b67daf24a434d89bab164d4de1746b37a8d173b6b14f3db9ff", size = 277940, upload-time = "2025-09-25T19:50:00.869Z" }, + { url = "https://files.pythonhosted.org/packages/62/83/b3efc285d4aadc1fa83db385ec64dcfa1707e890eb42f03b127d66ac1b7b/bcrypt-5.0.0-cp38-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:e3cf5b2560c7b5a142286f69bde914494b6d8f901aaa71e453078388a50881c4", size = 310776, upload-time = "2025-09-25T19:50:02.393Z" }, + { url = "https://files.pythonhosted.org/packages/95/7d/47ee337dacecde6d234890fe929936cb03ebc4c3a7460854bbd9c97780b8/bcrypt-5.0.0-cp38-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:f632fd56fc4e61564f78b46a2269153122db34988e78b6be8b32d28507b7eaeb", size = 312922, upload-time = "2025-09-25T19:50:04.232Z" }, + { url = "https://files.pythonhosted.org/packages/d6/3a/43d494dfb728f55f4e1cf8fd435d50c16a2d75493225b54c8d06122523c6/bcrypt-5.0.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:801cad5ccb6b87d1b430f183269b94c24f248dddbbc5c1f78b6ed231743e001c", size = 341367, upload-time = "2025-09-25T19:50:05.559Z" }, + { url = "https://files.pythonhosted.org/packages/55/ab/a0727a4547e383e2e22a630e0f908113db37904f58719dc48d4622139b5c/bcrypt-5.0.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3cf67a804fc66fc217e6914a5635000259fbbbb12e78a99488e4d5ba445a71eb", size = 359187, upload-time = "2025-09-25T19:50:06.916Z" }, + { url = "https://files.pythonhosted.org/packages/1b/bb/461f352fdca663524b4643d8b09e8435b4990f17fbf4fea6bc2a90aa0cc7/bcrypt-5.0.0-cp38-abi3-win32.whl", hash = "sha256:3abeb543874b2c0524ff40c57a4e14e5d3a66ff33fb423529c88f180fd756538", size = 153752, upload-time = "2025-09-25T19:50:08.515Z" }, + { url = "https://files.pythonhosted.org/packages/41/aa/4190e60921927b7056820291f56fc57d00d04757c8b316b2d3c0d1d6da2c/bcrypt-5.0.0-cp38-abi3-win_amd64.whl", hash = "sha256:35a77ec55b541e5e583eb3436ffbbf53b0ffa1fa16ca6782279daf95d146dcd9", size = 150881, upload-time = "2025-09-25T19:50:09.742Z" }, + { url = "https://files.pythonhosted.org/packages/54/12/cd77221719d0b39ac0b55dbd39358db1cd1246e0282e104366ebbfb8266a/bcrypt-5.0.0-cp38-abi3-win_arm64.whl", hash = "sha256:cde08734f12c6a4e28dc6755cd11d3bdfea608d93d958fffbe95a7026ebe4980", size = 144931, upload-time = "2025-09-25T19:50:11.016Z" }, + { url = "https://files.pythonhosted.org/packages/5d/ba/2af136406e1c3839aea9ecadc2f6be2bcd1eff255bd451dd39bcf302c47a/bcrypt-5.0.0-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:0c418ca99fd47e9c59a301744d63328f17798b5947b0f791e9af3c1c499c2d0a", size = 495313, upload-time = "2025-09-25T19:50:12.309Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ee/2f4985dbad090ace5ad1f7dd8ff94477fe089b5fab2040bd784a3d5f187b/bcrypt-5.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ddb4e1500f6efdd402218ffe34d040a1196c072e07929b9820f363a1fd1f4191", size = 275290, upload-time = "2025-09-25T19:50:13.673Z" }, + { url = "https://files.pythonhosted.org/packages/e4/6e/b77ade812672d15cf50842e167eead80ac3514f3beacac8902915417f8b7/bcrypt-5.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7aeef54b60ceddb6f30ee3db090351ecf0d40ec6e2abf41430997407a46d2254", size = 278253, upload-time = "2025-09-25T19:50:15.089Z" }, + { url = "https://files.pythonhosted.org/packages/36/c4/ed00ed32f1040f7990dac7115f82273e3c03da1e1a1587a778d8cea496d8/bcrypt-5.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f0ce778135f60799d89c9693b9b398819d15f1921ba15fe719acb3178215a7db", size = 276084, upload-time = "2025-09-25T19:50:16.699Z" }, + { url = "https://files.pythonhosted.org/packages/e7/c4/fa6e16145e145e87f1fa351bbd54b429354fd72145cd3d4e0c5157cf4c70/bcrypt-5.0.0-cp39-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a71f70ee269671460b37a449f5ff26982a6f2ba493b3eabdd687b4bf35f875ac", size = 297185, upload-time = "2025-09-25T19:50:18.525Z" }, + { url = "https://files.pythonhosted.org/packages/24/b4/11f8a31d8b67cca3371e046db49baa7c0594d71eb40ac8121e2fc0888db0/bcrypt-5.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f8429e1c410b4073944f03bd778a9e066e7fad723564a52ff91841d278dfc822", size = 278656, upload-time = "2025-09-25T19:50:19.809Z" }, + { url = "https://files.pythonhosted.org/packages/ac/31/79f11865f8078e192847d2cb526e3fa27c200933c982c5b2869720fa5fce/bcrypt-5.0.0-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:edfcdcedd0d0f05850c52ba3127b1fce70b9f89e0fe5ff16517df7e81fa3cbb8", size = 275662, upload-time = "2025-09-25T19:50:21.567Z" }, + { url = "https://files.pythonhosted.org/packages/d4/8d/5e43d9584b3b3591a6f9b68f755a4da879a59712981ef5ad2a0ac1379f7a/bcrypt-5.0.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:611f0a17aa4a25a69362dcc299fda5c8a3d4f160e2abb3831041feb77393a14a", size = 278240, upload-time = "2025-09-25T19:50:23.305Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/44590e3fc158620f680a978aafe8f87a4c4320da81ed11552f0323aa9a57/bcrypt-5.0.0-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:db99dca3b1fdc3db87d7c57eac0c82281242d1eabf19dcb8a6b10eb29a2e72d1", size = 311152, upload-time = "2025-09-25T19:50:24.597Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/e4fbfc46f14f47b0d20493669a625da5827d07e8a88ee460af6cd9768b44/bcrypt-5.0.0-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:5feebf85a9cefda32966d8171f5db7e3ba964b77fdfe31919622256f80f9cf42", size = 313284, upload-time = "2025-09-25T19:50:26.268Z" }, + { url = "https://files.pythonhosted.org/packages/25/ae/479f81d3f4594456a01ea2f05b132a519eff9ab5768a70430fa1132384b1/bcrypt-5.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:3ca8a166b1140436e058298a34d88032ab62f15aae1c598580333dc21d27ef10", size = 341643, upload-time = "2025-09-25T19:50:28.02Z" }, + { url = "https://files.pythonhosted.org/packages/df/d2/36a086dee1473b14276cd6ea7f61aef3b2648710b5d7f1c9e032c29b859f/bcrypt-5.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:61afc381250c3182d9078551e3ac3a41da14154fbff647ddf52a769f588c4172", size = 359698, upload-time = "2025-09-25T19:50:31.347Z" }, + { url = "https://files.pythonhosted.org/packages/c0/f6/688d2cd64bfd0b14d805ddb8a565e11ca1fb0fd6817175d58b10052b6d88/bcrypt-5.0.0-cp39-abi3-win32.whl", hash = "sha256:64d7ce196203e468c457c37ec22390f1a61c85c6f0b8160fd752940ccfb3a683", size = 153725, upload-time = "2025-09-25T19:50:34.384Z" }, + { url = "https://files.pythonhosted.org/packages/9f/b9/9d9a641194a730bda138b3dfe53f584d61c58cd5230e37566e83ec2ffa0d/bcrypt-5.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:64ee8434b0da054d830fa8e89e1c8bf30061d539044a39524ff7dec90481e5c2", size = 150912, upload-time = "2025-09-25T19:50:35.69Z" }, + { url = "https://files.pythonhosted.org/packages/27/44/d2ef5e87509158ad2187f4dd0852df80695bb1ee0cfe0a684727b01a69e0/bcrypt-5.0.0-cp39-abi3-win_arm64.whl", hash = "sha256:f2347d3534e76bf50bca5500989d6c1d05ed64b440408057a37673282c654927", size = 144953, upload-time = "2025-09-25T19:50:37.32Z" }, + { url = "https://files.pythonhosted.org/packages/8a/75/4aa9f5a4d40d762892066ba1046000b329c7cd58e888a6db878019b282dc/bcrypt-5.0.0-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7edda91d5ab52b15636d9c30da87d2cc84f426c72b9dba7a9b4fe142ba11f534", size = 271180, upload-time = "2025-09-25T19:50:38.575Z" }, + { url = "https://files.pythonhosted.org/packages/54/79/875f9558179573d40a9cc743038ac2bf67dfb79cecb1e8b5d70e88c94c3d/bcrypt-5.0.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:046ad6db88edb3c5ece4369af997938fb1c19d6a699b9c1b27b0db432faae4c4", size = 273791, upload-time = "2025-09-25T19:50:39.913Z" }, + { url = "https://files.pythonhosted.org/packages/bc/fe/975adb8c216174bf70fc17535f75e85ac06ed5252ea077be10d9cff5ce24/bcrypt-5.0.0-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:dcd58e2b3a908b5ecc9b9df2f0085592506ac2d5110786018ee5e160f28e0911", size = 270746, upload-time = "2025-09-25T19:50:43.306Z" }, + { url = "https://files.pythonhosted.org/packages/e4/f8/972c96f5a2b6c4b3deca57009d93e946bbdbe2241dca9806d502f29dd3ee/bcrypt-5.0.0-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:6b8f520b61e8781efee73cba14e3e8c9556ccfb375623f4f97429544734545b4", size = 273375, upload-time = "2025-09-25T19:50:45.43Z" }, +] + [[package]] name = "boto3" version = "1.43.87" @@ -739,6 +873,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/70/e7/d798bb22f172ad819944aa13f50bc330dc4fa2d5f52be36c8303465571ef/data_platform_helpers-1.1.0-py3-none-any.whl", hash = "sha256:71b2c2ba31d1bc01c55c9da82d02b0cb654b99231172916722ecaf4c469d27c4", size = 56200, upload-time = "2026-06-17T14:18:31.047Z" }, ] +[[package]] +name = "decorator" +version = "5.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/60/8b/32f9823da46cde7df2087faa08cd98d01b908f8dcab982cdba9c84e85355/decorator-5.3.1.tar.gz", hash = "sha256:4cbcdd55a6efadb9dbea26b858f4fb3264567b52d69ca0d25b721b553f60ea82", size = 58084, upload-time = "2026-05-18T06:03:28.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/05/7f/798705f5296a58ca505d600456748d1be48078eac8a7050d8a98bc9edb89/decorator-5.3.1-py3-none-any.whl", hash = "sha256:f47fe6fdbd2edd623ecfe36875d37aba411624e2670dd395dddae1358689bb3c", size = 10365, upload-time = "2026-05-18T06:03:26.517Z" }, +] + [[package]] name = "diskcache" version = "5.6.3" @@ -748,6 +891,28 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3f/27/4570e78fc0bf5ea0ca45eb1de3818a23787af9b390c0b0a0033a1b8236f9/diskcache-5.6.3-py3-none-any.whl", hash = "sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19", size = 45550, upload-time = "2023-08-31T06:11:58.822Z" }, ] +[[package]] +name = "executing" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/92/8a611141e42930c0f194f7504063ab87dfe970cf1a5af28e7703df448734/executing-2.3.0.tar.gz", hash = "sha256:15919cb5d667e5cb4e099511971d00d659573fff2dd5c4e6cd8b71636c7858d2", size = 1338003, upload-time = "2026-10-10T14:06:04.64Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4d/dd/8bc67e7d5ffc1d88aa5af511189dfb76dc4e1e5b808fab186146ef2663e5/executing-2.3.0-py3-none-any.whl", hash = "sha256:736e859c9f8701f11fcf516856f26f562e04776387824b43a35a1dfe21c84122", size = 29393, upload-time = "2026-10-10T14:06:02.777Z" }, +] + +[[package]] +name = "google-auth" +version = "2.62.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "pyasn1-modules" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c4/38/d79ab09dcfc1e1638d887c8f65657619d3ebc454165c558ef79355971ce3/google_auth-2.62.1.tar.gz", hash = "sha256:3c8e1ce2553784ae17fd220e6f88df3281d86ab98019278f436d06dffab17a9e", size = 398519, upload-time = "2026-11-03T03:06:03.008Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/dd/2e11f0976ecb3ce48ef3f324837460e9ea50071fa4eb01f1e49df87d3cee/google_auth-2.62.1-py3-none-any.whl", hash = "sha256:015399a5abde39033c69404cc1c079e6d4c2de2993e164c9f4eac6e5376ad72b", size = 267975, upload-time = "2026-11-03T03:06:01.422Z" }, +] + [[package]] name = "h11" version = "0.16.0" @@ -854,6 +1019,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9b/43/832f631d32e4f1211caa2ba368317739fe71f0b8530e4c9d15dc454bac2a/httpx2_jsfetch-1.0-py3-none-any.whl", hash = "sha256:cb916b707601e69a07721aabc8f3f6659be3a6893bc1ff5c6f9e02241df2da32", size = 6382, upload-time = "2026-08-07T00:13:06.567Z" }, ] +[[package]] +name = "hvac" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e2/57/b46c397fb3842cfb02a44609aa834c887f38dd75f290c2fc5a34da4b2fee/hvac-2.4.0.tar.gz", hash = "sha256:e0056ad9064e7923e874e6769015b032580b639e29246f5ab1044f7959c1c7e0", size = 332543, upload-time = "2025-10-30T12:57:47.512Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/55/33/71e45a6bd6875f44a26f99da31c63b6840123e88bedf2c0b1ce429b8be12/hvac-2.4.0-py3-none-any.whl", hash = "sha256:008db5efd8c2f77bd37d2368ea5f713edceae1c65f11fd608393179478649e0f", size = 155921, upload-time = "2025-10-30T12:57:46.253Z" }, +] + [[package]] name = "hyperframe" version = "6.1.0" @@ -881,6 +1058,73 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "invoke" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/33/f6/227c48c5fe47fa178ccf1fda8f047d16c97ba926567b661e9ce2045c600c/invoke-3.0.3.tar.gz", hash = "sha256:437b6a622223824380bfb4e64f612711a6b648c795f565efc8625af66fb57f0c", size = 343419, upload-time = "2026-04-07T15:17:48.307Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/de/bbc12563bbf979618d17625a4e753ff7a078523e28d870d3626daa97261a/invoke-3.0.3-py3-none-any.whl", hash = "sha256:f11327165e5cbb89b2ad1d88d3292b5113332c43b8553b494da435d6ec6f5053", size = 160958, upload-time = "2026-04-07T15:17:46.875Z" }, +] + +[[package]] +name = "ipdb" +version = "0.13.13" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "decorator" }, + { name = "ipython" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/1b/7e07e7b752017f7693a0f4d41c13e5ca29ce8cbcfdcc1fd6c4ad8c0a27a0/ipdb-0.13.13.tar.gz", hash = "sha256:e3ac6018ef05126d442af680aad863006ec19d02290561ac88b8b1c0b0cfc726", size = 17042, upload-time = "2023-03-09T15:40:57.487Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/4c/b075da0092003d9a55cf2ecc1cae9384a1ca4f650d51b00fc59875fe76f6/ipdb-0.13.13-py3-none-any.whl", hash = "sha256:45529994741c4ab6d2388bfa5d7b725c2cf7fe9deffabdb8a6113aa5ed449ed4", size = 12130, upload-time = "2023-03-09T15:40:55.021Z" }, +] + +[[package]] +name = "ipython" +version = "9.18.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "ipython-pygments-lexers" }, + { name = "jedi" }, + { name = "matplotlib-inline" }, + { name = "pexpect", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" }, + { name = "prompt-toolkit" }, + { name = "psutil", marker = "sys_platform != 'android' and sys_platform != 'cygwin' and sys_platform != 'emscripten'" }, + { name = "pygments" }, + { name = "stack-data" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/38/04/0d945c72d5b77527273ecb4c66aa2436de7a3b3bbe3da345bf053232b886/ipython-9.18.1.tar.gz", hash = "sha256:6319c0f5372c196397899479e6db1783dd7937abae06815d1317e8d5d51aaaaf", size = 4437314, upload-time = "2026-11-02T09:19:55.55Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bb/1c/91da4a1c541b75e97eb99d09c6a9b0534de55bb4a466669d1170e39b915c/ipython-9.18.1-py3-none-any.whl", hash = "sha256:997ce9140d374531a61069c70c0f9ef299d6dd3559ea0f94b8af589726e3c1d5", size = 649819, upload-time = "2026-11-02T09:19:53.32Z" }, +] + +[[package]] +name = "ipython-pygments-lexers" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ef/4c/5dd1d8af08107f88c7f741ead7a40854b8ac24ddf9ae850afbcf698aa552/ipython_pygments_lexers-1.1.1.tar.gz", hash = "sha256:09c0138009e56b6854f9535736f4171d855c8c08a563a0dcd8022f78355c7e81", size = 8393, upload-time = "2025-01-17T11:24:34.505Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d9/33/1f075bf72b0b747cb3288d011319aaf64083cf2efef8354174e3ed4540e2/ipython_pygments_lexers-1.1.1-py3-none-any.whl", hash = "sha256:a9462224a505ade19a605f71f8fa63c2048833ce50abc86768a0d81d876dc81c", size = 8074, upload-time = "2025-01-17T11:24:33.271Z" }, +] + +[[package]] +name = "jedi" +version = "0.20.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "parso" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/a4/4692ecd7fa700ac1066b1c1f6cadef60aa2e01e5e364710235137d823e0a/jedi-0.20.1.tar.gz", hash = "sha256:2f71208c3f9c1bca057c0e90d3f272aba44ace88fc4067d7587e9e069331b7e5", size = 3121738, upload-time = "2026-10-12T17:42:24.361Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/be/c7/71eb0d51cdcbb63b857c931aa4e9218b078b5d9f8ecd383b234f28fe7b0f/jedi-0.20.1-py2.py3-none-any.whl", hash = "sha256:0fb16d86c4a4c73c37ba518c77419975e30fcc620658a8d14fbb5720cdd34142", size = 4885980, upload-time = "2026-10-12T17:42:21.585Z" }, +] + [[package]] name = "jinja2" version = "3.1.6" @@ -941,6 +1185,50 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/23/d4/6effc16acb9fff30603c46270ab58f48c812ba1f567025f22ab5eb96c91a/jubilant-1.14.0-py3-none-any.whl", hash = "sha256:2a631fb2363cdd26c0dea52659b5a8946e36f57fec922895521ab59bda6398e8", size = 39483, upload-time = "2026-09-29T23:03:23.102Z" }, ] +[[package]] +name = "juju" +version = "3.6.1.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "backports-datetime-fromisoformat" }, + { name = "hvac" }, + { name = "kubernetes" }, + { name = "macaroonbakery" }, + { name = "packaging" }, + { name = "paramiko" }, + { name = "pyasn1" }, + { name = "pyyaml" }, + { name = "toposort" }, + { name = "typing-extensions" }, + { name = "typing-inspect" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/ac/42ed7565d1b031856fb7e8884089acb3eab5aa6a2dabfee3fcf09660f885/juju-3.6.1.3.tar.gz", hash = "sha256:2fcf510fa35b387abb382da3a8b2227f38852ae7e9dc1058afb228588e1aec51", size = 305052, upload-time = "2025-07-11T02:15:59.237Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/86/13/e31f9b9c24e723a161bc3b75729acb109d80bf3f75f937e4c3d408f19e5a/juju-3.6.1.3-py3-none-any.whl", hash = "sha256:87469500a0a4e6a3976ddf0595e316379868d5cea96e15af2d2d4b94188f76e5", size = 287075, upload-time = "2025-07-11T02:15:57.118Z" }, +] + +[[package]] +name = "kubernetes" +version = "30.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "google-auth" }, + { name = "oauthlib" }, + { name = "python-dateutil" }, + { name = "pyyaml" }, + { name = "requests" }, + { name = "requests-oauthlib" }, + { name = "six" }, + { name = "urllib3" }, + { name = "websocket-client" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/3c/9f29f6cab7f35df8e54f019e5719465fa97b877be2454e99f989270b4f34/kubernetes-30.1.0.tar.gz", hash = "sha256:41e4c77af9f28e7a6c314e3bd06a8c6229ddd787cad684e0ab9f69b498e98ebc", size = 887810, upload-time = "2024-06-06T15:58:30.031Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/2027ddede72d33be2effc087580aeba07e733a7360780ae87226f1f91bd8/kubernetes-30.1.0-py2.py3-none-any.whl", hash = "sha256:e212e8b7579031dd2e512168b617373bc1e03888d41ac4e04039240a292d478d", size = 1706042, upload-time = "2024-06-06T15:58:27.13Z" }, +] + [[package]] name = "lightkube" version = "1.0.1" @@ -965,6 +1253,23 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c4/7f/57524764347c39a9d523c4eef68522b693523d7dbda13a2a14f9a39f315b/lightkube_models-1.36.3.8-py3-none-any.whl", hash = "sha256:a938eed82e61ae3083e7cac15802e58cf8f7e5d7d6a9a9576d5cbb043427db46", size = 322569, upload-time = "2026-07-26T08:40:45.697Z" }, ] +[[package]] +name = "macaroonbakery" +version = "1.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "protobuf" }, + { name = "pymacaroons" }, + { name = "pynacl" }, + { name = "pyrfc3339" }, + { name = "requests" }, + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4b/ae/59f5ab870640bd43673b708e5f24aed592dc2673cc72caa49b0053b4af37/macaroonbakery-1.3.4.tar.gz", hash = "sha256:41ca993a23e4f8ef2fe7723b5cd4a30c759735f1d5021e990770c8a0e0f33970", size = 82143, upload-time = "2023-12-13T14:22:22.539Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/60/42/227f748dc222b7a1c5cb40c7c74ab4162c7fc146b88980776b490ab673a1/macaroonbakery-1.3.4-py2.py3-none-any.whl", hash = "sha256:1e952a189f5c1e96ef82b081b2852c770d7daa20987e2088e762dd5689fb253b", size = 103184, upload-time = "2023-12-13T14:22:20.159Z" }, +] + [[package]] name = "markdown-it-py" version = "4.2.0" @@ -1073,6 +1378,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/4e/d3/fe08482b5cd995033556d45041a4f4e76e7f0521112a9c9991d40d39825f/markupsafe-3.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8", size = 13928, upload-time = "2025-09-27T18:37:39.037Z" }, ] +[[package]] +name = "matplotlib-inline" +version = "0.2.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bd/c0/9f7c9a46090390368a4d7bcb76bb87a4a36c421e4c0792cdb53486ffac7a/matplotlib_inline-0.2.2.tar.gz", hash = "sha256:72f3fe8fce36b70d4a5b612f899090cd0401deddc4ea90e1572b9f4bfb058c79", size = 8150, upload-time = "2026-05-08T17:33:33.49Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/41/09/5b161152e2d90f7b87f781c2e1267494aef9c32498df793f73ad0a0a494a/matplotlib_inline-0.2.2-py3-none-any.whl", hash = "sha256:3c821cf1c209f59fb2d2d64abbf5b23b67bcb2210d663f9918dd851c6da1fcf6", size = 9534, upload-time = "2026-05-08T17:33:32.055Z" }, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -1138,6 +1455,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/90/91/56c5d560f20e6c20e9e4f55bd0e458f7f162aa689ee350346c04c48eac0b/msgspec-0.21.1-cp314-cp314t-win_arm64.whl", hash = "sha256:0d2cc73df6058d811a126ac3a8ad63a4dfa210c82f9cf5a004802eaf4712de90", size = 183149, upload-time = "2026-04-12T21:44:48.833Z" }, ] +[[package]] +name = "mypy-extensions" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/6f/43edf3be2748d0e40974a5ee046a8bb4c9961a4bdd3e7d5c6dcbf32d1af6/mypy_extensions-1.2.0.tar.gz", hash = "sha256:c6e275a07f1c2fc096b62940452d0eaa3f3af7de45d704787866240a7c6d5a51", size = 6566, upload-time = "2026-11-03T16:26:33.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/99/7b1adac7e97ce7bbda34792dc6e9b2f5cc5cffd1875883f78a818b2a2687/mypy_extensions-1.2.0-py3-none-any.whl", hash = "sha256:993e7a20aa5671eb41a7132cf555af30062da99729601601b9a8382b11cae768", size = 5114, upload-time = "2026-11-03T16:26:32.731Z" }, +] + +[[package]] +name = "oauthlib" +version = "4.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/33/17/2bb072de0b990303c985f26869fd47bb179024a051f47e7f9d208eb92f8e/oauthlib-4.0.1.tar.gz", hash = "sha256:3d73febdb6faa00f277c81fb04be7b7586fb96fc3b7f0b9c772dada69a25ede7", size = 191219, upload-time = "2026-10-31T09:52:58.008Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/ef/3b8adde1b32a6f540758bff734d3442c621734c83708e5f02b0ba2f43b84/oauthlib-4.0.1-py3-none-any.whl", hash = "sha256:498a298876e996301950a5b053d12c31628bb7b895db03666430c69ce182eb61", size = 161934, upload-time = "2026-10-31T09:52:56.206Z" }, +] + [[package]] name = "opentelemetry-api" version = "1.45.2" @@ -1220,6 +1555,42 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, ] +[[package]] +name = "paramiko" +version = "5.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "bcrypt" }, + { name = "cryptography" }, + { name = "invoke" }, + { name = "pynacl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/76/cb/b1fde76618d84b1acf54d3d03d2b833ba5878afd12b9899346cc080f209d/paramiko-5.1.0.tar.gz", hash = "sha256:239b5f9b2a53006cd54f83cf8495ee742083708ead947882c8dd2786de79f39b", size = 1579549, upload-time = "2026-10-18T02:38:51.931Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/13/45/fa0e8d70cb25d2dae06bc238e580a84834f6ca53a4e2408cccc19a78db7b/paramiko-5.1.0-py3-none-any.whl", hash = "sha256:d9fe6d67a9d0bbf3eb85b051d26ab850b678c02d060f32915b944e5ca6d0d9e1", size = 211623, upload-time = "2026-10-18T02:38:49.903Z" }, +] + +[[package]] +name = "parso" +version = "0.8.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/30/4b/90c937815137d43ce71ba043cd3566221e9df6b9c805f24b5d138c9d40a7/parso-0.8.7.tar.gz", hash = "sha256:eaaac4c9fdd5e9e8852dc778d2d7405897ec510f2a298071453e5e3a07914bb1", size = 401824, upload-time = "2026-05-01T23:13:02.138Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/5d/8268b644392ee874ee82a635cd0df1773de230bde356c38de28e298392cc/parso-0.8.7-py2.py3-none-any.whl", hash = "sha256:a8926eb2a1b915486941fdbd31e86a4baf88fe8c210f25f2f35ecec5b574ca1c", size = 107025, upload-time = "2026-05-01T23:12:58.867Z" }, +] + +[[package]] +name = "pexpect" +version = "4.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ptyprocess" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/42/92/cc564bf6381ff43ce1f4d06852fc19a2f11d180f23dc32d9588bee2f149d/pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f", size = 166450, upload-time = "2023-11-25T09:07:26.339Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523", size = 63772, upload-time = "2023-11-25T06:56:14.81Z" }, +] + [[package]] name = "pluggy" version = "1.6.0" @@ -1281,7 +1652,9 @@ integration = [ { name = "allure-pytest", marker = "python_full_version >= '3.12'" }, { name = "allure-pytest-default-results", marker = "python_full_version >= '3.12'" }, { name = "jubilant", marker = "python_full_version >= '3.12'" }, + { name = "juju", marker = "python_full_version >= '3.12'" }, { name = "pytest", marker = "python_full_version >= '3.12'" }, + { name = "pytest-operator", marker = "python_full_version >= '3.12'" }, { name = "tomli-w", marker = "python_full_version >= '3.12'" }, ] lint = [ @@ -1291,6 +1664,7 @@ lint = [ unit = [ { name = "coverage", marker = "python_full_version >= '3.12'" }, { name = "pytest", marker = "python_full_version >= '3.12'" }, + { name = "pytest-asyncio", marker = "python_full_version >= '3.12'" }, ] [package.group-requires-python] @@ -1334,7 +1708,9 @@ integration = [ { name = "allure-pytest", marker = "python_full_version >= '3.12'", specifier = "==2.16.2" }, { name = "allure-pytest-default-results", marker = "python_full_version >= '3.12'", specifier = "==0.1.4" }, { name = "jubilant", marker = "python_full_version >= '3.12'", specifier = "==1.14.0" }, + { name = "juju", marker = "python_full_version >= '3.12'", specifier = "==3.6.1.3" }, { name = "pytest", marker = "python_full_version >= '3.12'", specifier = "==9.1.1" }, + { name = "pytest-operator", marker = "python_full_version >= '3.12'", specifier = "==0.43.2" }, { name = "tomli-w", marker = "python_full_version >= '3.12'", specifier = "==1.2.0" }, ] lint = [ @@ -1344,6 +1720,34 @@ lint = [ unit = [ { name = "coverage", extras = ["toml"], marker = "python_full_version >= '3.12'", specifier = "==7.16.2" }, { name = "pytest", marker = "python_full_version >= '3.12'", specifier = "==9.1.1" }, + { name = "pytest-asyncio", marker = "python_full_version >= '3.12'", specifier = "==0.21.2" }, +] + +[[package]] +name = "prompt-toolkit" +version = "3.0.53" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "wcwidth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/ea/39b988c938f75cb75d7045b5c69f8bfed47ee2152c8837fb403de29d6fb8/prompt_toolkit-3.0.53.tar.gz", hash = "sha256:9ec8a0ad96d5c56148b3f914aa79c1564c3fde5d2e6b876e7bc327e353cf8fa6", size = 435492, upload-time = "2026-07-26T20:56:14.758Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/6f/84908cad2d6aa5144abcf7b42709fe4fdb459bc640ec7ac5786e7693dabc/prompt_toolkit-3.0.53-py3-none-any.whl", hash = "sha256:01c0891d7f9237d5e339f7d3e42cdae80b7534abb1c7c0e3352efba6231492f2", size = 392288, upload-time = "2026-07-26T20:56:12.512Z" }, +] + +[[package]] +name = "protobuf" +version = "7.36.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d9/89/5b8517baa72f84a67b8a307ba953c91057af618bf40bf676f3c03551f8f0/protobuf-7.36.2.tar.gz", hash = "sha256:497d0463ff3316681da6c0b9e8d06cb465d61abce00b613ab42226175644d1bb", size = 512737, upload-time = "2026-09-17T20:07:59.326Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/72/98342feb672507c8f3a69e34b4fa8961f608edba5c1a48a6f47156d92cb5/protobuf-7.36.2-cp310-abi3-macosx_10_9_universal2.whl", hash = "sha256:cbc70b17ee27e28894c7fee8bb04be1abead49e936bc70eb60052531eee2079e", size = 456039, upload-time = "2026-09-17T20:07:51.542Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ea/91fdf7c2b8bbd49cde056f00a9df6773532987e1c00fe2830b895af95c7e/protobuf-7.36.2-cp310-abi3-manylinux2014_aarch64.whl", hash = "sha256:e11e1f0180583a2af89db6a2ecd9e8dc40aa6d2988ca175bfd0e6d12ea72d74e", size = 344219, upload-time = "2026-09-17T20:07:52.914Z" }, + { url = "https://files.pythonhosted.org/packages/17/ab/5fd5f8ece73fad885c5a09aa849b32d70472f954ba3a92d3bb5974ea953b/protobuf-7.36.2-cp310-abi3-manylinux2014_s390x.whl", hash = "sha256:f4fee11ec330d238b34a05c9b675f693c20415d1c5bd7d5320cc2f8a798eb9cf", size = 357223, upload-time = "2026-09-17T20:07:53.985Z" }, + { url = "https://files.pythonhosted.org/packages/db/f3/3996583dd2906297a637af12114deddf7658af6e683fedb83be061983fb5/protobuf-7.36.2-cp310-abi3-manylinux2014_x86_64.whl", hash = "sha256:89f23aa53c24553a2416fd4fd1ec06f74fa42b14b546d8883128813f775bbfd2", size = 343223, upload-time = "2026-09-17T20:07:54.931Z" }, + { url = "https://files.pythonhosted.org/packages/fc/1b/dcc64f358fcb51811b58ae40b3d28f820725f116d86487cc20bd4b130701/protobuf-7.36.2-cp310-abi3-win32.whl", hash = "sha256:912c1221170e16c08d1f086762f563dd61ff83c18b5fa6652952dfaded66f728", size = 442998, upload-time = "2026-09-17T20:07:55.826Z" }, + { url = "https://files.pythonhosted.org/packages/8a/55/b77bda4e5e5f5971fb51b07663694690e9afdb9402136c16a522bd621cad/protobuf-7.36.2-cp310-abi3-win_amd64.whl", hash = "sha256:a300819d441e078a5608c0d3c709796bb548136058fda017ae51d425b44fd353", size = 456514, upload-time = "2026-09-17T20:07:57.188Z" }, + { url = "https://files.pythonhosted.org/packages/e4/04/d52c7016b04b6c5108f26691f9d33ec82a9b65d041f1a9c771137693d618/protobuf-7.36.2-py3-none-any.whl", hash = "sha256:bdb3a345d48db958e6ce1f18e508beb0cc981d64f24088427549c866cd039f1e", size = 179806, upload-time = "2026-09-17T20:07:58.211Z" }, ] [[package]] @@ -1399,7 +1803,8 @@ name = "psycopg2" version = "2.9.12" source = { registry = "https://pypi.org/simple" } resolution-markers = [ - "python_full_version >= '3.12'", + "python_full_version >= '3.14'", + "python_full_version >= '3.12' and python_full_version < '3.14'", "python_full_version >= '3.10' and python_full_version < '3.12'", "python_full_version > '3.9' and python_full_version < '3.10'", "python_full_version == '3.9'", @@ -1414,6 +1819,45 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e3/c7/f04d68a178c9a5830f8f6c2116bdbafe12386d65aabf88c099814264d22e/psycopg2-2.9.12-cp39-cp39-win_amd64.whl", hash = "sha256:09826a6b89714626a662275d03f21639f1c68d183e2dcc9ba134d463a3da753e", size = 2757855, upload-time = "2026-04-20T23:33:28.837Z" }, ] +[[package]] +name = "ptyprocess" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/20/e5/16ff212c1e452235a90aeb09066144d0c5a6a8c0834397e03f5224495c4e/ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220", size = 70762, upload-time = "2020-12-28T15:15:30.155Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35", size = 13993, upload-time = "2020-12-28T15:15:28.35Z" }, +] + +[[package]] +name = "pure-eval" +version = "0.2.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/da/9f/abfd2959e9261dd5217ca8551d4de211ca6ab26fe9b72cf44731ff6c4442/pure_eval-0.2.4.tar.gz", hash = "sha256:260c2774686e651b79f8b8e7fc9d80b3599ea6a66334b47d5f4abb69fc2c0ea1", size = 20563, upload-time = "2026-09-10T21:41:22.836Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/18/83376915176eb058cb86470eb7396388a13350b09a8f233a79303bbcbc5b/pure_eval-0.2.4-py3-none-any.whl", hash = "sha256:96cae060a313cfaad51bb761278bfb0e62dc0248d9315a81173752dc546cd37a", size = 11893, upload-time = "2026-09-10T21:41:21.532Z" }, +] + +[[package]] +name = "pyasn1" +version = "0.6.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/88/7e/3c0da41061a2021cac7cd524fd57092adbe5b515e8bf9005702e366802e2/pyasn1-0.6.5.tar.gz", hash = "sha256:6b11616a6bcf3a40e635f082bb232fa57b5e0dd7f517bd7ddd69ec3794508a47", size = 155152, upload-time = "2026-10-27T06:32:49.125Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/1f/3eefd5c84c35cae44549ce1c7f7e58f7945b34f5a6bce07a135438522073/pyasn1-0.6.5-py3-none-any.whl", hash = "sha256:4017b0fce125096b8573b39c989fdb1a4b19cf761e683398184550fea0e66587", size = 84807, upload-time = "2026-10-27T06:32:48.045Z" }, +] + +[[package]] +name = "pyasn1-modules" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" }, +] + [[package]] name = "pycparser" version = "3.0" @@ -1577,6 +2021,66 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, ] +[[package]] +name = "pymacaroons" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pynacl" }, + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/37/b4/52ff00b59e91c4817ca60210c33caf11e85a7f68f7b361748ca2eb50923e/pymacaroons-0.13.0.tar.gz", hash = "sha256:1e6bba42a5f66c245adf38a5a4006a99dcc06a0703786ea636098667d42903b8", size = 21083, upload-time = "2018-02-21T18:07:49.045Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d8/87/fd9b54258216e3f19671f6e9dd76da1ebc49e93ea0107c986b1071dd3068/pymacaroons-0.13.0-py2.py3-none-any.whl", hash = "sha256:3e14dff6a262fdbf1a15e769ce635a8aea72e6f8f91e408f9a97166c53b91907", size = 19463, upload-time = "2018-02-21T18:07:47.085Z" }, +] + +[[package]] +name = "pynacl" +version = "1.6.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d9/9a/4019b524b03a13438637b11538c82781a5eda427394380381af8f04f467a/pynacl-1.6.2.tar.gz", hash = "sha256:018494d6d696ae03c7e656e5e74cdfd8ea1326962cc401bcf018f1ed8436811c", size = 3511692, upload-time = "2026-01-01T17:48:10.851Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4b/79/0e3c34dc3c4671f67d251c07aa8eb100916f250ee470df230b0ab89551b4/pynacl-1.6.2-cp314-cp314t-macosx_10_10_universal2.whl", hash = "sha256:622d7b07cc5c02c666795792931b50c91f3ce3c2649762efb1ef0d5684c81594", size = 390064, upload-time = "2026-01-01T17:31:57.264Z" }, + { url = "https://files.pythonhosted.org/packages/eb/1c/23a26e931736e13b16483795c8a6b2f641bf6a3d5238c22b070a5112722c/pynacl-1.6.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d071c6a9a4c94d79eb665db4ce5cedc537faf74f2355e4d502591d850d3913c0", size = 809370, upload-time = "2026-01-01T17:31:59.198Z" }, + { url = "https://files.pythonhosted.org/packages/87/74/8d4b718f8a22aea9e8dcc8b95deb76d4aae380e2f5b570cc70b5fd0a852d/pynacl-1.6.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fe9847ca47d287af41e82be1dd5e23023d3c31a951da134121ab02e42ac218c9", size = 1408304, upload-time = "2026-01-01T17:32:01.162Z" }, + { url = "https://files.pythonhosted.org/packages/fd/73/be4fdd3a6a87fe8a4553380c2b47fbd1f7f58292eb820902f5c8ac7de7b0/pynacl-1.6.2-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:04316d1fc625d860b6c162fff704eb8426b1a8bcd3abacea11142cbd99a6b574", size = 844871, upload-time = "2026-01-01T17:32:02.824Z" }, + { url = "https://files.pythonhosted.org/packages/55/ad/6efc57ab75ee4422e96b5f2697d51bbcf6cdcc091e66310df91fbdc144a8/pynacl-1.6.2-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:44081faff368d6c5553ccf55322ef2819abb40e25afaec7e740f159f74813634", size = 1446356, upload-time = "2026-01-01T17:32:04.452Z" }, + { url = "https://files.pythonhosted.org/packages/78/b7/928ee9c4779caa0a915844311ab9fb5f99585621c5d6e4574538a17dca07/pynacl-1.6.2-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:a9f9932d8d2811ce1a8ffa79dcbdf3970e7355b5c8eb0c1a881a57e7f7d96e88", size = 826814, upload-time = "2026-01-01T17:32:06.078Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a9/1bdba746a2be20f8809fee75c10e3159d75864ef69c6b0dd168fc60e485d/pynacl-1.6.2-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:bc4a36b28dd72fb4845e5d8f9760610588a96d5a51f01d84d8c6ff9849968c14", size = 1411742, upload-time = "2026-01-01T17:32:07.651Z" }, + { url = "https://files.pythonhosted.org/packages/f3/2f/5e7ea8d85f9f3ea5b6b87db1d8388daa3587eed181bdeb0306816fdbbe79/pynacl-1.6.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3bffb6d0f6becacb6526f8f42adfb5efb26337056ee0831fb9a7044d1a964444", size = 801714, upload-time = "2026-01-01T17:32:09.558Z" }, + { url = "https://files.pythonhosted.org/packages/06/ea/43fe2f7eab5f200e40fb10d305bf6f87ea31b3bbc83443eac37cd34a9e1e/pynacl-1.6.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2fef529ef3ee487ad8113d287a593fa26f48ee3620d92ecc6f1d09ea38e0709b", size = 1372257, upload-time = "2026-01-01T17:32:11.026Z" }, + { url = "https://files.pythonhosted.org/packages/4d/54/c9ea116412788629b1347e415f72195c25eb2f3809b2d3e7b25f5c79f13a/pynacl-1.6.2-cp314-cp314t-win32.whl", hash = "sha256:a84bf1c20339d06dc0c85d9aea9637a24f718f375d861b2668b2f9f96fa51145", size = 231319, upload-time = "2026-01-01T17:32:12.46Z" }, + { url = "https://files.pythonhosted.org/packages/ce/04/64e9d76646abac2dccf904fccba352a86e7d172647557f35b9fe2a5ee4a1/pynacl-1.6.2-cp314-cp314t-win_amd64.whl", hash = "sha256:320ef68a41c87547c91a8b58903c9caa641ab01e8512ce291085b5fe2fcb7590", size = 244044, upload-time = "2026-01-01T17:32:13.781Z" }, + { url = "https://files.pythonhosted.org/packages/33/33/7873dc161c6a06f43cda13dec67b6fe152cb2f982581151956fa5e5cdb47/pynacl-1.6.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d29bfe37e20e015a7d8b23cfc8bd6aa7909c92a1b8f41ee416bbb3e79ef182b2", size = 188740, upload-time = "2026-01-01T17:32:15.083Z" }, + { url = "https://files.pythonhosted.org/packages/be/7b/4845bbf88e94586ec47a432da4e9107e3fc3ce37eb412b1398630a37f7dd/pynacl-1.6.2-cp38-abi3-macosx_10_10_universal2.whl", hash = "sha256:c949ea47e4206af7c8f604b8278093b674f7c79ed0d4719cc836902bf4517465", size = 388458, upload-time = "2026-01-01T17:32:16.829Z" }, + { url = "https://files.pythonhosted.org/packages/1e/b4/e927e0653ba63b02a4ca5b4d852a8d1d678afbf69b3dbf9c4d0785ac905c/pynacl-1.6.2-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8845c0631c0be43abdd865511c41eab235e0be69c81dc66a50911594198679b0", size = 800020, upload-time = "2026-01-01T17:32:18.34Z" }, + { url = "https://files.pythonhosted.org/packages/7f/81/d60984052df5c97b1d24365bc1e30024379b42c4edcd79d2436b1b9806f2/pynacl-1.6.2-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:22de65bb9010a725b0dac248f353bb072969c94fa8d6b1f34b87d7953cf7bbe4", size = 1399174, upload-time = "2026-01-01T17:32:20.239Z" }, + { url = "https://files.pythonhosted.org/packages/68/f7/322f2f9915c4ef27d140101dd0ed26b479f7e6f5f183590fd32dfc48c4d3/pynacl-1.6.2-cp38-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:46065496ab748469cdd999246d17e301b2c24ae2fdf739132e580a0e94c94a87", size = 835085, upload-time = "2026-01-01T17:32:22.24Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d0/f301f83ac8dbe53442c5a43f6a39016f94f754d7a9815a875b65e218a307/pynacl-1.6.2-cp38-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8a66d6fb6ae7661c58995f9c6435bda2b1e68b54b598a6a10247bfcdadac996c", size = 1437614, upload-time = "2026-01-01T17:32:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/c4/58/fc6e649762b029315325ace1a8c6be66125e42f67416d3dbd47b69563d61/pynacl-1.6.2-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:26bfcd00dcf2cf160f122186af731ae30ab120c18e8375684ec2670dccd28130", size = 818251, upload-time = "2026-01-01T17:32:25.69Z" }, + { url = "https://files.pythonhosted.org/packages/c9/a8/b917096b1accc9acd878819a49d3d84875731a41eb665f6ebc826b1af99e/pynacl-1.6.2-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:c8a231e36ec2cab018c4ad4358c386e36eede0319a0c41fed24f840b1dac59f6", size = 1402859, upload-time = "2026-01-01T17:32:27.215Z" }, + { url = "https://files.pythonhosted.org/packages/85/42/fe60b5f4473e12c72f977548e4028156f4d340b884c635ec6b063fe7e9a5/pynacl-1.6.2-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:68be3a09455743ff9505491220b64440ced8973fe930f270c8e07ccfa25b1f9e", size = 791926, upload-time = "2026-01-01T17:32:29.314Z" }, + { url = "https://files.pythonhosted.org/packages/fa/f9/e40e318c604259301cc091a2a63f237d9e7b424c4851cafaea4ea7c4834e/pynacl-1.6.2-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8b097553b380236d51ed11356c953bf8ce36a29a3e596e934ecabe76c985a577", size = 1363101, upload-time = "2026-01-01T17:32:31.263Z" }, + { url = "https://files.pythonhosted.org/packages/48/47/e761c254f410c023a469284a9bc210933e18588ca87706ae93002c05114c/pynacl-1.6.2-cp38-abi3-win32.whl", hash = "sha256:5811c72b473b2f38f7e2a3dc4f8642e3a3e9b5e7317266e4ced1fba85cae41aa", size = 227421, upload-time = "2026-01-01T17:32:33.076Z" }, + { url = "https://files.pythonhosted.org/packages/41/ad/334600e8cacc7d86587fe5f565480fde569dfb487389c8e1be56ac21d8ac/pynacl-1.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:62985f233210dee6548c223301b6c25440852e13d59a8b81490203c3227c5ba0", size = 239754, upload-time = "2026-01-01T17:32:34.557Z" }, + { url = "https://files.pythonhosted.org/packages/29/7d/5945b5af29534641820d3bd7b00962abbbdfee84ec7e19f0d5b3175f9a31/pynacl-1.6.2-cp38-abi3-win_arm64.whl", hash = "sha256:834a43af110f743a754448463e8fd61259cd4ab5bbedcf70f9dabad1d28a394c", size = 184801, upload-time = "2026-01-01T17:32:36.309Z" }, +] + +[[package]] +name = "pyrfc3339" +version = "1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytz" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/00/52/75ea0ae249ba885c9429e421b4f94bc154df68484847f1ac164287d978d7/pyRFC3339-1.1.tar.gz", hash = "sha256:81b8cbe1519cdb79bed04910dd6fa4e181faf8c88dff1e1b987b5f7ab23a5b1a", size = 5290, upload-time = "2018-06-11T00:26:31Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/7a/725f5c16756ec6211b1e7eeac09f469084595513917ea069bc023c40a5e2/pyRFC3339-1.1-py2.py3-none-any.whl", hash = "sha256:67196cb83b470709c580bb4738b83165e67c6cc60e1f2e4f286cfcb402a926f4", size = 5669, upload-time = "2018-06-11T00:22:40.934Z" }, +] + [[package]] name = "pysyncobj" version = "0.3.16" @@ -1599,6 +2103,35 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, ] +[[package]] +name = "pytest-asyncio" +version = "0.21.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ae/53/57663d99acaac2fcdafdc697e52a9b1b7d6fcf36616281ff9768a44e7ff3/pytest_asyncio-0.21.2.tar.gz", hash = "sha256:d67738fc232b94b326b9d060750beb16e0074210b98dd8b58a5239fa2a154f45", size = 30656, upload-time = "2024-04-29T13:23:24.738Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9c/ce/1e4b53c213dce25d6e8b163697fbce2d43799d76fa08eea6ad270451c370/pytest_asyncio-0.21.2-py3-none-any.whl", hash = "sha256:ab664c88bb7998f711d8039cacd4884da6430886ae8bbd4eded552ed2004f16b", size = 13368, upload-time = "2024-04-29T13:23:23.126Z" }, +] + +[[package]] +name = "pytest-operator" +version = "0.43.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ipdb" }, + { name = "jinja2" }, + { name = "juju" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2e/48/880facbcaca080b852854f60fd46b37ca2985b27dc7f1713857d9de6d469/pytest_operator-0.43.2.tar.gz", hash = "sha256:3db34dcd9c114a2e41a9bc61da72daf1264e7644fd5b92e855f250cb337e01c3", size = 149628, upload-time = "2025-10-04T14:38:45.16Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/a0/22b018287f4ff7a36cdb79745c196f28897184d27e18b90177f5dfc2a0f4/pytest_operator-0.43.2-py3-none-any.whl", hash = "sha256:d7d01ffe35d14b75577fd80a07c34f0a9f4835cfc6d373b8e2f995bcb4146bda", size = 48322, upload-time = "2025-10-04T14:38:43.763Z" }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -1611,6 +2144,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] +[[package]] +name = "pytz" +version = "2026.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/b0/168030b0bfcc334cf09fa3313afdb888d892c8a0027324683d1de0ec277e/pytz-2026.6.tar.gz", hash = "sha256:3b0fc2727707663d6e517936f444fd8a8b240f1fc32f4bf7ee03274245945284", size = 318520, upload-time = "2026-10-29T09:05:47.011Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/25/564f3fc5b70c1398d706c51f2b1470d0ea0b1b2f96fee67877b6f5bdf3b6/pytz-2026.6-py2.py3-none-any.whl", hash = "sha256:7fed3fee8fd6bd4a2b7b75a8d56021d0624127bf69bd5691f115db929ac570b3", size = 506321, upload-time = "2026-10-29T09:05:45.14Z" }, +] + [[package]] name = "pyyaml" version = "6.0.3" @@ -1720,6 +2262,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, ] +[[package]] +name = "requests-oauthlib" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "oauthlib" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/42/f2/05f29bc3913aea15eb670be136045bf5c5bbf4b99ecb839da9b422bb2c85/requests-oauthlib-2.0.0.tar.gz", hash = "sha256:b3dffaebd884d8cd778494369603a9e7b58d29111bf6b41bdc2dcd87203af4e9", size = 55650, upload-time = "2024-03-22T20:32:29.939Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3b/5d/63d4ae3b9daea098d5d6f5da83984853c1bbacd5dc826764b249fe119d24/requests_oauthlib-2.0.0-py2.py3-none-any.whl", hash = "sha256:7dd8a5c40426b779b0868c404bdef9768deccf22749cde15852df527e6269b36", size = 24179, upload-time = "2024-03-22T20:32:28.055Z" }, +] + [[package]] name = "rich" version = "15.0.0" @@ -1914,6 +2469,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, ] +[[package]] +name = "stack-data" +version = "0.6.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "asttokens" }, + { name = "executing" }, + { name = "pure-eval" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/28/e3/55dcc2cfbc3ca9c29519eb6884dd1415ecb53b0e934862d3559ddcb7e20b/stack_data-0.6.3.tar.gz", hash = "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9", size = 44707, upload-time = "2023-09-30T13:58:05.479Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/7b/ce1eafaf1a76852e2ec9b22edecf1daa58175c090266e9f6c64afcd81d91/stack_data-0.6.3-py3-none-any.whl", hash = "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695", size = 24521, upload-time = "2023-09-30T13:58:03.53Z" }, +] + [[package]] name = "tenacity" version = "9.0.0" @@ -1944,7 +2513,8 @@ name = "tenacity" version = "9.1.4" source = { registry = "https://pypi.org/simple" } resolution-markers = [ - "python_full_version >= '3.12'", + "python_full_version >= '3.14'", + "python_full_version >= '3.12' and python_full_version < '3.14'", "python_full_version >= '3.10' and python_full_version < '3.12'", ] sdist = { url = "https://files.pythonhosted.org/packages/47/c6/ee486fd809e357697ee8a44d3d69222b344920433d3b6666ccd9b374630c/tenacity-9.1.4.tar.gz", hash = "sha256:adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a", size = 49413, upload-time = "2026-02-07T10:45:33.841Z" } @@ -2015,6 +2585,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c7/18/c86eb8e0202e32dd3df50d43d7ff9854f8e0603945ff398974c1d91ac1ef/tomli_w-1.2.0-py3-none-any.whl", hash = "sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90", size = 6675, upload-time = "2025-01-15T12:07:22.074Z" }, ] +[[package]] +name = "toposort" +version = "1.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/69/19/8e955d90985ecbd3b9adb2a759753a6840da2dff3c569d412b2c9217678b/toposort-1.10.tar.gz", hash = "sha256:bfbb479c53d0a696ea7402601f4e693c97b0367837c8898bc6471adfca37a6bd", size = 11132, upload-time = "2023-02-27T13:59:51.834Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f6/17/57b444fd314d5e1593350b9a31d000e7411ba8e17ce12dc7ad54ca76b810/toposort-1.10-py3-none-any.whl", hash = "sha256:cbdbc0d0bee4d2695ab2ceec97fe0679e9c10eab4b2a87a9372b929e70563a87", size = 8500, upload-time = "2023-02-25T20:07:06.538Z" }, +] + +[[package]] +name = "traitlets" +version = "5.16.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2c/2e/a7fbfe268c8a3b32546930c0297c101d65a4a14c304ad5790a9f478f0e4e/traitlets-5.16.1.tar.gz", hash = "sha256:ed900c2b631aa3a112811139fa97b8d2c3bad5e989656bba4b7e52c7852c18c1", size = 166137, upload-time = "2026-08-03T08:32:36.848Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/66/0d785f0bc5e4315a96c989bb476d0fc07ea4f85132550c7b156ca2035d52/traitlets-5.16.1-py3-none-any.whl", hash = "sha256:f775618166caa0396c8e337099240f2bd3e5e917d203b2e6fbe21a58d3cb1f6b", size = 86211, upload-time = "2026-08-03T08:32:34.48Z" }, +] + [[package]] name = "truststore" version = "0.10.4" @@ -2058,6 +2646,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] +[[package]] +name = "typing-inspect" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dc/74/1789779d91f1961fa9438e9a8710cdae6bd138c80d7303996933d117264a/typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78", size = 13825, upload-time = "2023-05-24T20:25:47.612Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f", size = 8827, upload-time = "2023-05-24T20:25:45.287Z" }, +] + [[package]] name = "typing-inspection" version = "0.4.4" @@ -2079,6 +2680,42 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/92/9d/c4e665119135114480843e7ab388fa94d8480650450e6f8e26b70d323a4c/urllib3-2.8.0-py3-none-any.whl", hash = "sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3", size = 135717, upload-time = "2026-09-15T19:29:34.577Z" }, ] +[[package]] +name = "wcwidth" +version = "0.9.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ea/01/e5ac23733628a6bbb91913a765fcf55ee8070d8d991bc88fdaaf805052c7/wcwidth-0.9.4.tar.gz", hash = "sha256:fd8d57d3cdfe570e3265c8fab1885c24e34ef40889c0759c0c304a19e9835954", size = 970051, upload-time = "2026-10-24T18:11:44.954Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/b8/d251589a100250b71a7b8e83fedfcabfd8bd60e78cd1e3329372f63bcc93/wcwidth-0.9.4-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:b7969c9aa258d536df54c8ac8af5cad0c74a6268c9972e1fb60a5f29feffb66d", size = 612952, upload-time = "2026-10-24T18:10:55.925Z" }, + { url = "https://files.pythonhosted.org/packages/04/e9/dfdca30ca36c472de3e260406dee29fc108499ec590c63b3fe279887ee9d/wcwidth-0.9.4-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:f279f32c8e206a9092fa350e53ca0c2bd8072e45b1c9fd31bb6d476b59b591c4", size = 618904, upload-time = "2026-10-24T18:11:02.008Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b6/d7416f38054a107d2fb17c2b73b68723c6c334f69c4e29545fb9e6df81eb/wcwidth-0.9.4-cp310-abi3-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:a1526cd25c6420e5153bb7d764c7509e692215ee3ad9b725db1ad665d47eae09", size = 778780, upload-time = "2026-10-24T18:11:17.299Z" }, + { url = "https://files.pythonhosted.org/packages/7d/5b/42bdf9a4b0e4f9126584af2ec73642de495f3bd8add907430f13c3bb98d2/wcwidth-0.9.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:093469e01d881bff3db93ff3f56c364dc87c441ea01f9f41c22de0c0bdf5c6ef", size = 789012, upload-time = "2026-10-24T18:11:07.829Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e8/0485850748dfdba9443f4151c7b2442cfa4987ba6cd871038eb5d6b8eca9/wcwidth-0.9.4-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b185c8b927b23af2721be1783499d1cfa5c028b098b0858951b4ae224477f1c2", size = 785946, upload-time = "2026-10-24T18:11:18.748Z" }, + { url = "https://files.pythonhosted.org/packages/e9/11/dd3d0379c6094524df6585b76ae3d9727161ff29c003177e3661c36437c1/wcwidth-0.9.4-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:17619066f95c10f44d7ae08ee456602456bc66cc9d5e91966ec73d799acebc5f", size = 795348, upload-time = "2026-10-24T18:11:09.931Z" }, + { url = "https://files.pythonhosted.org/packages/3c/48/1b5299983d9ec084be897162b7cc6014622dfe62847224fa3272b6d79ea5/wcwidth-0.9.4-cp310-abi3-musllinux_1_2_i686.whl", hash = "sha256:b52f265a694dda6b3ad9050c8bd89158ad519109ef7c5eb110b906cc49f25763", size = 793420, upload-time = "2026-10-24T18:11:20.551Z" }, + { url = "https://files.pythonhosted.org/packages/7a/be/e3097d859b075344a7be57774a58d468eafb0ca88e02aad93eb31d69f6ba/wcwidth-0.9.4-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d8905f1390d828d745fdd1904374c90386d902d3cfa9ee88e9875099f75a4e17", size = 796192, upload-time = "2026-10-24T18:11:22.552Z" }, + { url = "https://files.pythonhosted.org/packages/5e/cd/739710c8cf0de461239db5bb6ee678c9a33d30aaa22beff55cc356781818/wcwidth-0.9.4-cp310-abi3-win32.whl", hash = "sha256:4831662c396dd4c59a016ec53c0ac96738006d653a00482777d9a2e2ea323d62", size = 593229, upload-time = "2026-10-24T18:11:35.609Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f1/c123f902bc2ff9e9c2ab66241b8872204df87cbb18ecdf035e120860fedc/wcwidth-0.9.4-cp310-abi3-win_amd64.whl", hash = "sha256:f28d77153303450ee13ebbe888297e75cf532c754555b6cabafc9bdda16c421c", size = 597780, upload-time = "2026-10-24T18:11:36.952Z" }, + { url = "https://files.pythonhosted.org/packages/4b/88/1cb5ddaf5510b918e01aa95fc4b68df91dead784b63e4931037c5673e85f/wcwidth-0.9.4-cp310-abi3-win_arm64.whl", hash = "sha256:2b58fc8cf2de1bf9cdb68b8beaa5be198742414a7c8cd97aa51ec039783ffa49", size = 598786, upload-time = "2026-10-24T18:11:30.886Z" }, + { url = "https://files.pythonhosted.org/packages/b0/cc/46a31c12b4cdad04f546a3c0aca5d000d77aa5069ae88b4db24525cc29c4/wcwidth-0.9.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:87e4101789415a6cf55ec4c53eceeb4782c2654c88692941cb588f19dca1959f", size = 613805, upload-time = "2026-10-24T18:10:58.887Z" }, + { url = "https://files.pythonhosted.org/packages/18/f6/5a8327af9a65153ea9823d6a12fc182f325264050aa25c05a5deadc189c9/wcwidth-0.9.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ab1e5190fb82476e75fbf963e9d59b4fb1c1e1f4ced82069a0c989016aa959f7", size = 619936, upload-time = "2026-10-24T18:11:04.073Z" }, + { url = "https://files.pythonhosted.org/packages/1f/d3/bb8a7f4aa9b915e56e09841b07636ba49c82ec987ad3d2022e1696c038d9/wcwidth-0.9.4-cp314-cp314t-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:8f892713ab5795d3abae181e9c02db0eb24de4084f9ee080535369d3d98d7bb5", size = 794563, upload-time = "2026-10-24T18:11:24.4Z" }, + { url = "https://files.pythonhosted.org/packages/12/0c/986acadef534688a57502d484a40e0f30bdca2d39514fe0a311f7d575f70/wcwidth-0.9.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:befbf46467100e43fd8c8cc0c031a0105f13f5418c3be95fdcf0c47214487967", size = 806565, upload-time = "2026-10-24T18:11:14.297Z" }, + { url = "https://files.pythonhosted.org/packages/9b/1d/66a94b9ac07037d7cf2c1f1288867c9932215d467893eaa5ec8d548c7f2f/wcwidth-0.9.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9c4b0dd04cca520792100f6110d10be262c94b285a281d1759c551f159214633", size = 802372, upload-time = "2026-10-24T18:11:26.275Z" }, + { url = "https://files.pythonhosted.org/packages/d1/00/1d50b8e8b45a8330b582695bf8196081a609317928a3718cf21b3d14a899/wcwidth-0.9.4-cp314-cp314t-win32.whl", hash = "sha256:14410eb73178cc492aa9bf22f7c12e3bf930e5470b7220cf6f530efbfa2e03f3", size = 598917, upload-time = "2026-10-24T18:11:38.369Z" }, + { url = "https://files.pythonhosted.org/packages/b4/fc/3e39a33fc8f5c4e07611578710275039c9d4a6655e2be7cf3459401a30cc/wcwidth-0.9.4-cp314-cp314t-win_amd64.whl", hash = "sha256:c36954849aafae1092d6f9de9548c5280c1d6841637a27ca288b2241c802c4ab", size = 603536, upload-time = "2026-10-24T18:11:39.922Z" }, + { url = "https://files.pythonhosted.org/packages/e1/8c/b1f399fd2f8449e42978192967ab6df441d7cf894b10117983c36c062b18/wcwidth-0.9.4-cp314-cp314t-win_arm64.whl", hash = "sha256:79e09e9824c88f5e275ca99e921685567a5c5c1bb6165c16e27ddd1adab33a95", size = 605127, upload-time = "2026-10-24T18:11:32.367Z" }, + { url = "https://files.pythonhosted.org/packages/04/46/839780e772e9068580619d4d691348b7a5f9c4fa5ffe501e522eefeb27cc/wcwidth-0.9.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:a8c9ce14c6b4a499e61de6de7e9e456de11be8bc991554e2ab2ed4feb40b9664", size = 613850, upload-time = "2026-10-24T18:11:00.725Z" }, + { url = "https://files.pythonhosted.org/packages/d2/66/b2559c7012bbd4268f5b5c0288cb793c78235d354e306871a55893aa9d1a/wcwidth-0.9.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:d68f09093c9bec9226a52edc47487042ed4f64c5df91d06f00419495071c0279", size = 620207, upload-time = "2026-10-24T18:11:05.975Z" }, + { url = "https://files.pythonhosted.org/packages/d1/fe/7d2c39e28924b2430b20099e36276f14e00e75c7bbe4ba5b1ed44d1d465a/wcwidth-0.9.4-cp315-cp315t-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:d76b7c715c5ca0103b28915f699f1020ae21f06f1d22cdd85a7a97f7b1536eed", size = 797056, upload-time = "2026-10-24T18:11:27.911Z" }, + { url = "https://files.pythonhosted.org/packages/2b/d7/f4f9967a411e02b89b74df2f49f44977c4badccf29738f3ae6941619e27c/wcwidth-0.9.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:29c0685f5f5f8815b88308fdcbe2cd12a92996a21a5b1e18352d165174ef7a6d", size = 806169, upload-time = "2026-10-24T18:11:15.724Z" }, + { url = "https://files.pythonhosted.org/packages/ac/bb/e2b40c6522f3aa1222558487dda3551d297e07e245761b4816f6caeebc29/wcwidth-0.9.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e05458491759aa42b7b85f36345b3e6df082d6d2d9bf616299668fd598e0209d", size = 803462, upload-time = "2026-10-24T18:11:29.269Z" }, + { url = "https://files.pythonhosted.org/packages/a8/f2/ab69009f2dd0d3772d3e07f025fa046b33c60c195e4f2e5f000297d23547/wcwidth-0.9.4-cp315-cp315t-win32.whl", hash = "sha256:9e5090d253f5df99659cddfd3ed90dd21f6ff51989b0421331a63fb2681cbe27", size = 598931, upload-time = "2026-10-24T18:11:41.659Z" }, + { url = "https://files.pythonhosted.org/packages/63/6f/b321f10c2298e7d16cffc1a5f05f3d7e5231b45f9e68af5ee378e23bb2e5/wcwidth-0.9.4-cp315-cp315t-win_amd64.whl", hash = "sha256:12786620375dc83fabf4b2b2aa52416fef2bc6094522ea29c8a53c75b0dfe9b6", size = 603485, upload-time = "2026-10-24T18:11:43.052Z" }, + { url = "https://files.pythonhosted.org/packages/4e/cc/7eeb28059186cae72a770df79e744f232ef068192a5a588b718473e35bb4/wcwidth-0.9.4-cp315-cp315t-win_arm64.whl", hash = "sha256:2cca7b5d0b9d0ae49068d3ce806e965326a987f555b62eaa322223396e10d01b", size = 605198, upload-time = "2026-10-24T18:11:33.75Z" }, + { url = "https://files.pythonhosted.org/packages/6f/0c/309b1813b230d1dbbd6f2c2ab2bb21ef68992358977605d9ef289bbfedcc/wcwidth-0.9.4-py3-none-any.whl", hash = "sha256:901eace6d2dd25ebb917d0ce5db18e5c537e1504c905cf32f0d006c12098b05d", size = 301806, upload-time = "2026-10-24T18:10:52.651Z" }, +] + [[package]] name = "websocket-client" version = "1.9.0" @@ -2088,6 +2725,167 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/34/db/b10e48aa8fff7407e67470363eac595018441cf32d5e1001567a7aeba5d2/websocket_client-1.9.0-py3-none-any.whl", hash = "sha256:af248a825037ef591efbf6ed20cc5faa03d3b47b9e5a2230a529eeee1c1fc3ef", size = 82616, upload-time = "2025-10-07T21:16:34.951Z" }, ] +[[package]] +name = "websockets" +version = "17.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/75/79/590c5f0cc7d1661195aeefccb0e342b79f4c77d368d526d028821a390332/websockets-17.4.tar.gz", hash = "sha256:09d3939b70df0c8ad2da145ebd50978bccaee1d565e838b0e7921a34d38571eb", size = 191391, upload-time = "2026-10-30T15:10:35.873Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/d8/2d4ec550208432538d152a41f0c36dc6728cfae0050c6b1442605456d3bd/websockets-17.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:06ea46717553cdd10f2682126cf7a66e91c8ed17b6969f4a95e94b4e01d06188", size = 218746, upload-time = "2026-10-30T15:06:39.361Z" }, + { url = "https://files.pythonhosted.org/packages/56/99/3090fc0e2e343cc7ee60d532b67a2d413830c8fbb0be9ec3bcfbe3371f2e/websockets-17.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75b32cf33ea40f945f226f97bc1d43151e1a5adff21f420b5e63c468b1a28114", size = 216437, upload-time = "2026-10-30T15:06:41.324Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e9/3d4fb98e5d8aecc7bdbc59c4edf6380fdeddf935445e7f4a205466682991/websockets-17.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b8451f31ae24620cc9372acd2728d87922f2bb0cae3fa57aed68b152844cdf08", size = 216709, upload-time = "2026-10-30T15:06:42.995Z" }, + { url = "https://files.pythonhosted.org/packages/0c/4d/5c7d4f53cc0d7c6f268bbd93865b185e05f65f37f84712a41ab311118f8f/websockets-17.4-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3b76837cd051d8875913f3934b27205f7a592f78b8a4f4a1f3abc36a2420c5bc", size = 225773, upload-time = "2026-10-30T15:06:44.607Z" }, + { url = "https://files.pythonhosted.org/packages/57/70/80f870701f8610e88649d3cd173a0e7ce66433913da3683035a4370063ad/websockets-17.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cebad8f4796248b91fc2168515e507e5cb6b663a32befd09f3b1e7920acdcb1a", size = 226041, upload-time = "2026-10-30T15:06:46.224Z" }, + { url = "https://files.pythonhosted.org/packages/a2/bc/f2e84b5a933c86d52184814d38b0f9d51fc90fd3205cb7af0d9417ebbff2/websockets-17.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:954d43574f72be244b65f0fa61e2f814214b024f2ec849f487aa2f553f7c6e71", size = 227279, upload-time = "2026-10-30T15:06:47.619Z" }, + { url = "https://files.pythonhosted.org/packages/34/7e/4710475f46afbfe5390b4139556aa4fa0692d3d31878a25a1b26e8a6d78a/websockets-17.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b529ad6c81ad21db2f4e3d6e33db78ce3b9f272066b438b5d673361f9282898d", size = 230592, upload-time = "2026-10-30T15:06:49.357Z" }, + { url = "https://files.pythonhosted.org/packages/bd/10/cca6dc2316dd8c3b1a62fbf7f8986926ad8c4b2ae3d3be7888059a96b142/websockets-17.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:799c5a23126c9589cb10b6c6b54f9087246940dad20cd74bf3f06fc9ae3bbab5", size = 227837, upload-time = "2026-10-30T15:06:51.015Z" }, + { url = "https://files.pythonhosted.org/packages/68/21/ac1c3d7781d756bd40fbe501890b54a0205b1f0528a559fdcabcede0bd54/websockets-17.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f01a680d4b66fd15cc7513fae55c673cc8cc340d41340305b7f9a782abdbefed", size = 226613, upload-time = "2026-10-30T15:06:52.556Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a0/bd122578f2765fb3714eeef80bd66074e355ff80e0a6de7fefa10de5f36a/websockets-17.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0e51546a3bedadd80dfa5c2efaed840ac51b8632d8db7f9f502175f5349382a9", size = 223893, upload-time = "2026-10-30T15:06:54.106Z" }, + { url = "https://files.pythonhosted.org/packages/51/50/a5214db6b778995b7fe1bfaab6228ba967cb6fd523d4b7af83154aa0ac66/websockets-17.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6686d29eaafddeeab9e48af92103dc0d26161035faa4be083b8b488f1ab47219", size = 226768, upload-time = "2026-10-30T15:06:55.889Z" }, + { url = "https://files.pythonhosted.org/packages/fb/41/5d62d4889ff8a400cf32c8ad35e58b18e92b0e936db0bae785307cd1b105/websockets-17.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:7b23db4b469d9e051ac74d96db9bf61e27c9054de64f8263fefa32bf72867ba1", size = 225358, upload-time = "2026-10-30T15:06:57.706Z" }, + { url = "https://files.pythonhosted.org/packages/b4/94/c344744fad06ae721a6ec69f728a3dd4bd1b94beb7bb64400a8cd0efc644/websockets-17.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0132e3cbd3f5cfc1ec77588961b302d72a02e2603b82c2c23fd5fb59dc4fa206", size = 226125, upload-time = "2026-10-30T15:06:59.125Z" }, + { url = "https://files.pythonhosted.org/packages/0d/00/90d66792bf1ce315fabe18f838eb2090ebad3425139047ed4c4ad354a90c/websockets-17.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:98f16db5e79f2605194c0f899d0532005bb12269e698bf96f62a5635bcf33010", size = 227169, upload-time = "2026-10-30T15:07:00.687Z" }, + { url = "https://files.pythonhosted.org/packages/24/7f/c069129b20504c35bd22abb276a6562e92dccb69c974ca93021a23fb00ce/websockets-17.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:ee48728a07566c32e097d267f4d4d01b85123c9ae748a42da02185b908cbedc4", size = 224750, upload-time = "2026-10-30T15:07:02.077Z" }, + { url = "https://files.pythonhosted.org/packages/4e/3a/0fcb37d6da690aa2512faadb0e9cb5e1043fff659fd415dc8b518883789e/websockets-17.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2103982762460a764a7ef0021443bb471f46d45ecc6858276e4fe699ebac6b94", size = 225782, upload-time = "2026-10-30T15:07:03.783Z" }, + { url = "https://files.pythonhosted.org/packages/49/61/422745448862b18b8d373347bb73debcd440330f21dd899feac5f920d531/websockets-17.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:648adde345cfd13335342e23cfe94871c7f7f55a43fb254f3b95acb071072968", size = 226021, upload-time = "2026-10-30T15:07:05.237Z" }, + { url = "https://files.pythonhosted.org/packages/96/74/3ea38c6758b497a5d1b7bd953542e9e6446b84aa075a061e9a47e24ceb75/websockets-17.4-cp311-cp311-win32.whl", hash = "sha256:679eef0123861ca381dd8fd9bdc1920e87636ac55eae6cff875c53dcb05fbcf8", size = 219255, upload-time = "2026-10-30T15:07:06.871Z" }, + { url = "https://files.pythonhosted.org/packages/55/66/00ca8b75a634c9fcf70579f9a242b96a7f7a3abeb21a02e2380fff491d2c/websockets-17.4-cp311-cp311-win_amd64.whl", hash = "sha256:e4beaef2f4796558e738e15ca0b8802e35f419a9fa374a978e41706f43c48b26", size = 219556, upload-time = "2026-10-30T15:07:08.538Z" }, + { url = "https://files.pythonhosted.org/packages/4b/7b/c8ccb313439f4803779f186b8133563e6c49c023467a265ae52da7b7e25d/websockets-17.4-cp311-cp311-win_arm64.whl", hash = "sha256:ddab54dc0ec46ed09ef9ac131252cb5740ed21fbe6fc145f3c6fed0b575a8f15", size = 219487, upload-time = "2026-10-30T15:07:09.94Z" }, + { url = "https://files.pythonhosted.org/packages/af/71/b020221345ea6c012dcf7496827a48a744b58696470b2b07fef95a32905a/websockets-17.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3d512e3a6c528c42ce220ed9c3caff83c6fdcd98a1b98249f08ccfc66ad111b1", size = 218779, upload-time = "2026-10-30T15:07:11.522Z" }, + { url = "https://files.pythonhosted.org/packages/8e/84/1c372ae7c032021a84e5c9e9b76b0dddefb354e9b4af783a97efd4d80ab3/websockets-17.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7390e060f830b3d132f484b21ac2783a2d227b682ef62bb8146e1c1b4ca0e45a", size = 216457, upload-time = "2026-10-30T15:07:13Z" }, + { url = "https://files.pythonhosted.org/packages/74/b6/cff249107473f149c6c916a49cba967379fa63b0a7d2dce6896d6848f0a3/websockets-17.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bcad49104711f88b2b7c3ba166de172857d837248205e541b044a552558fecc3", size = 216726, upload-time = "2026-10-30T15:07:14.468Z" }, + { url = "https://files.pythonhosted.org/packages/77/5d/aff8ecbf1c55c4d96f6dacc46a52102895f58b85bb284c8d325aaf31606a/websockets-17.4-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cf99debb17227a50620aee16647bb33a0387f5fa5418d628666c0f05745e0d2a", size = 226043, upload-time = "2026-10-30T15:07:15.937Z" }, + { url = "https://files.pythonhosted.org/packages/cb/18/6229d6583031ca81d092a0cd887a13a57b402fb555acc323d39b45967eb7/websockets-17.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9ae1429ee9e52b139167ed0169757806a27ed7307e942e8c62037a9184e9843b", size = 226321, upload-time = "2026-10-30T15:07:17.563Z" }, + { url = "https://files.pythonhosted.org/packages/b8/61/7aba018fd53873e792a25afe1f4c005518133477b727d7455f2f7550c425/websockets-17.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51adfc30f467077293a6695d8149bcef501c0728386f3a491054f835dadb60b2", size = 227559, upload-time = "2026-10-30T15:07:18.998Z" }, + { url = "https://files.pythonhosted.org/packages/fb/66/37b207df9cdacaa017aa4487f3a9f2fcd668f6f7cfbafdac5b95ea258ee0/websockets-17.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c564d1e6531611bf87078c28780456ecc75459dcca189629fff2fe7c020d8e67", size = 230386, upload-time = "2026-10-30T15:07:20.431Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f6/87507e11fbae53817a435945273953b5b020589e309fac4fd60527ee5999/websockets-17.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4c792e6cce24d08f92199d907785c9e64f74c357deeed3dbaf7d699ed5930b64", size = 228193, upload-time = "2026-10-30T15:07:22.112Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3d/90a04f0aa989b68fbd2efcd38237420afe2abe5a1cab0b5d7c2aa4f0dbb6/websockets-17.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c44776f82b04e623eb9e1b81fcd17ac6e9808ae1ba5cdf8edce1f7c869a95a9b", size = 226952, upload-time = "2026-10-30T15:07:23.643Z" }, + { url = "https://files.pythonhosted.org/packages/ad/3e/50952af22b8e3e2d03f7e83f0e335851c6b484c3fd88586626fb1c2a34b3/websockets-17.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d2636a5b61c69e32db0e74b57073dd4a66f1ad195e9398c5f01bba41090deea", size = 224183, upload-time = "2026-10-30T15:07:25.507Z" }, + { url = "https://files.pythonhosted.org/packages/c4/73/2a4a5d9c6bca1127f24af7bf08f406a69052d7f341bc81f08d9e8eb446b4/websockets-17.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cfbbba4597f19ad717f79fd3f2a67ae7efae647bd6a61e14554e1b5ad242a5bf", size = 226991, upload-time = "2026-10-30T15:07:27.355Z" }, + { url = "https://files.pythonhosted.org/packages/68/de/90d96a579839bfe541ef214315df81d2bd519d952847c303328518ffdd02/websockets-17.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:c7b996c02de5e032cb63dc65482b73693b7ecaa586654126be2749ddea239c40", size = 225600, upload-time = "2026-10-30T15:07:28.973Z" }, + { url = "https://files.pythonhosted.org/packages/91/17/12c15ed446d842e40918cd16e79b56ee4422d6fbf210258cb8882f50bbd5/websockets-17.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a920e99155d75d1b1c08172da8aaa7200e7b30871fb628d1631d7891a333e30e", size = 226366, upload-time = "2026-10-30T15:07:30.472Z" }, + { url = "https://files.pythonhosted.org/packages/9d/73/cb4c927e806a73a0377696e031ef3c0db409028cdb2373f96ee863e8df8e/websockets-17.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8c00c5c49f80a588a2c4f99d519d2abed4ce26cdca11273041bc8b7e60af60de", size = 227470, upload-time = "2026-10-30T15:07:32.122Z" }, + { url = "https://files.pythonhosted.org/packages/33/b3/e682b3ea069933044f4bf4809eea0cd83e3a5bdbdff601d1777a9ae90795/websockets-17.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:52c31d123f5adf14dec694c2a4036bf42c523df7cefc641d31cd05653de56e49", size = 225026, upload-time = "2026-10-30T15:07:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e9/d039757260705e5a265a31c9fff36b0d4567b842ce2b54e5d14369f200bd/websockets-17.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:d0acd8191c0e5a61d1c27bfa33b6ec8431982299f5d71c02129aa4f16f182ad0", size = 226007, upload-time = "2026-10-30T15:07:34.954Z" }, + { url = "https://files.pythonhosted.org/packages/db/e7/cb9907fac6f9b28f93beded6efda2953960cd02b633d432acf3451590859/websockets-17.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2a9cb5bbfc33b4ebd3c8d3714d6e09805437f60a14977774e4bd11b5ace46c23", size = 226286, upload-time = "2026-10-30T15:07:36.292Z" }, + { url = "https://files.pythonhosted.org/packages/39/99/85f6f4dd104a5d9a33a1ef272f501d0f2e8527ddf66be1b383d51f90ce56/websockets-17.4-cp312-cp312-win32.whl", hash = "sha256:c63c0d7832956d5f3bb77888b93c854569d13f806289ff75c43926d25c6e5fd2", size = 219256, upload-time = "2026-10-30T15:07:37.686Z" }, + { url = "https://files.pythonhosted.org/packages/59/31/d1636ba67ee9232a60033d90483e48686aa3856014e59110f29015f97bd2/websockets-17.4-cp312-cp312-win_amd64.whl", hash = "sha256:dde9cd67f18803949ebf96de8aba12b8ec5ee3115e34c75a2db85a3b0a6c20d5", size = 219561, upload-time = "2026-10-30T15:07:39.19Z" }, + { url = "https://files.pythonhosted.org/packages/23/aa/e3859d52188f041a5a05c9f3ac005a9c829723f521f0fe60e2c5f9c93bb9/websockets-17.4-cp312-cp312-win_arm64.whl", hash = "sha256:c634053459278cf31fb404ddb5ecd38124e4609e8b609166da621edc2d5796db", size = 219487, upload-time = "2026-10-30T15:07:41.161Z" }, + { url = "https://files.pythonhosted.org/packages/cd/58/eaf27fce59e3f5b9997cd7c77749ef214e077daeffac95479be6ff9f5cfa/websockets-17.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f24bed98595b9d854da8d6debaf82754abf3e8fe63ec90505ef560566814df7e", size = 218769, upload-time = "2026-10-30T15:07:42.558Z" }, + { url = "https://files.pythonhosted.org/packages/13/8e/287eca6d399a953253492189153976676994dfba1b7e82f0f992d14c1404/websockets-17.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:156221ad7638b5abccefd6f798916bf3f8ffd6ac51480eb4ba5b05df914ccbf3", size = 216454, upload-time = "2026-10-30T15:07:43.874Z" }, + { url = "https://files.pythonhosted.org/packages/b3/65/098fd4d221d691395492fcba88c895dde19a51d371b06b8d0be71d3f781b/websockets-17.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:74e46409666c358b93fce0d8c6f4cb107d8dd7cba1302a38d49adf6fa8193c7e", size = 216715, upload-time = "2026-10-30T15:07:45.409Z" }, + { url = "https://files.pythonhosted.org/packages/e9/29/9f9833bc83c1bf2e5597d1ef374d3ccd6467b9b45400cff399c85331ef6c/websockets-17.4-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e3e80cad85ba68c07c1e8d4ccc9cf51e63bf6a73d6bf631640be947bd72b6b63", size = 226096, upload-time = "2026-10-30T15:07:46.929Z" }, + { url = "https://files.pythonhosted.org/packages/ef/75/6a95f93661bba2f1a4ec82eb26c6d30e6ba253569ecabb7a675139db6051/websockets-17.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:25eb661d8ba7e2b85ebb4e7a1bb9f6a3280910ed10b84330a7abfb5ed32d2764", size = 226382, upload-time = "2026-10-30T15:07:48.332Z" }, + { url = "https://files.pythonhosted.org/packages/80/b0/b0d9427dde0609e2727a9a966fb5fc5c6ef6aa7eba4cfc98791f8b7f1b75/websockets-17.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c74954409ea5789f7a60daa5f94580c00ad0b60b20751c47b35c4784877b5057", size = 227617, upload-time = "2026-10-30T15:07:49.799Z" }, + { url = "https://files.pythonhosted.org/packages/3b/00/fb1016d850d61676d1732434e2361d116c1de369078e59d21f4713115a19/websockets-17.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:47beedf07a706140b50786457e082497ee6b5970c41e49bcd1572ee3f4c73f80", size = 229054, upload-time = "2026-10-30T15:07:51.258Z" }, + { url = "https://files.pythonhosted.org/packages/77/c4/bb666e196541e42237fdb625303ad099005cc835c4e2e0a5d97bb9c4185c/websockets-17.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9e282f35ece8895b9fa5af406fc6a4cb42f01e1009525cf46641de584781c83b", size = 228243, upload-time = "2026-10-30T15:07:52.975Z" }, + { url = "https://files.pythonhosted.org/packages/6d/f1/32ae0f45d8464e1606ef3f6a54318d8754b27889de18bb1b2176a19bea39/websockets-17.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:361f9a21a33191d5287e7a75f508fc3b9bf47aaffb0241198d6b7be3384f294e", size = 226995, upload-time = "2026-10-30T15:07:54.574Z" }, + { url = "https://files.pythonhosted.org/packages/f8/9f/5680151ef10e0bfb6f3bf09a992ce6c3e93bbb84fc8ec5d03ad570ac6532/websockets-17.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4073ab7cefe5a2e7dc368c1f01eb27716dc8ea8f1c69e9b7725ebce05aa53cf7", size = 224244, upload-time = "2026-10-30T15:07:56.158Z" }, + { url = "https://files.pythonhosted.org/packages/e2/66/409117b6882b91960598d62b95fac33d70a7aa2e1e1e854c6b64e76712f6/websockets-17.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a50bd9b44dd9b7b845802030b4d88610c01c7f95571b4cbd3a1aeec17a34c9fd", size = 227058, upload-time = "2026-10-30T15:07:57.539Z" }, + { url = "https://files.pythonhosted.org/packages/35/e6/34cab5913bea9d011ae2592a7672340179ff14fb98e889e5e41b071d8134/websockets-17.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:ad2e9e152bec6c4f7e4cdb4adcea6b708400090eec04bfe5ee5b30d368ffd721", size = 225654, upload-time = "2026-10-30T15:07:59.044Z" }, + { url = "https://files.pythonhosted.org/packages/a6/b0/6cfe18e12f23618a3d69723c828037c1282fee7ffce006ae7b5cc0e58ca4/websockets-17.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5830f94a7190a33e55d06d89242ea951ee2009c3a27fc31538f3ac9386b27edd", size = 226425, upload-time = "2026-10-30T15:08:00.492Z" }, + { url = "https://files.pythonhosted.org/packages/c9/71/14d31ea34bafc07c6d96b362a44b301b9a0f2fb260490a8a6cb7db682bc4/websockets-17.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c0cc2cb47face4dae64bd70a9268dbebddb3e48c1b48cf6d7b6ac1471609fd88", size = 227532, upload-time = "2026-10-30T15:08:01.932Z" }, + { url = "https://files.pythonhosted.org/packages/28/69/df3398ca1320a8b76e57ee41053d5c09955383cf60888ffa5771f51a4cc8/websockets-17.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:d0b6a9bd86f865ebc9d847a1eb0a655a0e2b447cbcde743dda97c4298415cc0b", size = 225090, upload-time = "2026-10-30T15:08:03.328Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/06afe778cf9893e9ac10209c0d4c70aaf0b72289245a8b7efb92cc80927c/websockets-17.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:7a7e9321822ca59ba56fa8744c3e3f01ef74d547aafe0d383d000d7a4d11eb79", size = 226041, upload-time = "2026-10-30T15:08:04.714Z" }, + { url = "https://files.pythonhosted.org/packages/c6/7a/28e9822dbf0bc63341dc45d8d5f1f1f7f375991fc8895bc731105fbde371/websockets-17.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:de29795f23833cdfb68ba45c8a5cc0ec49778ea5deb670188f4465bba5930d25", size = 226323, upload-time = "2026-10-30T15:08:06.103Z" }, + { url = "https://files.pythonhosted.org/packages/5a/d8/606c9c404e82731e4520f6397c8c16549e9cbd39ac583e7ea7d8972a6ae7/websockets-17.4-cp313-cp313-win32.whl", hash = "sha256:37ed7782972545e67d97ef9a172e9499d25459b1e32cb99d1c2a30c572f2441b", size = 219248, upload-time = "2026-10-30T15:08:07.617Z" }, + { url = "https://files.pythonhosted.org/packages/60/a1/17e507dadbfccb755758ba977b165fec92924dfc4a8d2573b4fc1561b0cd/websockets-17.4-cp313-cp313-win_amd64.whl", hash = "sha256:203e42eb77e06f85778a908b34c5ad032f34e98a68ef33920d6685c1e65a9420", size = 219560, upload-time = "2026-10-30T15:08:09.108Z" }, + { url = "https://files.pythonhosted.org/packages/01/ba/4f51fe8db73889ea3ecfdeee283d4ac3b7ad7a609c0e4c1fc6de04078021/websockets-17.4-cp313-cp313-win_arm64.whl", hash = "sha256:d8255971f6789cf0cb365e3e22b9b166eba978548a26241eaa5b7af0440d885a", size = 219496, upload-time = "2026-10-30T15:08:10.574Z" }, + { url = "https://files.pythonhosted.org/packages/1f/5b/085530961668661300de7248f9bf3ba84e98f47875f0fcc87637d024f82b/websockets-17.4-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:d0f943b53bb1d7389d72a5380078670e5fcc34a1328142148b72d20fd82031c7", size = 218810, upload-time = "2026-10-30T15:08:12.14Z" }, + { url = "https://files.pythonhosted.org/packages/f2/fb/5a29e9569f74988822b7bc076287dd7f9f5b68a2070cf5eb4cfada5863d8/websockets-17.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2fd562372d4afaf18d1c7f1c68e39bd32818bb16d5f57f778a4a4ed88eedcaae", size = 216506, upload-time = "2026-10-30T15:08:13.561Z" }, + { url = "https://files.pythonhosted.org/packages/df/73/eb8544367c13cd87df39d41b74853741fb7182e2a4bb659ad7d36f9066c8/websockets-17.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a0457561e8a87a6a3b509e21c35084d7d207ced262139de3f738e9676a476bbd", size = 216719, upload-time = "2026-10-30T15:08:15.08Z" }, + { url = "https://files.pythonhosted.org/packages/24/fe/c3707e426d9bd779dfad9f319b2b431e5e60d563d7547d3780cbd1646028/websockets-17.4-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7b4ee34acefa9ba1333f02b817982f1e4127f6f9b975017a707c4e738d7f9fb9", size = 226098, upload-time = "2026-10-30T15:08:16.581Z" }, + { url = "https://files.pythonhosted.org/packages/c1/24/d203439f909ffbf37260ca28a3432381412d2e79912ebf98be572e63055e/websockets-17.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ef03fb4b3685df0ed9dc6a074a090f030345cad2c23c61818da3e08e693a9caa", size = 226449, upload-time = "2026-10-30T15:08:18.29Z" }, + { url = "https://files.pythonhosted.org/packages/4b/17/3ae5d9486a170a222dd0437b4f2bc02ecf324177498a942dcac200e65d05/websockets-17.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c5e970d3996c597186c9dbb6e77a8048737a834ac03cb13186a54999e0e1c31e", size = 227695, upload-time = "2026-10-30T15:08:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/34/37/1307a8e30a961726f2350982fc01b0b3498db29b030c78c566e65ba64487/websockets-17.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6afc32a7a1a40b071070419537df3559d26907086556769683fa97b7b6e90fd5", size = 229069, upload-time = "2026-10-30T15:08:21.682Z" }, + { url = "https://files.pythonhosted.org/packages/9c/bd/4c6167744e202d20a3c770bcde8fae5d427317b1885712c2e02718cd8133/websockets-17.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5da7f7f1ecf866186f195f7ecc374c915e1838496b86f2f3b41da27c798a25c3", size = 228296, upload-time = "2026-10-30T15:08:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/14/b3/3438eee41b39afb44c3c6e45dd686b88a7f8d742b96877b77de4fe0e0255/websockets-17.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:043945a43873c7c11a3f75238d475c95f902e967de329eb8763704546cfaa6b6", size = 227045, upload-time = "2026-10-30T15:08:24.749Z" }, + { url = "https://files.pythonhosted.org/packages/46/39/0bac9052d402efaad1b202ff2f1a57b6334aa624d20f509312765601b507/websockets-17.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:927d602fb8fb595a69e6b1ae998a6ec19851d0fb9391759456e6425090996647", size = 224297, upload-time = "2026-10-30T15:08:26.275Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7f/5809f6ba5a7d1065301800daf605bdb661a9db5ef868ed189dbf691122ac/websockets-17.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:769e4f7b090e10cae4c082e3e39b9458ec2444505df84953c16c0468b16539c4", size = 227169, upload-time = "2026-10-30T15:08:27.703Z" }, + { url = "https://files.pythonhosted.org/packages/fc/f7/c8f6771e7cc2a038cf78bb12d04d29dbbbabf2a84d76999bcc94532f3020/websockets-17.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:03ddf4eb76ced8725dcbb000ff60b0fb8d7330ed011f6dc725a1925c5fe02051", size = 225632, upload-time = "2026-10-30T15:08:29.441Z" }, + { url = "https://files.pythonhosted.org/packages/2c/2f/9104786d952978ca2d011321109e35c05be24c3937ef2a62b4d6e25f7515/websockets-17.4-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:94622cf24e80d03054ceb69a06a86c950e12fe993ed06b933f7895232cacbc3e", size = 226415, upload-time = "2026-10-30T15:08:30.962Z" }, + { url = "https://files.pythonhosted.org/packages/ae/a7/2e1606b3d616b86bb6c70a62d5f87fc9a3dbd81f0bbe24c4706ace76751d/websockets-17.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:bc581579885728bb54ef15000295c20e6a64a200b1b73d5cfca71879a3eb3e1f", size = 227594, upload-time = "2026-10-30T15:08:32.443Z" }, + { url = "https://files.pythonhosted.org/packages/67/2d/78ca44e2be6d397aee63a4e68d3a99a33bb14bb3405e94688bc5a2160db5/websockets-17.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:f42671900e0b602d05a074c52fd3d757c2f8e5c4f73f771794dae1aa4aea5f0e", size = 225146, upload-time = "2026-10-30T15:08:33.888Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b6/6dad684e54fc8e09d70c9a095506db5c836207d8e846e3cb1e79424e3492/websockets-17.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:2b23dacf7a8a88afe92f77bcdbf4cf043a84692bac2f2da02f4011c687e19b48", size = 226095, upload-time = "2026-10-30T15:08:35.285Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e5/7b04bad7c11c1f92238429352defbac1406743338049afe1328c7a7f95c0/websockets-17.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d48795c7d64ca1c42e3d61fcc6478cb15a19b6ad3f9c882bc8d8dee49d4a420f", size = 226395, upload-time = "2026-10-30T15:08:36.8Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/4eb29c4b12f77b3139470063308ae1e6a0860b9073b1d27d56e8ce19c512/websockets-17.4-cp314-cp314-win32.whl", hash = "sha256:8588edf317fbe4f16a949bc5a6ccdd22b6e6fd5b4745d128bc40bccf31024ce5", size = 218784, upload-time = "2026-10-30T15:08:38.263Z" }, + { url = "https://files.pythonhosted.org/packages/6d/85/2496a24de80c215b55a15f037bc368a2ed0ce7ecb1e909039ff4e76395de/websockets-17.4-cp314-cp314-win_amd64.whl", hash = "sha256:70293c25d79d1f084fdd665894481547575e429d2a75e8d72caec2f6b6b07af8", size = 219137, upload-time = "2026-10-30T15:08:40.112Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a3/cfe95d4eb569035e5a1d2e5cbeb4ccf0eb15a19e1ef2ad819a85960bf375/websockets-17.4-cp314-cp314-win_arm64.whl", hash = "sha256:adc30e5d064c9e33049e825408fa4e952f4e8a0cf4c329dc2ded72e1bb5bae08", size = 219017, upload-time = "2026-10-30T15:08:41.778Z" }, + { url = "https://files.pythonhosted.org/packages/2b/dd/4143048a2b27303e7de8ef53d7d0ee3987734fbf93e09491d5a1b0a55187/websockets-17.4-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:bbb6bed49f083e2ec8ae0bb21c00c7c5171ab8e08a8b008c61a43fc6c944fdac", size = 219141, upload-time = "2026-10-30T15:08:43.184Z" }, + { url = "https://files.pythonhosted.org/packages/a8/3e/a63b5f3a5c24be2898eb22a3093a56d4ac4cd24ae79e7ab7a1b971ed4611/websockets-17.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c7a56140fcbf4662cb263754a754c651a16fe2196cae1fd232d18f89acd30c83", size = 216675, upload-time = "2026-10-30T15:08:44.682Z" }, + { url = "https://files.pythonhosted.org/packages/d6/80/f238a10f0b23853c665c602a42784023995ac26674e480252c21af39f4f8/websockets-17.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:18d3710becc612ec6f0229425bd6495133dfcbf30f7b6569585acc8ed2f1b452", size = 216880, upload-time = "2026-10-30T15:08:46.304Z" }, + { url = "https://files.pythonhosted.org/packages/d1/b1/899b69aba1e8d65ac5bfe90b97ada22a815f1dcd3840bf188104738aac33/websockets-17.4-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:00ad98e4bb0df7a6711c645eec16d5a9fdf99f0692bd4f5b6cb85a68677ba8df", size = 226462, upload-time = "2026-10-30T15:08:47.723Z" }, + { url = "https://files.pythonhosted.org/packages/28/a8/598c2b2a22dfe14d352400df804db8b78a68c1498b3f775a658f07f21618/websockets-17.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7849a096d6fdba3f2bdf849eb89f2d233a24400c92faa3efb25fa8dc615b706c", size = 226741, upload-time = "2026-10-30T15:08:49.314Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ad/84a6de3cc3dd4ee336428c31f89a82e002299f83e10d967f0e9a5cbaf591/websockets-17.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e30550965c78223439815dbdf40c93eb8931dfbf12427110dcfcaeebef76feb6", size = 227914, upload-time = "2026-10-30T15:08:50.746Z" }, + { url = "https://files.pythonhosted.org/packages/69/ab/1e191b97d60a934c071b7b73c39c5db39721a925cc53acd929c615f85550/websockets-17.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:725be1aff55f1c873a79cea0f612df9dff21a9d2c2e05783665b824b8aa7c24e", size = 230059, upload-time = "2026-10-30T15:08:52.596Z" }, + { url = "https://files.pythonhosted.org/packages/f2/57/ef8a64732ef4367091ab05f9b22c1ee4c28657d4a0d088a644198eb5ded6/websockets-17.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b6c7f91520c29420639925fd1cecceac9ca07366b50c09ea24eac1cd116b4866", size = 228486, upload-time = "2026-10-30T15:08:53.967Z" }, + { url = "https://files.pythonhosted.org/packages/48/1f/dbad3afcacf2c52d1fdf83b611d849598f0a047d7333ff476266532877b8/websockets-17.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6531540aa63e6864cb0615a3a5da70ae03191334507852a5385320bb7916df3f", size = 227216, upload-time = "2026-10-30T15:08:55.687Z" }, + { url = "https://files.pythonhosted.org/packages/5b/47/59e325d6ca3e04ba5cc7a139d891ef83cad3fb460a183c8f359f378b69a9/websockets-17.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0a57b99f2e28922b5a2434317580fd23fdf118caff4c5b752f5452836426205a", size = 224755, upload-time = "2026-10-30T15:08:57.203Z" }, + { url = "https://files.pythonhosted.org/packages/b8/b6/28a471318dfb0060b58c47d0a252cb5078528a1aa1fdf5e6e88e2a61cf18/websockets-17.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8fd30d217a4275107667fe1d4f601e2d50c797d0727148cfbb384536d65f04d3", size = 227508, upload-time = "2026-10-30T15:08:58.597Z" }, + { url = "https://files.pythonhosted.org/packages/ee/29/7485ac6fc4b342b43964811381f56276fec967cae6a851ae4b815613b10c/websockets-17.4-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cc0cd4065a65ac98f3e2742ee9f314da9d224db49b07dc17d3a20cef0d79658d", size = 225961, upload-time = "2026-10-30T15:09:00.414Z" }, + { url = "https://files.pythonhosted.org/packages/95/a6/520e1f7aa9644ddf58f5a51fc37f46e15293a68cd35b70d5b81b7331ca1e/websockets-17.4-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:71f76bb8e59be847330b8a8d3753f85397677e128f9f9692c215f8cf721cefc7", size = 226851, upload-time = "2026-10-30T15:09:01.979Z" }, + { url = "https://files.pythonhosted.org/packages/e5/0d/444799abe7418f361da8c201c6858b64b4e8d47265f90851e5cb68b4d90f/websockets-17.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:c2db7b9e2d726f7e051bedb67abcf460b84b11437b2f9fdacda7e6931dace85b", size = 227869, upload-time = "2026-10-30T15:09:03.405Z" }, + { url = "https://files.pythonhosted.org/packages/cb/86/6da20322a07364a0ab0787a2b0d4367770f59404fdab6e35122413a7f63e/websockets-17.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:332b88022d0acd47c44158bcd43f47f14eaddcd979247f242b1a33291c45cdd1", size = 225562, upload-time = "2026-10-30T15:09:04.891Z" }, + { url = "https://files.pythonhosted.org/packages/2a/da/53e44d96238dc207011ad5d93b0540c58e1c680a86f48dc3fa8e5138b343/websockets-17.4-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:5cec3e7fbc911ff4fcf43b24aaf1b96906381ad36030f42897def3ff4b78729e", size = 226334, upload-time = "2026-10-30T15:09:06.42Z" }, + { url = "https://files.pythonhosted.org/packages/18/08/82cea972a87f229ee1903e9adf74c17d1e6c4371d581ebb11ccbed4e3a7b/websockets-17.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cbdf4b42f4514422051889424fd03bc269be8c5d751bf39ec29ad761590bd10d", size = 226767, upload-time = "2026-10-30T15:09:07.837Z" }, + { url = "https://files.pythonhosted.org/packages/96/f3/ee6afff802e39e8d6ef29ee4bdc30f8272aaa38295c19a911fad91fe95fc/websockets-17.4-cp314-cp314t-win32.whl", hash = "sha256:16550e24ac22c27e0a728100d8de196b5f054bab6748ef9f0b168fb8b3c32e35", size = 218918, upload-time = "2026-10-30T15:09:09.31Z" }, + { url = "https://files.pythonhosted.org/packages/11/56/b0b07917f9c85a4d24a37300f4ae888bfa7c20f08902dd6a5c61a0d1b26f/websockets-17.4-cp314-cp314t-win_amd64.whl", hash = "sha256:5ec906bb21b35e66cfdcc2ea0133f249f52b7d89e3e45ec8d2bd2d84a0255d7d", size = 219260, upload-time = "2026-10-30T15:09:10.832Z" }, + { url = "https://files.pythonhosted.org/packages/19/a6/a63113909ea602d3d22b0f32a7a9950d8d18b725cfdce735eab9b5f5d198/websockets-17.4-cp314-cp314t-win_arm64.whl", hash = "sha256:c00f0c45851a2c61efffd03dde8fb4d594026b5cc18196c94e15460f1225f2ed", size = 219176, upload-time = "2026-10-30T15:09:12.444Z" }, + { url = "https://files.pythonhosted.org/packages/ee/be/4032fde05e62d1c52edd250fda475e910cac0cd180e377690bff24147b5e/websockets-17.4-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:8c51ac7b31578a7275650f580aac985940985b6d2e57247ac6d5e07f2c936cd6", size = 218740, upload-time = "2026-10-30T15:09:13.833Z" }, + { url = "https://files.pythonhosted.org/packages/74/1c/b47f5786eb45599072411571651606fb22f6e825d522d627daad974ea636/websockets-17.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:023dc13bdc42a55e152acc81c39c90ec6cc4159ed17d23c6d73460fa2a73ab16", size = 216470, upload-time = "2026-10-30T15:09:15.394Z" }, + { url = "https://files.pythonhosted.org/packages/70/98/0021f55de633617b4a8390cca17e700c9ba5d99323103128412dc2c15aca/websockets-17.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6fd8cac4907fec8302726d49e6969acfffaf720bc39b1cee23f473b81f4dce01", size = 216695, upload-time = "2026-10-30T15:09:17.185Z" }, + { url = "https://files.pythonhosted.org/packages/28/56/2c67389b47c4b9e9e9318d9b3e4bb52a2fef3749ff00b0b151a342c4d42d/websockets-17.4-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4441d655a53185ef1b01b1d42ad9b3a96b905110a9219043e3fdaec855ba3b6e", size = 226134, upload-time = "2026-10-30T15:09:19.156Z" }, + { url = "https://files.pythonhosted.org/packages/75/bd/ee3a679a10741a0cdd7aa8bdd6d03999069672826aa7a6495fdf589ed961/websockets-17.4-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3acc45494c08a4d27375a2c28474537f68910219f42624a08011221b04623d04", size = 226569, upload-time = "2026-10-30T15:09:20.587Z" }, + { url = "https://files.pythonhosted.org/packages/c4/42/b293a5d07099549797138d09fda5bf878d302b4980e61678981c8dfdc98f/websockets-17.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3b78b39377630a70aa2198e5f03be416e690364a046b1d8af80a9263733083d0", size = 227726, upload-time = "2026-10-30T15:09:22.015Z" }, + { url = "https://files.pythonhosted.org/packages/2d/81/d048ff83c4d0fc386f6008529d12690d0dcb410f73570430f13fe4d543f0/websockets-17.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6cf4c002268da5c11cae9083aec71ac943bce9d95e0f83c8bf9a95a3ce421fbb", size = 229426, upload-time = "2026-10-30T15:09:23.444Z" }, + { url = "https://files.pythonhosted.org/packages/e6/21/1df51f94047dfb76c32fd7508036e4b55352d0f04fd0e3bee525a2122225/websockets-17.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ed7fe197b8bb66eef4f62c052e33752d456d2fdda74805469d4bd954950ab339", size = 228211, upload-time = "2026-10-30T15:09:24.902Z" }, + { url = "https://files.pythonhosted.org/packages/cf/13/33d6a28471da4c30a98a2313c76f984be2056a703c5c532225dc28f5dba3/websockets-17.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f0494d3d97502e270282cc6a1f8648cd7335b4fe8d5c452006e5b7f9d62b8892", size = 227106, upload-time = "2026-10-30T15:09:26.315Z" }, + { url = "https://files.pythonhosted.org/packages/4a/86/ff8441e56ca677e51f9c826868fccde2a82bafe0ffa337fd38823b64253a/websockets-17.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ab9e4bd60796866c578e3afa0a17c98636887827a39c2e238a61989c18fd8e7b", size = 224499, upload-time = "2026-10-30T15:09:28.116Z" }, + { url = "https://files.pythonhosted.org/packages/da/91/470d7a619ce4aa837ff5b6a5836227c43bdfdc42ef837cce48f508992438/websockets-17.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:8d148b4b295224d3a19e7bd9f02ebe7344de254b3b2c4d0628ce42ade0bca119", size = 227213, upload-time = "2026-10-30T15:09:29.847Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ba/55ed1422d6c73b5b81996ca195f2a256a339b26c553f5686afc2a926bc2b/websockets-17.4-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:6597a1f7413189b4bc58437babcdf39b79da416e5c477ae98323a88ecc108188", size = 225876, upload-time = "2026-10-30T15:09:31.249Z" }, + { url = "https://files.pythonhosted.org/packages/e9/59/f133d260e7a48d3e231c3a495eeb6114b880c1e96bfc781a949c1f73991c/websockets-17.4-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:a9b0026538719f7a532998d84640ab2e91ca1a051ce4b8d924fdcb607307e921", size = 226403, upload-time = "2026-10-30T15:09:33.199Z" }, + { url = "https://files.pythonhosted.org/packages/45/16/bb3355453ffdc31d3a14ddc0b50e058f13a97d2ed019ba6c380e03456169/websockets-17.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:a703f23ca15a51251fc94f1774683f5aa511588a7ad6bbb83960cdb2a4dcd978", size = 227558, upload-time = "2026-10-30T15:09:34.703Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/f3d55a83c2a4daa8bf62594b00a721dc8767518ccb833f932b0178eb6c19/websockets-17.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:6b061ea7ca94966af7cd7a87cb189ff15972c103244611a2b1e8408c04f1dbe6", size = 225369, upload-time = "2026-10-30T15:09:36.204Z" }, + { url = "https://files.pythonhosted.org/packages/88/66/3a320bfb718d9ae1eff15ba7790979c0e6fdec74e388430f426e6647d7f4/websockets-17.4-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:e6d2a185ec4ff0478089305abd833da3a9fda8803eb77325b89ebeae5585a3b7", size = 226268, upload-time = "2026-10-30T15:09:37.565Z" }, + { url = "https://files.pythonhosted.org/packages/da/ee/1f9cdeeaaa2d5e158b7a40f971e74b641b35f977674b46229a5bb14e270a/websockets-17.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:9a4e95d56994a45ac76541853796720436ffe462957d0b1b89e87ff3d3b1627e", size = 226530, upload-time = "2026-10-30T15:09:39.171Z" }, + { url = "https://files.pythonhosted.org/packages/da/28/506406ef09e6e168796f0187bdac0767f38a560e6785c4ee26e583aaaf76/websockets-17.4-cp315-cp315-win32.whl", hash = "sha256:b7ea61af293a153f2d67430038cf0efc10140caa623f2bdf5a9f5a457ff20f57", size = 218751, upload-time = "2026-10-30T15:09:40.748Z" }, + { url = "https://files.pythonhosted.org/packages/25/a6/818647a9a9b3ee8bf131e9ab4fa1f2db9c6539f08e7084dd57549e0bd49d/websockets-17.4-cp315-cp315-win_amd64.whl", hash = "sha256:8b45d40f07081b377f0b837ddbfba4a9ab4a89a7b569d3c095436564e767a27b", size = 219045, upload-time = "2026-10-30T15:09:42.251Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b2/0338a9abec3df8556627af987352657ce1c8456f2060b54741570b174122/websockets-17.4-cp315-cp315-win_arm64.whl", hash = "sha256:29b615c2d5dd883f89c107a782681b73a7aa8b2bd894130310e45eb09b143913", size = 218957, upload-time = "2026-10-30T15:09:43.866Z" }, + { url = "https://files.pythonhosted.org/packages/68/92/22e83d003cdbd22be5d35e28c260203e9fbb6c73b17a8e1509f4ad49e74d/websockets-17.4-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:c568e72f5425a74616daeb824afe28da460cbeea036432f41c6af5380b83300d", size = 219056, upload-time = "2026-10-30T15:09:45.528Z" }, + { url = "https://files.pythonhosted.org/packages/2f/ca/071d38e7237f6ada4f577b74f7cbf5bc2ff7e1f9360ebd2837e74a22dfd4/websockets-17.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:bfc86dff091104eec770c29ea1831dbe191968a70aa2d8ae8eda3240d863970a", size = 216630, upload-time = "2026-10-30T15:09:46.951Z" }, + { url = "https://files.pythonhosted.org/packages/fa/76/22d4523f92d88b8f5ebfd3df7ab5e825146af100f7e2caeae7d359ae51ea/websockets-17.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:f5f06f59e19aa0770aaf651ce91c196fa620b35aed49a7e6c36e7335f3f83db7", size = 216841, upload-time = "2026-10-30T15:09:48.285Z" }, + { url = "https://files.pythonhosted.org/packages/87/29/bc94be4a8bc19ef518e9efecd90a992f2991b7cfc6eb8a7430c4e2dc097c/websockets-17.4-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8f32a6cb0b101170abc2d8053af1473a2a29ef2a06d7130994ee8455a50f5dbf", size = 226992, upload-time = "2026-10-30T15:09:49.776Z" }, + { url = "https://files.pythonhosted.org/packages/fa/25/58f69b5fec064764ddf5b88045397433cdb028f5b17c82fbe047fd31fff7/websockets-17.4-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:72d0a731eccf482d5661c6711abfcd5921f3dbfbbb0789061e1918ef4bc89c70", size = 227258, upload-time = "2026-10-30T15:09:51.172Z" }, + { url = "https://files.pythonhosted.org/packages/21/7c/bc932a54c5f1bd78461574aea539fc562fd2de494738a2c0675c4de860be/websockets-17.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:48c83103f82fce36191a9e3a8a80731d4340e2da544eae8c5aaaf6a45280e7d0", size = 228589, upload-time = "2026-10-30T15:09:52.628Z" }, + { url = "https://files.pythonhosted.org/packages/c4/92/57ec83066d0bfa8a9b9f594bc61951073c4a86e34c562a5292604118dab6/websockets-17.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c8052c3058c402d53602583da5ddcf1a15a63ab1efe0222f47c7be59944e6463", size = 230217, upload-time = "2026-10-30T15:09:54.058Z" }, + { url = "https://files.pythonhosted.org/packages/6e/fc/0f2fe533b5b4dc22ac704b3357f5c99fa60a3837218b3c6c6ad63a60120e/websockets-17.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0c22a9c6b2349204f56123dd0ca7779e989d68e336d0dc02ad823485d44925de", size = 229026, upload-time = "2026-10-30T15:09:55.727Z" }, + { url = "https://files.pythonhosted.org/packages/7c/cc/ed28307835106a9a2dbd1a5efc597e8befa3d0a5f2b46a4c1e466b2f4759/websockets-17.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0dcce83837328e6795225ead920d3aa8d867cc9d6922aa558b0e9111599fdbb9", size = 227904, upload-time = "2026-10-30T15:09:57.221Z" }, + { url = "https://files.pythonhosted.org/packages/39/4d/24ad7deddc7b31c3e430acc1c00c7b384ae42f1f973e9cc01aa42d19628f/websockets-17.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4b79ea31cf277c72d2307c6cb8bd32a2c151959e80a2f24fa85df620c5f2860c", size = 225253, upload-time = "2026-10-30T15:09:58.624Z" }, + { url = "https://files.pythonhosted.org/packages/93/f6/9c92230ebfab42fee482b236c45c32ed34b24f7360080b400cce6cfcac11/websockets-17.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:3d27153a0413696767b98b5d96173a2a7e27cbfca02000a6069cea7b977765a7", size = 228089, upload-time = "2026-10-30T15:10:00.308Z" }, + { url = "https://files.pythonhosted.org/packages/fe/7a/f523830e562da9b1d7a610174752753720c5e47e84b59b5fc47721d416bd/websockets-17.4-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:e0feb03a338f8f5e819ae23a73aabb7b46fd3b73f15f7df782dd12d99e2b02ad", size = 226743, upload-time = "2026-10-30T15:10:01.744Z" }, + { url = "https://files.pythonhosted.org/packages/2c/e6/d1a56495cb7b1a0a4688145131be38cfd0c1342bde8125e136a6e6ee494e/websockets-17.4-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:9ff89e36451a19775e7556d95ebfa4a0b24b84cc87565d6b5d0ec8ea82bf3f2c", size = 227237, upload-time = "2026-10-30T15:10:03.417Z" }, + { url = "https://files.pythonhosted.org/packages/44/41/c4e53f7ad63838d7eba6e82c5d743827e91dafe5e48c88a58f7e90043945/websockets-17.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:ee6c4e0085bff5f6621bf9c53452584dcb91ebd993ce841e1f4061ac12b6b556", size = 228348, upload-time = "2026-10-30T15:10:05.149Z" }, + { url = "https://files.pythonhosted.org/packages/ca/01/f6f78c3edeb8ad2b3c35a8c4117ec2cf9346215afaed8155af1e7933818b/websockets-17.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:1962f3bfde085af18878f1bb1aafb300c9a6ac33da886d0b0d97e33c9ce7a222", size = 226099, upload-time = "2026-10-30T15:10:06.588Z" }, + { url = "https://files.pythonhosted.org/packages/8d/01/d8c11740231b63d1aba6bad6b1d4e72e8384b26c5448801da238ebe82c92/websockets-17.4-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:42d7a6e818214336cf7af9a3aae5c6923f94f09fa07ac5aab98268ba2a98a6d5", size = 226956, upload-time = "2026-10-30T15:10:08.141Z" }, + { url = "https://files.pythonhosted.org/packages/99/87/dbfd43ae01ea8fdb7478a1b3d58b32aca83bb9c4aa61ebe187d1e188ac8e/websockets-17.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:c9f8fdb7bbefc4907c2bb3593f810f2b67a2d5329e1d38724a1aa3d763cf63eb", size = 227253, upload-time = "2026-10-30T15:10:09.533Z" }, + { url = "https://files.pythonhosted.org/packages/bf/8e/fbd968a75428063560ada02d564de8d6c49ca34ec29dfb78e5d900f4b0ef/websockets-17.4-cp315-cp315t-win32.whl", hash = "sha256:506623128d7a55b726a5a46e4c9a8eae4c9dd0f04ff60b041fe7df85b9d034fe", size = 218877, upload-time = "2026-10-30T15:10:10.925Z" }, + { url = "https://files.pythonhosted.org/packages/f9/53/8f37a3943517bba77fc86f7c4162c455018c5b6d760c5e9c9a11de9e37f7/websockets-17.4-cp315-cp315t-win_amd64.whl", hash = "sha256:6e6558efbb256b532c9f06a21ba42bcac729718e365c505819f181f25e5c0eca", size = 219195, upload-time = "2026-10-30T15:10:12.336Z" }, + { url = "https://files.pythonhosted.org/packages/69/35/cf33cba7248fcd80cfe5911ffe67aa2637f50c2bfaada123b1e9d2aeca90/websockets-17.4-cp315-cp315t-win_arm64.whl", hash = "sha256:fcac44d917672ad6257ad64b80b5168306f168a78cab5c0612e4c699caed18cf", size = 219117, upload-time = "2026-10-30T15:10:13.771Z" }, + { url = "https://files.pythonhosted.org/packages/a0/80/78c580302991d229ac5ad0a00c361916f7f84deaf6dd76370034dd8e7383/websockets-17.4-pp311-pypy311_pp80-macosx_10_15_x86_64.whl", hash = "sha256:73b00645316121105274fd266ed54a20e6514650126d399cdea39876ab1e7b04", size = 216364, upload-time = "2026-10-30T15:10:15.472Z" }, + { url = "https://files.pythonhosted.org/packages/d9/27/7d18d381994c7c27a855131ae064ff43ec00ded636b7c6ead4abb4cec841/websockets-17.4-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:02f380df26de14999ecace203fe1396ac14d1c6132afc7924eb6f8c8b646c69d", size = 216642, upload-time = "2026-10-30T15:10:17.153Z" }, + { url = "https://files.pythonhosted.org/packages/fc/91/43e73997fbdc7ef3cb434148888329113a07b66d97a8ea6aa2f93e574028/websockets-17.4-pp311-pypy311_pp80-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f5b1d315a615cec81a79e2ce3a94221dc5c23e7fd4012897085d3b5e5a5638d0", size = 217587, upload-time = "2026-10-30T15:10:19.123Z" }, + { url = "https://files.pythonhosted.org/packages/a8/17/5e3e6be945512aff7351c9f60134803902ccb07cd7d6c9becdfa349a32d5/websockets-17.4-pp311-pypy311_pp80-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:046ed16d3d83d64594e4a40655fef061ccf36059d8c30a01feca8a9481fe13b8", size = 217478, upload-time = "2026-10-30T15:10:20.665Z" }, + { url = "https://files.pythonhosted.org/packages/7d/5f/0a1ee98aeff04c200492a479a386ff106d1ef6d5c9d6613959b3e3d79469/websockets-17.4-pp311-pypy311_pp80-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f772007dfba8941873dbd276b6a6845428cc740888b5c6c37bf483b1ea34b42", size = 218371, upload-time = "2026-10-30T15:10:22.35Z" }, + { url = "https://files.pythonhosted.org/packages/17/97/acb333fa9a54bb1ad616c1add65185f9ab580c3c76366a3d1abc1090979b/websockets-17.4-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:accb5e9492b9bc9c9aeec5b72ea8f2ddcbefc6143d1c626fba960ecbdc89807e", size = 306811, upload-time = "2026-10-30T15:10:23.76Z" }, + { url = "https://files.pythonhosted.org/packages/e9/a3/d8fbc72c5c0e78905caf2d6dcf806e532451e3f48e2a09a8ebe1de9ad412/websockets-17.4-pp312-pypy312_pp80-macosx_10_15_x86_64.whl", hash = "sha256:c7f66a53e9b7ec831abb15e3d9b6cee8f52d6a24cd0a374786bf46c3ec218bc6", size = 216397, upload-time = "2026-10-30T15:10:25.255Z" }, + { url = "https://files.pythonhosted.org/packages/d3/de/1bf313cd0f4662df4884a7602932cd13347090e59dd6047865eee2bb5aa5/websockets-17.4-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:4fb2db1f649b6464711846b5bb9c1611bd906ce939d9460cbd1fa419552cd6c3", size = 216664, upload-time = "2026-10-30T15:10:27.016Z" }, + { url = "https://files.pythonhosted.org/packages/30/e2/7912bd417511b54907853bd495aef2daee111062dbafd43d133a3f7253a7/websockets-17.4-pp312-pypy312_pp80-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:32110d954d9d0e51f36edb0396673bf4d35193a0a80ba7013bf7f7d58a33ca07", size = 217603, upload-time = "2026-10-30T15:10:28.475Z" }, + { url = "https://files.pythonhosted.org/packages/56/6f/2e8d5610f6184a2e1720bf8ce256402ed99ad30ea87c461fba5bc4d651d9/websockets-17.4-pp312-pypy312_pp80-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:88ba8a439b2bad97bb69c38db5bf0ec16a061ee834cf0f244089186ee803e899", size = 217489, upload-time = "2026-10-30T15:10:29.999Z" }, + { url = "https://files.pythonhosted.org/packages/29/3a/a05bc57eadcd7e8e072d917888128e6d22e1203984afb21a8da3198982fe/websockets-17.4-pp312-pypy312_pp80-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:868744c68e9342768888c7326604da2228c19bb6946aa46b5f9e1ac32ea8d40b", size = 218356, upload-time = "2026-10-30T15:10:31.432Z" }, + { url = "https://files.pythonhosted.org/packages/b2/49/eed86bfb8863093a82cbaa52c9159be1ce2374d5ace6fe1f8e8031567e7d/websockets-17.4-pp312-pypy312_pp80-win_amd64.whl", hash = "sha256:829bcaa90be8737c132d9515d6a466e8528e3b3d050d3f3466f36ea94d3beb48", size = 306838, upload-time = "2026-10-30T15:10:32.954Z" }, + { url = "https://files.pythonhosted.org/packages/eb/27/9db924cb0dbf22eade78d98fbae77790f9bf6bc729e6ab29aef9d68e4156/websockets-17.4-py3-none-any.whl", hash = "sha256:c6bd2c9781915592b209160d0f017d4c7c82ad53075e6b0c24d2a89299e7f9e9", size = 212900, upload-time = "2026-10-30T15:10:34.482Z" }, +] + [[package]] name = "wsproto" version = "1.3.2" From 7fbb5ffa68bfcbcd43d86ea74addd30e827bb1bb Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Thu, 5 Nov 2026 11:02:20 -0500 Subject: [PATCH 2/6] Added spread tests --- tests/spread/test_logical_replication.py/task.yaml | 5 +++++ tests/spread/test_logical_replication_circular.py/task.yaml | 5 +++++ tests/spread/test_new_relations_1.py/task.yaml | 5 +++++ tests/spread/test_new_relations_2.py/task.yaml | 5 +++++ tests/spread/test_relations_coherence.py/task.yaml | 5 +++++ tests/spread/test_replication.py/task.yaml | 5 +++++ tests/spread/test_self_healing_1.py/task.yaml | 5 +++++ tests/spread/test_self_healing_2.py/task.yaml | 5 +++++ tests/spread/test_self_healing_3.py/task.yaml | 5 +++++ tests/spread/test_smoke.py/task.yaml | 5 +++++ tests/spread/test_synchronous_policy.py/task.yaml | 5 +++++ 11 files changed, 55 insertions(+) create mode 100644 tests/spread/test_logical_replication.py/task.yaml create mode 100644 tests/spread/test_logical_replication_circular.py/task.yaml create mode 100644 tests/spread/test_new_relations_1.py/task.yaml create mode 100644 tests/spread/test_new_relations_2.py/task.yaml create mode 100644 tests/spread/test_relations_coherence.py/task.yaml create mode 100644 tests/spread/test_replication.py/task.yaml create mode 100644 tests/spread/test_self_healing_1.py/task.yaml create mode 100644 tests/spread/test_self_healing_2.py/task.yaml create mode 100644 tests/spread/test_self_healing_3.py/task.yaml create mode 100644 tests/spread/test_smoke.py/task.yaml create mode 100644 tests/spread/test_synchronous_policy.py/task.yaml diff --git a/tests/spread/test_logical_replication.py/task.yaml b/tests/spread/test_logical_replication.py/task.yaml new file mode 100644 index 00000000..271c4591 --- /dev/null +++ b/tests/spread/test_logical_replication.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_logical_replication.py +environment: + TEST_MODULE: charm/ha_tests/test_logical_replication.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_logical_replication_circular.py/task.yaml b/tests/spread/test_logical_replication_circular.py/task.yaml new file mode 100644 index 00000000..b1e5400e --- /dev/null +++ b/tests/spread/test_logical_replication_circular.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_logical_replication_circular.py +environment: + TEST_MODULE: charm/ha_tests/test_logical_replication_circular.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_new_relations_1.py/task.yaml b/tests/spread/test_new_relations_1.py/task.yaml new file mode 100644 index 00000000..c0c7aa6b --- /dev/null +++ b/tests/spread/test_new_relations_1.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_new_relations_1.py +environment: + TEST_MODULE: charm/new_relations/test_new_relations_1.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_new_relations_2.py/task.yaml b/tests/spread/test_new_relations_2.py/task.yaml new file mode 100644 index 00000000..eb9572db --- /dev/null +++ b/tests/spread/test_new_relations_2.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_new_relations_2.py +environment: + TEST_MODULE: charm/new_relations/test_new_relations_2.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_relations_coherence.py/task.yaml b/tests/spread/test_relations_coherence.py/task.yaml new file mode 100644 index 00000000..0dc25980 --- /dev/null +++ b/tests/spread/test_relations_coherence.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_relations_coherence.py +environment: + TEST_MODULE: charm/new_relations/test_relations_coherence.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_replication.py/task.yaml b/tests/spread/test_replication.py/task.yaml new file mode 100644 index 00000000..fdf722f9 --- /dev/null +++ b/tests/spread/test_replication.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_replication.py +environment: + TEST_MODULE: charm/ha_tests/test_replication.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_self_healing_1.py/task.yaml b/tests/spread/test_self_healing_1.py/task.yaml new file mode 100644 index 00000000..63bfce96 --- /dev/null +++ b/tests/spread/test_self_healing_1.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_self_healing_1.py +environment: + TEST_MODULE: charm/ha_tests/test_self_healing_1.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_self_healing_2.py/task.yaml b/tests/spread/test_self_healing_2.py/task.yaml new file mode 100644 index 00000000..29dc3d28 --- /dev/null +++ b/tests/spread/test_self_healing_2.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_self_healing_2.py +environment: + TEST_MODULE: charm/ha_tests/test_self_healing_2.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_self_healing_3.py/task.yaml b/tests/spread/test_self_healing_3.py/task.yaml new file mode 100644 index 00000000..0f271a29 --- /dev/null +++ b/tests/spread/test_self_healing_3.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_self_healing_3.py +environment: + TEST_MODULE: charm/ha_tests/test_self_healing_3.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_smoke.py/task.yaml b/tests/spread/test_smoke.py/task.yaml new file mode 100644 index 00000000..561b4090 --- /dev/null +++ b/tests/spread/test_smoke.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_smoke.py +environment: + TEST_MODULE: charm/ha_tests/test_smoke.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing diff --git a/tests/spread/test_synchronous_policy.py/task.yaml b/tests/spread/test_synchronous_policy.py/task.yaml new file mode 100644 index 00000000..72d85212 --- /dev/null +++ b/tests/spread/test_synchronous_policy.py/task.yaml @@ -0,0 +1,5 @@ +summary: test_synchronous_policy.py +environment: + TEST_MODULE: charm/ha_tests/test_synchronous_policy.py +execute: | + tox run -e integration -- "tests/integration/$TEST_MODULE" --substrate "$SUBSTRATE" --model testing From a13b10b6b94aecf903354c2e5f42589e1bf1b8c4 Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Fri, 6 Nov 2026 04:30:12 -0500 Subject: [PATCH 3/6] Added charmcraft dependency --- .github/workflows/integration_test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index c4d425ea..72cf8b71 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -137,6 +137,8 @@ jobs: - name: Set up environment timeout-minutes: 15 run: | + # pytest-operator's ops_test fixture requires charmcraft on PATH + sudo snap install charmcraft --classic sudo snap install go --classic go install github.com/canonical/spread/cmd/spread@latest - name: Download packed test charm From 1133edf9684646fd6509cc0411a3d572b58854ee Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Mon, 9 Nov 2026 04:18:57 -0500 Subject: [PATCH 4/6] Logical replication config bug fix --- .../integration/charm/ha_tests/test_logical_replication.py | 6 +++--- .../charm/ha_tests/test_logical_replication_circular.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/integration/charm/ha_tests/test_logical_replication.py b/tests/integration/charm/ha_tests/test_logical_replication.py index 905620e9..ef598488 100644 --- a/tests/integration/charm/ha_tests/test_logical_replication.py +++ b/tests/integration/charm/ha_tests/test_logical_replication.py @@ -39,7 +39,7 @@ async def test_deploy(ops_test: OpsTest, charm, charm_resources, substrate: Subs application_name=DATABASE_APP_NAME, num_units=3, base=CHARM_BASE, - config=DATABASE_APP_CONFIG, + config=DATABASE_APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), @@ -48,7 +48,7 @@ async def test_deploy(ops_test: OpsTest, charm, charm_resources, substrate: Subs application_name=SECOND_DATABASE_APP_NAME, num_units=3, base=CHARM_BASE, - config=DATABASE_APP_CONFIG, + config=DATABASE_APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), @@ -57,7 +57,7 @@ async def test_deploy(ops_test: OpsTest, charm, charm_resources, substrate: Subs application_name=THIRD_DATABASE_APP_NAME, num_units=1, base=CHARM_BASE, - config=DATABASE_APP_CONFIG, + config=DATABASE_APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), diff --git a/tests/integration/charm/ha_tests/test_logical_replication_circular.py b/tests/integration/charm/ha_tests/test_logical_replication_circular.py index 7e4597cd..58f41505 100644 --- a/tests/integration/charm/ha_tests/test_logical_replication_circular.py +++ b/tests/integration/charm/ha_tests/test_logical_replication_circular.py @@ -41,7 +41,7 @@ async def test_deploy_clusters(ops_test: OpsTest, charm, charm_resources, substr application_name=APP_NAME_A, num_units=1, base=CHARM_BASE, - config=APP_CONFIG, + config=APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), @@ -50,7 +50,7 @@ async def test_deploy_clusters(ops_test: OpsTest, charm, charm_resources, substr application_name=APP_NAME_B, num_units=1, base=CHARM_BASE, - config=APP_CONFIG, + config=APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), @@ -59,7 +59,7 @@ async def test_deploy_clusters(ops_test: OpsTest, charm, charm_resources, substr application_name=APP_NAME_C, num_units=1, base=CHARM_BASE, - config=APP_CONFIG, + config=APP_CONFIG.copy(), resources=charm_resources, trust=substrate == Substrate.k8s, ), From 7e8ef9b5c1cafa646ef91e723af38af5a860c6cf Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Mon, 9 Nov 2026 10:20:47 -0500 Subject: [PATCH 5/6] Logical replication uncommented and smoke test fix --- tests/charms/postgresql_k8s_test_charm/config.yaml | 14 +++++++------- tests/integration/charm/ha_tests/helpers.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/charms/postgresql_k8s_test_charm/config.yaml b/tests/charms/postgresql_k8s_test_charm/config.yaml index 8fd6792a..a2fd13d4 100644 --- a/tests/charms/postgresql_k8s_test_charm/config.yaml +++ b/tests/charms/postgresql_k8s_test_charm/config.yaml @@ -180,13 +180,13 @@ options: Enables tracking of function call counts and time used. Specify pl to track only procedural-language functions type: string default: "none" -# logical-replication-subscription-request: -# description: | -# Set of databases corresponding to list of tables with schema notation in JSON format, which will be requested from -# publiblisher cluster to subscribe on via logical replication. -# Example: {"": [".", ...], ...} -# type: string -# default: "{}" + logical-replication-subscription-request: + description: | + Set of databases corresponding to list of tables with schema notation in JSON format, which will be requested from + publiblisher cluster to subscribe on via logical replication. + Example: {"": [".
", ...], ...} + type: string + default: "{}" memory-maintenance-work-mem: description: | Sets the maximum memory (KB) to be used for maintenance operations. diff --git a/tests/integration/charm/ha_tests/helpers.py b/tests/integration/charm/ha_tests/helpers.py index 0af50ceb..ef675318 100644 --- a/tests/integration/charm/ha_tests/helpers.py +++ b/tests/integration/charm/ha_tests/helpers.py @@ -1232,7 +1232,7 @@ def change_pvc_pv_name( """Change PersistentVolume name config value for PersistentVolumeClaim.""" pvc_config.spec.volumeName = pv_name_new del pvc_config.metadata.annotations["pv.kubernetes.io/bind-completed"] - del pvc_config.metadata.uid + pvc_config.metadata.uid = None return pvc_config From 6c73f91b1744bf8fb19354eadbc2a347d8d7bb09 Mon Sep 17 00:00:00 2001 From: xavipg003 Date: Wed, 18 Nov 2026 03:10:26 -0500 Subject: [PATCH 6/6] Discourse plugin vector fix --- .../integration/charm/new_relations/test_new_relations_2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/integration/charm/new_relations/test_new_relations_2.py b/tests/integration/charm/new_relations/test_new_relations_2.py index b2350c6e..8bf8705b 100644 --- a/tests/integration/charm/new_relations/test_new_relations_2.py +++ b/tests/integration/charm/new_relations/test_new_relations_2.py @@ -100,7 +100,11 @@ async def test_discourse(ops_test: OpsTest, architecture: str): async with ops_test.fast_forward(): # Enable the plugins/extensions required by Discourse. logger.info("Enabling the plugins/extensions required by Discourse") - config = {"plugin-hstore-enable": "True", "plugin-pg-trgm-enable": "True"} + config = { + "plugin-hstore-enable": "True", + "plugin-pg-trgm-enable": "True", + "plugin-vector-enable": "True", + } await ops_test.model.applications[DATABASE_APP_NAME].set_config(config) await gather( ops_test.model.wait_for_idle(apps=[DISCOURSE_APP_NAME], status="waiting"),