X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharm%2Fosm-nbi%2Ftests%2Fintegration%2Ftest_charm.py;h=b853bb524b345ab8cf2e28960e1ecb221cc622a6;hb=refs%2Fchanges%2F86%2F13286%2F3;hp=ac35ea670da8a249dd0382295f0d9f6272a0b878;hpb=fe67909cdef35dbf4357abad97f7710c8e83f584;p=osm%2Fdevops.git diff --git a/installers/charm/osm-nbi/tests/integration/test_charm.py b/installers/charm/osm-nbi/tests/integration/test_charm.py index ac35ea67..b853bb52 100644 --- a/installers/charm/osm-nbi/tests/integration/test_charm.py +++ b/installers/charm/osm-nbi/tests/integration/test_charm.py @@ -42,13 +42,24 @@ MONGO_DB_CHARM = "mongodb-k8s" MONGO_DB_APP = "mongodb" KEYSTONE_CHARM = "osm-keystone" KEYSTONE_APP = "keystone" +TEMPORAL_CHARM = "osm-temporal" +TEMPORAL_APP = "temporal" PROMETHEUS_CHARM = "osm-prometheus" PROMETHEUS_APP = "prometheus" ZOOKEEPER_CHARM = "zookeeper-k8s" ZOOKEEPER_APP = "zookeeper" INGRESS_CHARM = "nginx-ingress-integrator" INGRESS_APP = "ingress" -APPS = [KAFKA_APP, MONGO_DB_APP, MARIADB_APP, ZOOKEEPER_APP, KEYSTONE_APP, PROMETHEUS_APP, NBI_APP] +APPS = [ + KAFKA_APP, + MONGO_DB_APP, + MARIADB_APP, + ZOOKEEPER_APP, + KEYSTONE_APP, + TEMPORAL_APP, + PROMETHEUS_APP, + NBI_APP, +] @pytest.mark.abort_on_fail @@ -61,7 +72,7 @@ async def test_nbi_is_deployed(ops_test: OpsTest): charm, resources=resources, application_name=NBI_APP, series="focal" ), 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="stable"), + ops_test.model.deploy(MONGO_DB_CHARM, application_name=MONGO_DB_APP, channel="edge"), ops_test.model.deploy(MARIADB_CHARM, application_name=MARIADB_APP, channel="stable"), ops_test.model.deploy(ZOOKEEPER_CHARM, application_name=ZOOKEEPER_APP, channel="stable"), ops_test.model.deploy(PROMETHEUS_CHARM, application_name=PROMETHEUS_APP, channel="stable"), @@ -71,6 +82,8 @@ async def test_nbi_is_deployed(ops_test: OpsTest): # prevents setting correctly the resources cmd = f"juju deploy {KEYSTONE_CHARM} {KEYSTONE_APP} --resource keystone-image=opensourcemano/keystone:12" await ops_test.run(*shlex.split(cmd), check=True) + cmd = f"juju deploy {TEMPORAL_CHARM} {TEMPORAL_APP} --resource temporal-server-image=temporalio/auto-setup:1.20 --series focal --channel=latest/edge" + await ops_test.run(*shlex.split(cmd), check=True) async with ops_test.fast_forward(): await ops_test.model.wait_for_idle( @@ -78,17 +91,22 @@ async def test_nbi_is_deployed(ops_test: OpsTest): ) assert ops_test.model.applications[NBI_APP].status == "blocked" unit = ops_test.model.applications[NBI_APP].units[0] - assert unit.workload_status_message == "need kafka, mongodb, prometheus, keystone relations" + assert ( + unit.workload_status_message + == "need kafka, mongodb, prometheus, keystone, temporal relations" + ) logger.info("Adding relations for other components") await ops_test.model.add_relation(KAFKA_APP, ZOOKEEPER_APP) await ops_test.model.add_relation(MARIADB_APP, KEYSTONE_APP) + await ops_test.model.add_relation(MARIADB_APP, f"{TEMPORAL_APP}:db") logger.info("Adding relations") await ops_test.model.add_relation(NBI_APP, MONGO_DB_APP) await ops_test.model.add_relation(NBI_APP, KAFKA_APP) await ops_test.model.add_relation(NBI_APP, PROMETHEUS_APP) await ops_test.model.add_relation(NBI_APP, KEYSTONE_APP) + await ops_test.model.add_relation(NBI_APP, TEMPORAL_APP) async with ops_test.fast_forward(): await ops_test.model.wait_for_idle( @@ -111,7 +129,7 @@ async def test_nbi_scales_up(ops_test: OpsTest): @pytest.mark.abort_on_fail @pytest.mark.parametrize( - "relation_to_remove", [KAFKA_APP, MONGO_DB_APP, PROMETHEUS_APP, KEYSTONE_APP] + "relation_to_remove", [KAFKA_APP, MONGO_DB_APP, PROMETHEUS_APP, KEYSTONE_APP, TEMPORAL_APP] ) async def test_nbi_blocks_without_relation(ops_test: OpsTest, relation_to_remove): logger.info("Removing relation: %s", relation_to_remove)