Skip to content

Commit

Permalink
Merge pull request #537 from openvstorage/physical_roles
Browse files Browse the repository at this point in the history
Get nodes by roles
  • Loading branch information
Philippe authored May 29, 2017
2 parents d57a1ff + 6edd2f2 commit b4ab706
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions ci/scenario_helpers/ci_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,21 @@ def get_shell_user(cls):
'password': cls.SETUP_CFG['ci']['user']['shell']['password']}

@classmethod
def get_storagerouters_for_ha(cls):
def get_storagerouters_by_role(cls):
"""
Gets storagerouters based on roles
:return:
"""
voldr_str_1 = None # Will act as volumedriver node
voldr_str_2 = None # Will act as volumedriver node
compute_str = None # Will act as compute node
for node_ip, node_details in cls.PARENT_HYPERVISOR_INFO['vms'].iteritems():
if isinstance(cls.PARENT_HYPERVISOR_INFO, dict): # Hypervisor section is filled in -> VM environment
nodes_info = cls.PARENT_HYPERVISOR_INFO['vms']
elif cls.SETUP_CFG['ci'].get('nodes') is not None: # Physical node section -> Physical environment
nodes_info = cls.SETUP_CFG['ci']['nodes']
else:
raise RuntimeError('Unable to fetch node information. Either hypervisor section or node section is missing!')
for node_ip, node_details in nodes_info.iteritems():
if node_details['role'] == "VOLDRV":
if voldr_str_1 is None:
voldr_str_1 = StoragerouterHelper.get_storagerouter_by_ip(node_ip)
Expand Down
2 changes: 1 addition & 1 deletion ci/scenarios/edge/reroute/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def start_test(cls):

@classmethod
def setup(cls, logger=LOGGER):
destination_str, source_str, compute_str = cls.get_storagerouters_for_ha()
destination_str, source_str, compute_str = cls.get_storagerouters_by_role()
destination_storagedriver = None
source_storagedriver = None
if len(source_str.regular_domains) == 0:
Expand Down
2 changes: 1 addition & 1 deletion ci/scenarios/hypervisor/automated_ha/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def setup(cls, logger=LOGGER):
#################
# PREREQUISITES #
#################
destination_str, source_str, compute_str = cls.get_storagerouters_for_ha()
destination_str, source_str, compute_str = cls.get_storagerouters_by_role()
destination_storagedriver = None
source_storagedriver = None
if len(source_str.regular_domains) == 0:
Expand Down
2 changes: 1 addition & 1 deletion ci/scenarios/vDisk/advanced_dtl_vdisk_test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def setup(cls, logger=LOGGER):
#################
# PREREQUISITES #
#################
destination_str, source_str, compute_str = cls.get_storagerouters_for_ha()
destination_str, source_str, compute_str = cls.get_storagerouters_by_role()
destination_storagedriver = None
source_storagedriver = None
if len(source_str.regular_domains) == 0:
Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build-Depends: python (>= 2.7.2)
Package: openvstorage-test
Architecture: amd64
Depends: blktap-dkms (>= 2.0.93), libvirt-bin (>= 1.3.1-0), genisoimage (>= 9:1.1.11),
openvstorage (>= 2.8), openvstorage (<< 2.10), openvstorage-automation-lib (>= 0.2),
openvstorage (>= 2.8), openvstorage (<< 2.10), openvstorage-automation-lib (>= 0.2), screen (>=4.3.1),
openvstorage-automation-lib (<< 0.3), openvstorage-health-check (>= 3.3), openvstorage-health-check (<< 3.4)
Description: openvStorage autotest suite
Automatic tests for the Open vStorage product

0 comments on commit b4ab706

Please sign in to comment.