From 9ab64a953b0a46d6e09c16387c851a56c8c809cd Mon Sep 17 00:00:00 2001 From: Dario Faccin Date: Mon, 27 Mar 2023 10:38:22 +0200 Subject: [PATCH] LCM integration tests: use RO charm from charmhub instead of building it locally Change-Id: I3c1aba9227d9ef5c28f559447da63035214c8ea1 Signed-off-by: Dario Faccin --- .../charm/osm-lcm/tests/integration/test_charm.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/installers/charm/osm-lcm/tests/integration/test_charm.py b/installers/charm/osm-lcm/tests/integration/test_charm.py index bb0f34e1..a9913390 100644 --- a/installers/charm/osm-lcm/tests/integration/test_charm.py +++ b/installers/charm/osm-lcm/tests/integration/test_charm.py @@ -23,6 +23,7 @@ import asyncio import logging +import shlex from pathlib import Path import pytest @@ -37,6 +38,7 @@ KAFKA_CHARM = "kafka-k8s" KAFKA_APP = "kafka" MONGO_DB_CHARM = "mongodb-k8s" MONGO_DB_APP = "mongodb" +RO_CHARM = "osm-ro" RO_APP = "ro" ZOOKEEPER_CHARM = "zookeeper-k8s" ZOOKEEPER_APP = "zookeeper" @@ -49,16 +51,16 @@ APPS = [KAFKA_APP, MONGO_DB_APP, ZOOKEEPER_APP, RO_APP, LCM_APP] async def test_lcm_is_deployed(ops_test: OpsTest): charm = await ops_test.build_charm(".") resources = {"lcm-image": METADATA["resources"]["lcm-image"]["upstream-source"]} - ro_charm = await ops_test.build_charm("../osm-ro/") - ro_resources = {"ro-image": "opensourcemano/ro"} + ro_deploy_cmd = f"juju deploy {RO_CHARM} {RO_APP} --resource ro-image=opensourcemano/ro:testing-daily --channel=latest/beta --series=focal" await asyncio.gather( ops_test.model.deploy( charm, resources=resources, application_name=LCM_APP, series="focal" ), - ops_test.model.deploy( - ro_charm, resources=ro_resources, application_name=RO_APP, series="focal" - ), + # RO charm has to be deployed differently since + # bug https://github.com/juju/python-libjuju/issues/822 + # deploys different charms wrt cli + ops_test.run(*shlex.split(ro_deploy_cmd), check=True), 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="edge"), ops_test.model.deploy(ZOOKEEPER_CHARM, application_name=ZOOKEEPER_APP, channel="stable"), -- 2.25.1