Skip to content

Commit

Permalink
Adding disktype while creating the CPG. The value of this parameter i…
Browse files Browse the repository at this point in the history
…s ssd for C8K array.
  • Loading branch information
dockerciuser committed Feb 7, 2017
1 parent eddb1b7 commit f785fe2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions config.ini
Expand Up @@ -6,6 +6,7 @@ unit=true
debug=false
3par_url=http://10.10.##.##:8008/api/v1
cpg_ldlayout_ha=3
disk_type=3
domain=UNIT_TEST_DOMAIN
missing_key_policy=AutoAddPolicy
# skip_file_persona: Set to true when using an array without File Persona
Expand Down
10 changes: 9 additions & 1 deletion test/HPE3ParClient_base.py
Expand Up @@ -71,7 +71,15 @@ class HPE3ParClientBaseTestCase(unittest.TestCase):

if 'cpg_ldlayout_ha' in config['TEST']:
CPG_LDLAYOUT_HA = int(config['TEST']['cpg_ldlayout_ha'])
CPG_OPTIONS = {'domain': DOMAIN, 'LDLayout': {'HA': CPG_LDLAYOUT_HA}}
if 'disk_type' in config['TEST']:
DISK_TYPE = int(config['TEST']['disk_type'])
CPG_OPTIONS = {'domain': DOMAIN,
'LDLayout': {'HA': CPG_LDLAYOUT_HA,
'diskPatterns': [{'diskType':
DISK_TYPE}]}}
else:
CPG_OPTIONS = {'domain': DOMAIN,
'LDLayout': {'HA': CPG_LDLAYOUT_HA}}
else:
CPG_LDLAYOUT_HA = None
CPG_OPTIONS = {'domain': DOMAIN}
Expand Down
16 changes: 13 additions & 3 deletions test/test_HPE3ParClient_CPG.py
Expand Up @@ -61,8 +61,14 @@ def test_1_create_CPG(self):
if self.CPG_LDLAYOUT_HA is None:
more_optional = {'LDLayout': {'RAIDType': 2}}
else:
more_optional = {'LDLayout': {'RAIDType': 2,
'HA': self.CPG_LDLAYOUT_HA}}
if self.DISK_TYPE is None:
more_optional = {'LDLayout': {'RAIDType': 2,
'HA': self.CPG_LDLAYOUT_HA}}
else:
more_optional = {'LDLayout': {'RAIDType': 2,
'HA': self.CPG_LDLAYOUT_HA,
'diskPatterns':
[{'diskType': self.DISK_TYPE}]}}
optional2.update(more_optional)
self.cl.createCPG(name, optional2)

Expand All @@ -77,7 +83,11 @@ def test_1_create_CPG(self):
def test_1_create_CPG_badDomain(self):
self.printHeader('create_CPG_badDomain')

optional = {'domain': 'BAD_DOMAIN'}
if self.DISK_TYPE is None:
optional = {'domain': 'BAD_DOMAIN'}
else:
optional = {'LDLayout': {'diskPatterns': [{
'diskType': self.DISK_TYPE}]}, 'domain': 'BAD_DOMAIN'}
self.assertRaises(exceptions.HTTPNotFound, self.cl.createCPG,
CPG_NAME1, optional)

Expand Down

0 comments on commit f785fe2

Please sign in to comment.