-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from fnordahl/add-cms-plugin
ovn-tester: Add CMS plugin support.
- Loading branch information
Showing
55 changed files
with
173 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/runtime | ||
/test_results | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Numan Siddique [email protected] | |
Files: * | ||
Copyright: (c) 2020 VMware, Inc. | ||
(c) 2020-2023 RedHat, Inc. | ||
(c) 2023 Canonical | ||
License: Apache-2.0 | ||
|
||
Files: logo.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .ovn_kubernetes import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from ovn_context import Context | ||
from ovn_workload import WorkerNode, Cluster | ||
from ovn_utils import DualStackSubnet | ||
|
||
|
||
OVN_HEATER_CMS_PLUGIN = 'OVNKubernetes' | ||
|
||
|
||
class OVNKubernetes: | ||
@staticmethod | ||
def create_nodes(cluster_config, workers): | ||
mgmt_net = cluster_config.node_net | ||
mgmt_ip = mgmt_net.ip + 2 | ||
internal_net = cluster_config.internal_net | ||
external_net = cluster_config.external_net | ||
gw_net = cluster_config.gw_net | ||
worker_nodes = [ | ||
WorkerNode( | ||
workers[i % len(workers)], | ||
f'ovn-scale-{i}', | ||
mgmt_net, | ||
mgmt_ip + i, | ||
DualStackSubnet.next(internal_net, i), | ||
DualStackSubnet.next(external_net, i), | ||
gw_net, | ||
i, | ||
) | ||
for i in range(cluster_config.n_workers) | ||
] | ||
return worker_nodes | ||
|
||
@staticmethod | ||
def prepare_test(central_node, worker_nodes, cluster_cfg, brex_cfg): | ||
ovn = Cluster(central_node, worker_nodes, cluster_cfg, brex_cfg) | ||
with Context(ovn, 'prepare_test'): | ||
ovn.start() | ||
return ovn |
33 changes: 33 additions & 0 deletions
33
ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from collections import namedtuple | ||
|
||
from ovn_context import Context | ||
from ovn_ext_cmd import ExtCmd | ||
|
||
ClusterBringupCfg = namedtuple('ClusterBringupCfg', ['n_pods_per_node']) | ||
|
||
|
||
class BaseClusterBringup(ExtCmd): | ||
def __init__(self, config, central_node, worker_nodes, global_cfg): | ||
super().__init__(config, central_node, worker_nodes) | ||
test_config = config.get('base_cluster_bringup', dict()) | ||
self.config = ClusterBringupCfg( | ||
n_pods_per_node=test_config.get('n_pods_per_node', 0), | ||
) | ||
|
||
def run(self, ovn, global_cfg): | ||
# create ovn topology | ||
with Context( | ||
ovn, 'base_cluster_bringup', len(ovn.worker_nodes) | ||
) as ctx: | ||
ovn.create_cluster_router('lr-cluster') | ||
ovn.create_cluster_join_switch('ls-join') | ||
ovn.create_cluster_load_balancer('lb-cluster', global_cfg) | ||
for i in ctx: | ||
worker = ovn.worker_nodes[i] | ||
worker.provision(ovn) | ||
ports = worker.provision_ports( | ||
ovn, self.config.n_pods_per_node | ||
) | ||
worker.provision_load_balancers(ovn, ports, global_cfg) | ||
worker.ping_ports(ovn, ports) | ||
ovn.provision_lb_group() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from cms.ovn_kubernetes.tests.netpol import NetPol | ||
|
||
|
||
class NetpolLarge(NetPol): | ||
def __init__(self, config, central_node, worker_nodes, global_cfg): | ||
super().__init__('netpol_large', config, central_node, worker_nodes) | ||
|
||
def run(self, ovn, global_cfg): | ||
self.init(ovn, global_cfg) | ||
super().run(ovn, global_cfg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from cms.ovn_kubernetes.tests.netpol import NetPol | ||
|
||
|
||
class NetpolSmall(NetPol): | ||
def __init__(self, config, central_node, worker_nodes, global_cfg): | ||
super().__init__('netpol_small', config, central_node, worker_nodes) | ||
|
||
def run(self, ovn, global_cfg): | ||
self.init(ovn, global_cfg) | ||
super().run(ovn, global_cfg, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.