+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(
+ apps=LCM_APPS,
+ )
+ # wait for MongoDB to be active before relating RO to it
+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(apps=[MONGO_DB_APP], status="active")
+ logger.info("Adding relations")
+ await ops_test.model.add_relation(KAFKA_APP, ZOOKEEPER_APP)
+ await ops_test.model.add_relation(RO_APP, MONGO_DB_APP)
+ await ops_test.model.add_relation(RO_APP, KAFKA_APP)
+ # LCM specific
+ await ops_test.model.add_relation(LCM_APP, MONGO_DB_APP)
+ await ops_test.model.add_relation(LCM_APP, KAFKA_APP)
+ await ops_test.model.add_relation(LCM_APP, RO_APP)
+
+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(
+ apps=LCM_APPS,
+ status="active",
+ )
+
+ logger.info("Adding relation VCA LCM")
+ await ops_test.model.add_relation(VCA_APP, LCM_APP)
+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(
+ apps=[VCA_APP, LCM_APP],
+ status="active",
+ )
+
+
+@pytest.mark.abort_on_fail
+async def test_vca_integration_mon(ops_test: OpsTest):
+ keystone_deploy_cmd = f"juju deploy {KEYSTONE_CHARM} {KEYSTONE_APP} --resource keystone-image=opensourcemano/keystone:testing-daily"
+ mon_deploy_cmd = f"juju deploy {MON_CHARM} {MON_APP} --resource mon-image=opensourcemano/mon:testing-daily --channel=latest/beta --series=focal"
+ await asyncio.gather(
+ # MON charm has to be deployed differently since
+ # bug https://github.com/juju/python-libjuju/issues/820
+ # fails to parse assumes
+ ops_test.run(*shlex.split(mon_deploy_cmd), check=True),
+ ops_test.model.deploy(MARIADB_CHARM, application_name=MARIADB_APP, channel="stable"),
+ ops_test.model.deploy(PROMETHEUS_CHARM, application_name=PROMETHEUS_APP, channel="stable"),
+ # Keystone charm has to be deployed differently since
+ # bug https://github.com/juju/python-libjuju/issues/766
+ # prevents setting correctly the resources
+ ops_test.run(*shlex.split(keystone_deploy_cmd), check=True),
+ )
+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(
+ apps=MON_APPS,
+ )
+
+ logger.info("Adding relations")
+ await ops_test.model.add_relation(MARIADB_APP, KEYSTONE_APP)
+ # MON specific
+ await ops_test.model.add_relation(MON_APP, MONGO_DB_APP)
+ await ops_test.model.add_relation(MON_APP, KAFKA_APP)
+ await ops_test.model.add_relation(MON_APP, KEYSTONE_APP)
+ await ops_test.model.add_relation(MON_APP, PROMETHEUS_APP)
+
+ async with ops_test.fast_forward():
+ await ops_test.model.wait_for_idle(
+ apps=MON_APPS,
+ status="active",
+ )