2 #######################################################################################
3 # Copyright ETSI Contributors and Others.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #######################################################################################
20 from pathlib
import Path
24 from pytest_operator
.plugin
import OpsTest
26 logger
= logging
.getLogger(__name__
)
28 METADATA
= yaml
.safe_load(Path("./metadata.yaml").read_text())
31 @pytest.mark
.abort_on_fail
32 async def test_build_and_deploy(ops_test
: OpsTest
):
33 """Build the charm osm-vca-integrator-k8s and deploy it together with related charms.
35 Assert on the unit status before any relations/configurations take place.
37 await ops_test
.model
.set_config({"update-status-hook-interval": "10s"})
39 charm
= await ops_test
.build_charm(".")
40 await ops_test
.model
.deploy(charm
, application_name
="osm-vca-integrator-k8s")
41 await ops_test
.model
.wait_for_idle(
42 apps
=["osm-vca-integrator-k8s"], status
="blocked", timeout
=1000
45 ops_test
.model
.applications
["osm-vca-integrator-k8s"].units
[0].workload_status
== "blocked"
48 logger
.debug("Setting update-status-hook-interval to 60m")
49 await ops_test
.model
.set_config({"update-status-hook-interval": "60m"})