projects
/
osm
/
LCM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Needed for feature 10938: extract_prometheus_scrape_jobs populating prom template...
[osm/LCM.git]
/
osm_lcm
/
tests
/
test_lcm_helm_conn.py
diff --git
a/osm_lcm/tests/test_lcm_helm_conn.py
b/osm_lcm/tests/test_lcm_helm_conn.py
index
7116517
..
2ea9ae8
100644
(file)
--- a/
osm_lcm/tests/test_lcm_helm_conn.py
+++ b/
osm_lcm/tests/test_lcm_helm_conn.py
@@
-23,6
+23,7
@@
from osm_lcm.lcm_helm_conn import LCMHelmConn
from asynctest.mock import Mock
from osm_lcm.data_utils.database.database import Database
from osm_lcm.data_utils.filesystem.filesystem import Filesystem
from asynctest.mock import Mock
from osm_lcm.data_utils.database.database import Database
from osm_lcm.data_utils.filesystem.filesystem import Filesystem
+from osm_lcm.data_utils.lcm_config import VcaConfig
__author__ = "Isabel Lloret <illoret@indra.es>"
__author__ = "Isabel Lloret <illoret@indra.es>"
@@
-54,6
+55,7
@@
class TestLcmHelmConn(asynctest.TestCase):
lcm_helm_conn.K8sHelm3Connector = asynctest.Mock(
lcm_helm_conn.K8sHelm3Connector
)
lcm_helm_conn.K8sHelm3Connector = asynctest.Mock(
lcm_helm_conn.K8sHelm3Connector
)
+ vca_config = VcaConfig(vca_config)
self.helm_conn = LCMHelmConn(
loop=self.loop, vca_config=vca_config, log=self.logger
)
self.helm_conn = LCMHelmConn(
loop=self.loop, vca_config=vca_config, log=self.logger
)
@@
-79,8
+81,11
@@
class TestLcmHelmConn(asynctest.TestCase):
self.db.get_one.return_value = {"_admin": {"helm-chart-v3": {"id": "myk8s_id"}}}
ee_id, _ = await self.helm_conn.create_execution_environment(
self.db.get_one.return_value = {"_admin": {"helm-chart-v3": {"id": "myk8s_id"}}}
ee_id, _ = await self.helm_conn.create_execution_environment(
- namespace, db_dict, artifact_path=artifact_path,
- chart_model=chart_model, vca_type="helm-v3"
+ namespace,
+ db_dict,
+ artifact_path=artifact_path,
+ chart_model=chart_model,
+ vca_type="helm-v3",
)
self.assertEqual(
ee_id,
)
self.assertEqual(
ee_id,
@@
-101,7
+106,6
@@
class TestLcmHelmConn(asynctest.TestCase):
async def test_get_ee_ssh_public__key(self):
ee_id = "osm.helm_sample_charm_0001"
db_dict = {}
async def test_get_ee_ssh_public__key(self):
ee_id = "osm.helm_sample_charm_0001"
db_dict = {}
- lcm_helm_conn.socket.gethostbyname = asynctest.Mock()
mock_pub_key = "ssh-rsapubkey"
self.db.get_one.return_value = {"_admin": {"helm-chart": {"id": "myk8s_id"}}}
self.helm_conn._get_ssh_key = asynctest.CoroutineMock(return_value=mock_pub_key)
mock_pub_key = "ssh-rsapubkey"
self.db.get_one.return_value = {"_admin": {"helm-chart": {"id": "myk8s_id"}}}
self.helm_conn._get_ssh_key = asynctest.CoroutineMock(return_value=mock_pub_key)
@@
-112,7
+116,6
@@
class TestLcmHelmConn(asynctest.TestCase):
@asynctest.fail_on(active_handles=True)
async def test_execute_primitive(self):
@asynctest.fail_on(active_handles=True)
async def test_execute_primitive(self):
- lcm_helm_conn.socket.gethostbyname = asynctest.Mock()
ee_id = "osm.helm_sample_charm_0001"
primitive_name = "sleep"
params = {}
ee_id = "osm.helm_sample_charm_0001"
primitive_name = "sleep"
params = {}
@@
-126,7
+129,6
@@
class TestLcmHelmConn(asynctest.TestCase):
@asynctest.fail_on(active_handles=True)
async def test_execute_config_primitive(self):
self.logger.debug("Execute config primitive")
@asynctest.fail_on(active_handles=True)
async def test_execute_config_primitive(self):
self.logger.debug("Execute config primitive")
- lcm_helm_conn.socket.gethostbyname = asynctest.Mock()
ee_id = "osm.helm_sample_charm_0001"
primitive_name = "config"
params = {"ssh-host-name": "host1"}
ee_id = "osm.helm_sample_charm_0001"
primitive_name = "config"
params = {"ssh-host-name": "host1"}