Fix Namespace handling
With the handling of Namespaces now being dependent on Pods creation, tempests tests need to get updated to account for that. Change-Id: Id0879f128ca8c057ea6ec540fec0e76d656e7b13
This commit is contained in:
parent
ddef1710fb
commit
774fc6bae0
|
@ -104,5 +104,8 @@ kuryr_k8s_opts = [
|
||||||
" number LB members"),
|
" number LB members"),
|
||||||
cfg.BoolOpt("enable_reconciliation", default=False,
|
cfg.BoolOpt("enable_reconciliation", default=False,
|
||||||
help="Whether or not reconciliation is enabled"),
|
help="Whether or not reconciliation is enabled"),
|
||||||
|
cfg.BoolOpt("trigger_namespace_upon_pod", default=False,
|
||||||
|
help="Whether or not Namespace should be handled upon Pod "
|
||||||
|
"creation"),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -827,6 +827,8 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest):
|
||||||
def create_namespace(cls, name=None, labels=None,
|
def create_namespace(cls, name=None, labels=None,
|
||||||
wait_for_crd=True,
|
wait_for_crd=True,
|
||||||
timeout_period=consts.NS_TIMEOUT):
|
timeout_period=consts.NS_TIMEOUT):
|
||||||
|
if CONF.kuryr_kubernetes.trigger_namespace_upon_pod:
|
||||||
|
wait_for_crd = False
|
||||||
if not name:
|
if not name:
|
||||||
name = data_utils.rand_name(prefix='kuryr-namespace')
|
name = data_utils.rand_name(prefix='kuryr-namespace')
|
||||||
namespace = cls.k8s_client.V1Namespace()
|
namespace = cls.k8s_client.V1Namespace()
|
||||||
|
|
|
@ -148,6 +148,9 @@ class TestNetworkPolicyScenario(base.BaseKuryrScenarioTest,
|
||||||
def test_ipblock_network_policy_allow_except(self):
|
def test_ipblock_network_policy_allow_except(self):
|
||||||
namespace_name, namespace = self.create_namespace()
|
namespace_name, namespace = self.create_namespace()
|
||||||
self.addCleanup(self.delete_namespace, namespace_name)
|
self.addCleanup(self.delete_namespace, namespace_name)
|
||||||
|
pod_name, pod = self.create_pod(namespace=namespace_name)
|
||||||
|
self.addCleanup(self.delete_pod, pod_name, pod,
|
||||||
|
namespace=namespace_name)
|
||||||
|
|
||||||
if CONF.kuryr_kubernetes.kuryrnetworks:
|
if CONF.kuryr_kubernetes.kuryrnetworks:
|
||||||
cidr = self.get_kuryr_network_crds(
|
cidr = self.get_kuryr_network_crds(
|
||||||
|
|
|
@ -55,6 +55,9 @@ class TestNamespaceScenario(base.BaseKuryrScenarioTest):
|
||||||
|
|
||||||
self.assertIn(namespace_name, existing_namespaces)
|
self.assertIn(namespace_name, existing_namespaces)
|
||||||
|
|
||||||
|
pod_name, pod = self.create_pod(labels={"app": 'pod-label'},
|
||||||
|
namespace=namespace_name)
|
||||||
|
|
||||||
subnet_name = 'ns/' + namespace_name + '-subnet'
|
subnet_name = 'ns/' + namespace_name + '-subnet'
|
||||||
kuryr_net_crd_name = 'ns-' + namespace_name
|
kuryr_net_crd_name = 'ns-' + namespace_name
|
||||||
|
|
||||||
|
@ -82,8 +85,6 @@ class TestNamespaceScenario(base.BaseKuryrScenarioTest):
|
||||||
self.assertIn(kuryr_net_crd['spec']['netId'], net_id)
|
self.assertIn(kuryr_net_crd['spec']['netId'], net_id)
|
||||||
|
|
||||||
# Check namespace pod connectivity
|
# Check namespace pod connectivity
|
||||||
pod_name, pod = self.create_pod(labels={"app": 'pod-label'},
|
|
||||||
namespace=namespace_name)
|
|
||||||
self.create_setup_for_service_test(namespace=namespace_name,
|
self.create_setup_for_service_test(namespace=namespace_name,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
self.check_service_internal_connectivity(namespace=namespace_name,
|
self.check_service_internal_connectivity(namespace=namespace_name,
|
||||||
|
|
Loading…
Reference in New Issue