Skip to content

Commit

Permalink
OS Test: Make number of projects configurable.
Browse files Browse the repository at this point in the history
Test config option 'n_projects' allows specifying how many projects will
be created during the test.

Signed-off-by: Martin Kalcok <[email protected]>
  • Loading branch information
mkalcok committed Sep 26, 2023
1 parent 086cdb0 commit 9d006a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion ovn-tester/cms/openstack/tests/base_openstack.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging

from dataclasses import dataclass

from ovn_ext_cmd import ExtCmd
from ovn_context import Context
from ovn_workload import ChassisNode
Expand All @@ -9,9 +11,17 @@
log = logging.getLogger(__name__)


@dataclass
class BaseOpenstackConfig:

n_projects: int = 1


class BaseOpenstack(ExtCmd):
def __init__(self, config, central_node, worker_nodes, global_cfg):
super().__init__(config, central_node, worker_nodes)
test_config = config.get("base_openstack")
self.config = BaseOpenstackConfig(**test_config)

def run(self, ovn: OpenStackCloud, global_cfg):
# create ovn topology
Expand All @@ -25,4 +35,5 @@ def run(self, ovn: OpenStackCloud, global_cfg):
)
worker_node.provision(ovn)

_ = ovn.new_project(gw_nodes=ovn.worker_nodes)
for _ in range(self.config.n_projects):
_ = ovn.new_project(gw_nodes=ovn.worker_nodes)
2 changes: 1 addition & 1 deletion test-scenarios/openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ cluster:
n_workers: 3

base_openstack:
foo: bar
n_projects: 3

0 comments on commit 9d006a3

Please sign in to comment.