You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by we...@apache.org on 2022/04/05 10:02:26 UTC

[cloudstack] branch main updated: test: update test_kubernetes_clusters.py to support advanced zone with security groups (#6183)

This is an automated email from the ASF dual-hosted git repository.

weizhou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 960513aa97 test: update test_kubernetes_clusters.py to support advanced zone with security groups (#6183)
960513aa97 is described below

commit 960513aa97224491e9c03fb9ecf40e36e9220f98
Author: Wei Zhou <we...@apache.org>
AuthorDate: Tue Apr 5 12:02:18 2022 +0200

    test: update test_kubernetes_clusters.py to support advanced zone with security groups (#6183)
---
 test/integration/smoke/test_kubernetes_clusters.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/integration/smoke/test_kubernetes_clusters.py b/test/integration/smoke/test_kubernetes_clusters.py
index 6c4c0cc79b..37bd242752 100644
--- a/test/integration/smoke/test_kubernetes_clusters.py
+++ b/test/integration/smoke/test_kubernetes_clusters.py
@@ -37,6 +37,7 @@ from marvin.cloudstackAPI import (listInfrastructure,
 from marvin.cloudstackException import CloudstackAPIException
 from marvin.codes import PASS, FAILED
 from marvin.lib.base import (Template,
+                             Network,
                              ServiceOffering,
                              Account,
                              StoragePool,
@@ -123,6 +124,15 @@ class TestKubernetesCluster(cloudstackTestCase):
                     domainid=cls.domain.id
                 )
                 cls._cleanup.append(cls.account)
+
+        cls.default_network = None
+        if str(cls.zone.securitygroupsenabled) == "True":
+            networks = Network.list(
+                cls.apiclient,
+                listall=True
+            )
+            cls.default_network = networks[0]
+
         return
 
     @classmethod
@@ -514,6 +524,8 @@ class TestKubernetesCluster(cloudstackTestCase):
         """
         if self.setup_failed == True:
             self.fail("Setup incomplete")
+        if self.default_network:
+            self.skipTest("HA cluster on shared network requires external ip address, skipping it")
         global k8s_cluster
         k8s_cluster = self.getValidKubernetesCluster(1, 2)
         self.debug("HA Kubernetes cluster with ID: %s successfully deployed" % k8s_cluster.id)
@@ -529,6 +541,8 @@ class TestKubernetesCluster(cloudstackTestCase):
         """
         if self.setup_failed == True:
             self.fail("Setup incomplete")
+        if self.default_network:
+            self.skipTest("HA cluster on shared network requires external ip address, skipping it")
         global k8s_cluster
         k8s_cluster = self.getValidKubernetesCluster(1, 2)
         time.sleep(self.services["sleep"])
@@ -554,6 +568,8 @@ class TestKubernetesCluster(cloudstackTestCase):
         """
         if self.setup_failed == True:
             self.fail("Setup incomplete")
+        if self.default_network:
+            self.skipTest("HA cluster on shared network requires external ip address, skipping it")
         global k8s_cluster
         k8s_cluster = self.getValidKubernetesCluster(1, 2)
 
@@ -572,6 +588,8 @@ class TestKubernetesCluster(cloudstackTestCase):
         createKubernetesClusterCmd.noderootdisksize = 10
         createKubernetesClusterCmd.account = self.account.name
         createKubernetesClusterCmd.domainid = self.domain.id
+        if self.default_network:
+            createKubernetesClusterCmd.networkid = self.default_network.id
         clusterResponse = self.apiclient.createKubernetesCluster(createKubernetesClusterCmd)
         if not clusterResponse:
             self.cleanup.append(clusterResponse)