From bf981d2af0b75b657959829a1be66a885de67ad3 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Wed, 21 Aug 2024 18:45:20 +0000 Subject: [PATCH] Explicitly use base instead of series, and hardcode base as ubuntu@22.04 --- poetry.lock | 1 - .../high_availability_helpers.py | 3 ++- .../high_availability/test_async_replication.py | 6 ++++-- .../high_availability/test_upgrade.py | 2 ++ .../test_upgrade_from_stable.py | 2 ++ .../test_upgrade_rollback_incompat.py | 1 + tests/integration/relations/test_database.py | 3 ++- tests/integration/relations/test_mysql_root.py | 16 ++++++++++++---- tests/integration/test_backup_aws.py | 2 +- tests/integration/test_backup_ceph.py | 2 +- tests/integration/test_backup_gcp.py | 2 +- tests/integration/test_charm.py | 2 +- tests/integration/test_tls.py | 6 ++++-- 13 files changed, 33 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index 551cfaa91..a13eb80f0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1782,7 +1782,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/tests/integration/high_availability/high_availability_helpers.py b/tests/integration/high_availability/high_availability_helpers.py index 514526dea..aa7941c4f 100644 --- a/tests/integration/high_availability/high_availability_helpers.py +++ b/tests/integration/high_availability/high_availability_helpers.py @@ -159,7 +159,7 @@ async def deploy_and_scale_mysql( config=config, resources=resources, num_units=num_units, - series="jammy", + base="ubuntu@22.04", trust=True, ) @@ -197,6 +197,7 @@ async def deploy_and_scale_application(ops_test: OpsTest) -> str: application_name=APPLICATION_DEFAULT_APP_NAME, num_units=1, channel="latest/edge", + base="ubuntu@22.04", ) await ops_test.model.wait_for_idle( diff --git a/tests/integration/high_availability/test_async_replication.py b/tests/integration/high_availability/test_async_replication.py index 8088bebee..2ccd9f524 100644 --- a/tests/integration/high_availability/test_async_replication.py +++ b/tests/integration/high_availability/test_async_replication.py @@ -90,6 +90,7 @@ async def test_build_and_deploy( config=config, resources=resources, trust=True, + base="ubuntu@22.04", ) config["cluster-name"] = "cuzco" await second_model.deploy( @@ -99,6 +100,7 @@ async def test_build_and_deploy( config=config, resources=resources, trust=True, + base="ubuntu@22.04", ) logger.info("Waiting for the applications to settle") @@ -193,7 +195,7 @@ async def test_deploy_router_and_app(first_model: Model) -> None: await first_model.deploy( MYSQL_ROUTER_APP_NAME, application_name=MYSQL_ROUTER_APP_NAME, - series="jammy", + base="ubuntu@22.04", channel="8.0/edge", num_units=1, trust=True, @@ -201,7 +203,7 @@ async def test_deploy_router_and_app(first_model: Model) -> None: await first_model.deploy( APPLICATION_APP_NAME, application_name=APPLICATION_APP_NAME, - series="jammy", + base="ubuntu@22.04", channel="latest/edge", num_units=1, ) diff --git a/tests/integration/high_availability/test_upgrade.py b/tests/integration/high_availability/test_upgrade.py index ba553d98d..b64a12fc8 100644 --- a/tests/integration/high_availability/test_upgrade.py +++ b/tests/integration/high_availability/test_upgrade.py @@ -46,12 +46,14 @@ async def test_deploy_latest(ops_test: OpsTest) -> None: channel="8.0/edge", trust=True, config={"profile": "testing"}, + base="ubuntu@22.04", ) await ops_test.model.deploy( TEST_APP_NAME, application_name=TEST_APP_NAME, num_units=1, channel="latest/edge", + base="ubuntu@22.04", ) await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME) diff --git a/tests/integration/high_availability/test_upgrade_from_stable.py b/tests/integration/high_availability/test_upgrade_from_stable.py index a72e22547..576395ce0 100644 --- a/tests/integration/high_availability/test_upgrade_from_stable.py +++ b/tests/integration/high_availability/test_upgrade_from_stable.py @@ -43,12 +43,14 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: channel="8.0/stable", trust=True, config={"profile": "testing"}, + base="ubuntu@22.04", ), ops_test.model.deploy( f"mysql-{TEST_APP_NAME}", application_name=TEST_APP_NAME, num_units=1, channel="latest/edge", + base="ubuntu@22.04", ), ) await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME) diff --git a/tests/integration/high_availability/test_upgrade_rollback_incompat.py b/tests/integration/high_availability/test_upgrade_rollback_incompat.py index 1493e0bba..c316d4ba2 100644 --- a/tests/integration/high_availability/test_upgrade_rollback_incompat.py +++ b/tests/integration/high_availability/test_upgrade_rollback_incompat.py @@ -47,6 +47,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: num_units=3, resources=resources, trust=True, + base="ubuntu@22.04", ) await ops_test.model.wait_for_idle( diff --git a/tests/integration/relations/test_database.py b/tests/integration/relations/test_database.py index f24694440..64e228e22 100644 --- a/tests/integration/relations/test_database.py +++ b/tests/integration/relations/test_database.py @@ -44,7 +44,7 @@ async def test_build_and_deploy(ops_test: OpsTest): config=config, num_units=3, resources=resources, - series="jammy", + base="ubuntu@22.04", trust=True, ), ops_test.model.deploy( @@ -52,6 +52,7 @@ async def test_build_and_deploy(ops_test: OpsTest): application_name=APPLICATION_APP_NAME, num_units=2, channel="latest/edge", + base="ubuntu@22.04", ), ) diff --git a/tests/integration/relations/test_mysql_root.py b/tests/integration/relations/test_mysql_root.py index 09cef607d..56f9fbbb7 100644 --- a/tests/integration/relations/test_mysql_root.py +++ b/tests/integration/relations/test_mysql_root.py @@ -51,7 +51,7 @@ async def test_deploy_and_relate_osm_bundle(ops_test: OpsTest) -> None: resources=resources, config=config, num_units=1, - series="jammy", + base="ubuntu@22.04", trust=True, ), # Deploy the osm-keystone charm @@ -70,12 +70,20 @@ async def test_deploy_and_relate_osm_bundle(ops_test: OpsTest) -> None: channel="latest/beta", resources=osm_pol_resources, trust=True, + base="ubuntu@22.04", ), ops_test.model.deploy( - "kafka-k8s", application_name="kafka", trust=True, channel="latest/stable" + "kafka-k8s", + application_name="kafka", + trust=True, + channel="latest/stable", + base="ubuntu@22.04", ), ops_test.model.deploy( - "zookeeper-k8s", application_name="zookeeper", channel="latest/stable" + "zookeeper-k8s", + application_name="zookeeper", + channel="latest/stable", + base="ubuntu@22.04", ), # sticking to revision that support both juju 2.9.x and 3.x ops_test.model.deploy( @@ -83,7 +91,7 @@ async def test_deploy_and_relate_osm_bundle(ops_test: OpsTest) -> None: application_name="mongodb", channel="5/edge", revision=36, - series="jammy", + base="ubuntu@22.04", ), ) diff --git a/tests/integration/test_backup_aws.py b/tests/integration/test_backup_aws.py index 20af0ba45..e987d337f 100644 --- a/tests/integration/test_backup_aws.py +++ b/tests/integration/test_backup_aws.py @@ -98,7 +98,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: logger.info("Deploying s3-integrator") - await ops_test.model.deploy(S3_INTEGRATOR, channel="stable") + await ops_test.model.deploy(S3_INTEGRATOR, channel="stable", base="ubuntu@22.04") await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR) await ops_test.model.wait_for_idle( diff --git a/tests/integration/test_backup_ceph.py b/tests/integration/test_backup_ceph.py index db5fe5772..364ebba10 100644 --- a/tests/integration/test_backup_ceph.py +++ b/tests/integration/test_backup_ceph.py @@ -94,7 +94,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: logger.info("Deploying s3-integrator") - await ops_test.model.deploy(S3_INTEGRATOR, channel="stable") + await ops_test.model.deploy(S3_INTEGRATOR, channel="stable", base="ubuntu@22.04") await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR) await ops_test.model.wait_for_idle( diff --git a/tests/integration/test_backup_gcp.py b/tests/integration/test_backup_gcp.py index aefcdfb1e..64aa788d5 100644 --- a/tests/integration/test_backup_gcp.py +++ b/tests/integration/test_backup_gcp.py @@ -98,7 +98,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: logger.info("Deploying s3-integrator") - await ops_test.model.deploy(S3_INTEGRATOR, channel="stable") + await ops_test.model.deploy(S3_INTEGRATOR, channel="stable", base="ubuntu@22.04") await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR) await ops_test.model.wait_for_idle( diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index 0a4ac02bd..f5354bec5 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -58,7 +58,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: application_name=APP_NAME, config=config, num_units=3, - series="jammy", + base="ubuntu@22.04", trust=True, ) diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index d8f68e5ad..f445fb98a 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -69,7 +69,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: resources=resources, application_name=APP_NAME, num_units=3, - series="jammy", + base="ubuntu@22.04", trust=True, config=config, ) @@ -128,7 +128,9 @@ async def test_enable_tls(ops_test: OpsTest) -> None: # Deploy TLS Certificates operator. logger.info("Deploy TLS operator") async with ops_test.fast_forward("60s"): - await ops_test.model.deploy(tls_app_name, channel=tls_channel, config=tls_config) + await ops_test.model.deploy( + tls_app_name, channel=tls_channel, config=tls_config, base="ubuntu@22.04" + ) await ops_test.model.wait_for_idle(apps=[tls_app_name], status="active", timeout=15 * 60) # Relate with TLS charm