Skip to content

Commit

Permalink
OS Test: Spawn VMs and run ping in base scenario
Browse files Browse the repository at this point in the history
BaseOpenstack scenario spawns projects and VMs according to the config and
runs full mesh ping test between VM hosts in each project.

Signed-off-by: Martin Kalcok <[email protected]>
  • Loading branch information
mkalcok committed Sep 30, 2023
1 parent 118529a commit 774331b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 13 additions & 2 deletions ovn-tester/cms/openstack/tests/base_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

@dataclass
class BaseOpenstackConfig:

n_projects: int = 1
n_gws_per_project: int = 1
n_vms_per_project: int = 3


class BaseOpenstack(ExtCmd):
Expand All @@ -27,7 +27,7 @@ def __init__(self, config, central_node, worker_nodes, global_cfg):
def run(self, ovn: OpenStackCloud, global_cfg):
# create ovn topology
worker_count = len(ovn.worker_nodes)
with Context(ovn, "base_cluster_bringup", worker_count) as ctx:
with Context(ovn, "base_openstack_bringup", worker_count) as ctx:
for i in ctx:
worker_node: ChassisNode = ovn.worker_nodes[i]
log.info(
Expand All @@ -36,5 +36,16 @@ def run(self, ovn: OpenStackCloud, global_cfg):
)
worker_node.provision(ovn)

with Context(ovn, "base_openstack_provision") as ctx:
for _ in range(self.config.n_projects):
_ = ovn.new_project(gw_nodes=self.config.n_gws_per_project)

for project in ovn.projects:
for index in range(self.config.n_vms_per_project):
ovn.add_vm_to_project(
project, f"{project.uuid[:6]}-{index}"
)

with Context(ovn, "base_openstack"):
for project in ovn.projects:
ovn.mesh_ping_ports(project.vm_ports)
5 changes: 3 additions & 2 deletions test-scenarios/openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ cluster:
n_workers: 3

base_openstack:
n_projects: 3
n_gws_per_project: 3
n_projects: 20
n_gws_per_project: 3
n_vms_per_project: 10

0 comments on commit 774331b

Please sign in to comment.