X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharm%2Fosm-ng-ui%2Ftests%2Fintegration%2Ftest_charm.py;h=3f87078fa045508015cc1e0a1dc9964ef7a1470e;hb=1123e827b6fbe6d35adc3602da7e0f3451e80755;hp=b9aa9101876e474b7a02b14e9f95ffe3805781e2;hpb=b6c30b4ef1d0d4a58d07dfd7a47ae8545eb3b5f1;p=osm%2Fdevops.git diff --git a/installers/charm/osm-ng-ui/tests/integration/test_charm.py b/installers/charm/osm-ng-ui/tests/integration/test_charm.py index b9aa9101..3f87078f 100644 --- a/installers/charm/osm-ng-ui/tests/integration/test_charm.py +++ b/installers/charm/osm-ng-ui/tests/integration/test_charm.py @@ -70,20 +70,19 @@ ALL_APPS = [ async def test_ng_ui_is_deployed(ops_test: OpsTest): ng_ui_charm = await ops_test.build_charm(".") ng_ui_resources = {"ng-ui-image": METADATA["resources"]["ng-ui-image"]["upstream-source"]} - keystone_deploy_cmd = f"juju deploy -m {ops_test.model_full_name} {KEYSTONE_CHARM} {KEYSTONE_APP} --resource keystone-image=opensourcemano/keystone:testing-daily" + keystone_image = "opensourcemano/keystone:testing-daily" + keystone_deploy_cmd = f"juju deploy -m {ops_test.model_full_name} {KEYSTONE_CHARM} {KEYSTONE_APP} --resource keystone-image={keystone_image} --channel=latest/beta --series jammy" await asyncio.gather( ops_test.model.deploy( - ng_ui_charm, resources=ng_ui_resources, application_name=NG_UI_APP, series="focal" - ), - ops_test.model.deploy(NBI_CHARM, application_name=NBI_APP, channel="beta"), - ops_test.model.deploy(KAFKA_CHARM, application_name=KAFKA_APP, channel="stable"), - ops_test.model.deploy( - MONGO_DB_CHARM, application_name=MONGO_DB_APP, channel="latest/stable" + ng_ui_charm, resources=ng_ui_resources, application_name=NG_UI_APP, series="jammy" ), ops_test.model.deploy( - PROMETHEUS_CHARM, application_name=PROMETHEUS_APP, channel="latest/edge" + NBI_CHARM, application_name=NBI_APP, channel="latest/beta", series="jammy" ), + ops_test.model.deploy(KAFKA_CHARM, application_name=KAFKA_APP, channel="stable"), + ops_test.model.deploy(MONGO_DB_CHARM, application_name=MONGO_DB_APP, channel="5/edge"), + ops_test.model.deploy(PROMETHEUS_CHARM, application_name=PROMETHEUS_APP, channel="stable"), ops_test.model.deploy(ZOOKEEPER_CHARM, application_name=ZOOKEEPER_APP, channel="stable"), ops_test.model.deploy(MYSQL_CHARM, application_name=MYSQL_APP, channel="stable"), # Keystone is deployed separately because the juju python library has a bug where resources @@ -99,7 +98,7 @@ async def test_ng_ui_is_deployed(ops_test: OpsTest): ops_test.model.relate(KAFKA_APP, ZOOKEEPER_APP), ops_test.model.relate(KEYSTONE_APP, NBI_APP), ops_test.model.relate(KAFKA_APP, NBI_APP), - ops_test.model.relate(MONGO_DB_APP, NBI_APP), + ops_test.model.relate("{}:mongodb".format(NBI_APP), "{}:database".format(MONGO_DB_APP)), ops_test.model.relate(PROMETHEUS_APP, NBI_APP), ) @@ -110,7 +109,7 @@ async def test_ng_ui_is_deployed(ops_test: OpsTest): unit = ops_test.model.applications[NG_UI_APP].units[0] assert unit.workload_status_message == "need nbi relation" - logger.info("Adding relations") + logger.info("Adding relations for NG-UI") await ops_test.model.relate(NG_UI_APP, NBI_APP) async with ops_test.fast_forward(): @@ -144,9 +143,12 @@ async def test_ng_ui_blocks_without_relation(ops_test: OpsTest): @pytest.mark.abort_on_fail async def test_ng_ui_integration_ingress(ops_test: OpsTest): - await asyncio.gather( - ops_test.model.deploy(INGRESS_CHARM, application_name=INGRESS_APP, channel="beta"), - ) + # Temporal workaround due to python-libjuju 2.9.42.2 bug fixed in + # https://github.com/juju/python-libjuju/pull/854 + # To be replaced when juju version 2.9.43 is used. + cmd = f"juju deploy {INGRESS_CHARM} {INGRESS_APP} --channel stable" + await ops_test.run(*shlex.split(cmd), check=True) + async with ops_test.fast_forward(): await ops_test.model.wait_for_idle(apps=ALL_APPS + [INGRESS_APP])