diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 91d450a8b8..9278824a50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: juju: - - agent: 2.9.46 # renovate: latest juju 2 + - agent: 2.9.49 # renovate: latest juju 2 libjuju: ==2.9.46.1 # renovate: latest libjuju 2 allure: false - agent: 3.1.7 # renovate: latest juju 3 @@ -76,6 +76,8 @@ jobs: "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", "UBUNTU_PRO_TOKEN" : "${{ secrets.UBUNTU_PRO_TOKEN }}", + "LANDSCAPE_ACCOUNT_NAME": "${{ secrets.LANDSCAPE_ACCOUNT_NAME }}", + "LANDSCAPE_REGISTRATION_KEY": "${{ secrets.LANDSCAPE_REGISTRATION_KEY }}", } permissions: contents: write # Needed for Allure Report beta diff --git a/tests/integration/test_subordinates.py b/tests/integration/test_subordinates.py index 63fbb53ec2..f9d30dedba 100644 --- a/tests/integration/test_subordinates.py +++ b/tests/integration/test_subordinates.py @@ -3,16 +3,13 @@ # See LICENSE file for licensing details. import logging -import subprocess from asyncio import gather -from base64 import b64encode import pytest from pytest_operator.plugin import OpsTest from .helpers import ( CHARM_SERIES, - get_unit_address, scale_application, ) @@ -26,50 +23,32 @@ @pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_deploy(ops_test: OpsTest, charm: str, github_secrets): - landscape_config = { - "admin_email": "admin@example.com", - "admin_name": "Admin", - "admin_password": "qweqwepoipoi", - } await gather( ops_test.model.deploy( charm, application_name=DATABASE_APP_NAME, num_units=3, series=CHARM_SERIES, - config={"profile": "testing"}, ), - ops_test.model.deploy("landscape-scalable"), ops_test.model.deploy( UBUNTU_PRO_APP_NAME, config={"token": github_secrets["UBUNTU_PRO_TOKEN"]}, + channel="latest/edge", + num_units=0, + ), + ops_test.model.deploy( + LS_CLIENT, + config={ + "account-name": github_secrets["LANDSCAPE_ACCOUNT_NAME"], + "registration-key": github_secrets["LANDSCAPE_REGISTRATION_KEY"], + "ppa": "ppa:landscape/self-hosted-beta", + }, + channel="latest/edge", num_units=0, ), - ops_test.model.deploy(LS_CLIENT, num_units=0), - ) - await ops_test.model.applications["landscape-server"].set_config(landscape_config) - - await ops_test.model.wait_for_idle( - apps=["landscape-server", "haproxy", DATABASE_APP_NAME], status="active", timeout=3000 ) - haproxy_unit = ops_test.model.applications["haproxy"].units[0] - haproxy_addr = get_unit_address(ops_test, haproxy_unit.name) - haproxy_host = haproxy_unit.machine.hostname - cert = subprocess.check_output([ - "lxc", - "exec", - haproxy_host, - "cat", - "/var/lib/haproxy/selfsigned_ca.crt", - ]) - ssl_public_key = f"base64:{b64encode(cert).decode()}" - await ops_test.model.applications[LS_CLIENT].set_config({ - "account-name": "standalone", - "ping-url": f"http://{haproxy_addr}/ping", - "url": f"https://{haproxy_addr}/message-system", - "ssl-public-key": ssl_public_key, - }) + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=2000) await ops_test.model.relate(f"{DATABASE_APP_NAME}:juju-info", f"{LS_CLIENT}:container") await ops_test.model.relate( f"{DATABASE_APP_NAME}:juju-info", f"{UBUNTU_PRO_APP_NAME}:juju-info"