Skip to content

Commit

Permalink
Merge pull request #188 from LorenzoBianconi/ovn-ic-fixes
Browse files Browse the repository at this point in the history
ovn-tester: do not create transit switch in non-ic mode
  • Loading branch information
dceara authored Dec 7, 2023
2 parents 467e0fa + 5fd7e7a commit 45e5df3
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ def __init__(self, config, clusters, global_cfg):
self.config = ClusterBringupCfg(
n_pods_per_node=test_config.get('n_pods_per_node', 0),
)
self.ic_cluster = clusters[0] if len(clusters) > 1 else None

def create_transit_switch(self, cluster):
cluster.icnbctl.ts_add()
def create_transit_switch(self):
if self.ic_cluster:
self.ic_cluster.icnbctl.ts_add()

def connect_transit_switch(self, cluster):
if self.ic_cluster is None:
return
uuid = cluster.nbctl.ls_get_uuid('ts', 10)
cluster.ts_switch = LSwitch(
name='ts',
Expand All @@ -44,27 +48,28 @@ def connect_transit_switch(self, cluster):
)

def check_ic_connectivity(self, clusters):
ic_cluster = clusters[0]
if self.ic_cluster is None:
return
for cluster in clusters:
if ic_cluster == cluster:
if self.ic_cluster == cluster:
continue
for w in cluster.worker_nodes:
port = w.lports[0]
if port.ip:
ic_cluster.worker_nodes[0].run_ping(
ic_cluster,
ic_cluster.worker_nodes[0].lports[0].name,
self.ic_cluster.worker_nodes[0].run_ping(
self.ic_cluster,
self.ic_cluster.worker_nodes[0].lports[0].name,
port.ip,
)
if port.ip6:
ic_cluster.worker_nodes[0].run_ping(
ic_cluster,
ic_cluster.worker_nodes[0].lports[0].name,
self.ic_cluster.worker_nodes[0].run_ping(
self.ic_cluster,
self.ic_cluster.worker_nodes[0].lports[0].name,
port.ip6,
)

def run(self, clusters, global_cfg):
self.create_transit_switch(clusters[0])
self.create_transit_switch()

for c, cluster in enumerate(clusters):
# create ovn topology
Expand Down

0 comments on commit 45e5df3

Please sign in to comment.