Fix bug 1448: minor fix in JujuModelWatcher.wait_for_model
[osm/N2VC.git] / n2vc / tests / unit / test_k8s_helm3_conn.py
index 65af0b7..3b81323 100644 (file)
@@ -68,7 +68,7 @@ class TestK8sHelm3Conn(asynctest.TestCase):
         self.helm_conn._create_namespace.assert_called_once_with(self.cluster_id, self.namespace)
         self.helm_conn.repo_list.assert_called_once_with(k8scluster_uuid)
         self.helm_conn.repo_add.assert_called_once_with(
-            k8scluster_uuid, "stable", "https://kubernetes-charts.storage.googleapis.com/")
+            k8scluster_uuid, "stable", "https://charts.helm.sh/stable")
         self.helm_conn.fs.reverse_sync.assert_called_once_with(from_path=self.cluster_id)
         self.logger.debug(f"cluster_uuid: {k8scluster_uuid}")
 
@@ -134,25 +134,24 @@ class TestK8sHelm3Conn(asynctest.TestCase):
         self.helm_conn._local_async_exec = asynctest.CoroutineMock(return_value=("", 0))
         self.helm_conn._status_kdu = asynctest.CoroutineMock(return_value=None)
         self.helm_conn._store_status = asynctest.CoroutineMock()
-        self.helm_conn._generate_release_name = Mock(return_value="stable-openldap-0005399828")
+        self.kdu_instance = "stable-openldap-0005399828"
+        self.helm_conn.generate_kdu_instance_name = Mock(return_value=self.kdu_instance)
         self.helm_conn._get_namespaces = asynctest.CoroutineMock(return_value=[])
         self.helm_conn._create_namespace = asynctest.CoroutineMock()
 
-        kdu_instance = await self.helm_conn.install(self.cluster_uuid,
-                                                    kdu_model,
-                                                    atomic=True,
-                                                    namespace=self.namespace,
-                                                    db_dict=db_dict)
+        await self.helm_conn.install(
+            self.cluster_uuid,
+            kdu_model,
+            self.kdu_instance,
+            atomic=True,
+            namespace=self.namespace,
+            db_dict=db_dict
+        )
 
         self.helm_conn._get_namespaces.assert_called_once()
         self.helm_conn._create_namespace.assert_called_once_with(self.cluster_id, self.namespace)
         self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id)
         self.helm_conn.fs.reverse_sync.assert_called_once_with(from_path=self.cluster_id)
-        self.helm_conn._generate_release_name.assert_called_once_with("stable/openldap")
-        self.helm_conn._status_kdu.assert_called_once_with(cluster_id=self.cluster_id,
-                                                           kdu_instance=kdu_instance,
-                                                           namespace=self.namespace,
-                                                           show_error_log=False)
         self.helm_conn._store_status.assert_called_with(cluster_id=self.cluster_id,
                                                         kdu_instance=kdu_instance,
                                                         namespace=self.namespace,
@@ -446,7 +445,7 @@ class TestK8sHelm3Conn(asynctest.TestCase):
             if args[0] == "k8sclusters":
                 return {
                     "_admin": {
-                        "helm_chart_repos" : [
+                        "helm_chart_repos": [
                             "4b5550a9-990d-4d95-8a48-1f4614d6ac9c"
                         ]
                     }