Skip to content

Commit f4837a7

Browse files
authored
Merge pull request #78 from MichaelMcAleer/91/migrate_tool
91/migrate tool
2 parents ac55c1e + 002cd38 commit f4837a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8112
-4223
lines changed

ChangeLog

Lines changed: 337 additions & 336 deletions
Large diffs are not rendered by default.

PyU4V/tests/ci_tests/test_pyu4v_ci_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ def test_get_headroom(self):
204204
for i in range(len(headroom_list)):
205205
self.assertTrue(
206206
set({'emulation': 'CKD'}.items()).issubset(
207-
set(headroom_list[i].items())) or
208-
set({'emulation': 'FBA'}.items()).issubset(
207+
set(headroom_list[i].items()))
208+
or set({'emulation': 'FBA'}.items()).issubset(
209209
set(headroom_list[i].items())))
210210

211211
def test_get_iterator_results(self):

PyU4V/tests/ci_tests/test_pyu4v_ci_provisioning.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,8 +1105,9 @@ def test_get_iscsi_ip_address_and_iqn(self):
11051105
if ip_addresses:
11061106
self.assertIsInstance(ip_addresses, list)
11071107
for ip in ip_addresses:
1108-
valid_ip = (self.provisioning.check_ipv4(ip) or
1109-
self.provisioning.check_ipv6(ip))
1108+
valid_ip = (
1109+
self.provisioning.check_ipv4(
1110+
ip) or self.provisioning.check_ipv6(ip))
11101111
self.assertIsInstance(ip, str)
11111112
self.assertTrue(valid_ip)
11121113
if iqn:

PyU4V/tests/ci_tests/test_pyu4v_ci_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def test_logger_configured(self):
146146
# Compile regex search pattern for matching the current time (to the
147147
# minute)
148148
time_re_search = re.compile(
149-
r"\A" + time.strftime("%Y-%m-%d") + r"\s" +
150-
time.strftime("%H:%M") + r":\d{2},\d{3}")
149+
r"\A" + time.strftime("%Y-%m-%d")
150+
+ r"\s" + time.strftime("%H:%M") + r":\d{2},\d{3}")
151151
# Open PyU4V.log file and read the lines withing
152152
with open(log_path, newline='') as log_file:
153153
log_lines = log_file.readlines()
@@ -315,8 +315,8 @@ def _my_test_func():
315315
# Create regex search patterns
316316
reg_time = r'\A' + c_date + r'\s' + c_time + r':\d{2},\d{3}\s-\s'
317317
reg_lvl = r'PyU4V\.action\_required\s-\sWARNING\s-\s'
318-
reg_msg = (c_name + r'\.' + f_name + r'[\w\s]{31}' + str(end_ver) +
319-
r'\.[\w\s]{46}' + str(start_ver) + r'[\w\s]{14}\.$')
318+
reg_msg = (c_name + r'\.' + f_name + r'[\w\s]{31}' + str(end_ver)
319+
+ r'\.[\w\s]{46}' + str(start_ver) + r'[\w\s]{14}\.$')
320320
# Compile regex search query
321321
time_re_search = re.compile((reg_time + reg_lvl + reg_msg))
322322
# Run the dummy function to output notice to log file
@@ -359,9 +359,9 @@ def _my_test_func():
359359
# Create regex search patterns
360360
reg_time = r'\A' + c_date + r'\s' + c_time + r':\d{2},\d{3}\s-\s'
361361
reg_lvl = r'PyU4V\.action\_required\s-\sWARNING\s-\s'
362-
reg_msg = (c_name + r'\.' + f_name + r'[\w\s]{31}' + str(end_ver) +
363-
r'[\w\s]{23}' + f_path + r'\.[\w\s]{46}' +
364-
str(start_ver) + r'[\w\s]{14}\.$')
362+
reg_msg = (c_name + r'\.' + f_name + r'[\w\s]{31}' + str(end_ver)
363+
+ r'[\w\s]{23}' + f_path + r'\.[\w\s]{46}'
364+
+ str(start_ver) + r'[\w\s]{14}\.$')
365365
# Compile regex search query
366366
time_re_search = re.compile((reg_time + reg_lvl + reg_msg))
367367
# Run the dummy function to output notice to log file

PyU4V/tests/unit_tests/pyu4v_common_data.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,97 @@ class CommonData(object):
444444
tag_list = {'tag_name': ['CLBCK', 'Payroll']}
445445

446446
tagged_objects = {'array_ids': ['000297600111']}
447+
448+
# migrate array info
449+
m_array = '000197800123'
450+
m_portgroup = 'myportgroup'
451+
m_initiatorgroup = 'myinitiatorgroup'
452+
m_sg_name = 'mystoragegroup'
453+
m_host_name = 'myhost'
454+
455+
# Old masking views
456+
smis_mv_1 = 'OS-myhost-No_SLO-I-MV'
457+
smis_mv_2 = 'OS-myhost-SRP_1-Diamond-NONE-I-CD-MV'
458+
smis_mv_3 = 'OS-myhost-SRP_1-Diamond-DSS-I-MV'
459+
smis_mv_4 = 'OS-myhost-SRP_1-Silver-NONE-I-MV'
460+
smis_mv_5 = 'OS-myhost-SRP_1-Bronze-OLTP-I-CD-MV'
461+
smis_mv_6 = 'OS-myhost-SRP_1-Diamond-OLTP-I-RE-MV'
462+
smis_mv_7 = 'OS-host-with-dashes-No_SLO-I-MV'
463+
smis_mv_8 = 'OS-host-with-dashes-SRP_1-Diamond-NONE-I-MV'
464+
465+
# New masking view
466+
rest_mv_1 = 'OS-myhost-I-myportgroup-MV'
467+
rest_mv_2 = 'OS-myhost-I-portgroup-with-dashes-MV'
468+
rest_mv_3 = 'OS-host-with-dash-I-myportgroup-MV'
469+
470+
# Old storage groups
471+
smis_sg_1 = 'OS-myhost-No_SLO-I-SG'
472+
smis_sg_2 = 'OS-myhost-SRP_1-Diamond-NONE-I-SG'
473+
smis_sg_3 = 'OS-myhost-SRP_1-Diamond-DSS-I-SG'
474+
smis_sg_4 = 'OS-myhost-SRP_1-Silver-NONE-I-CD-SG'
475+
smis_sg_5 = 'OS-myhost-SRP_1-Diamond-OLTP-I-CD-SG'
476+
smis_sg_6 = 'OS-myhost-SRP_1-Bronze-OLTP-I-RE-SG'
477+
smis_sg_7 = 'OS-host-with_dashes-SRP_1-Diamond-OLTP-I-RE-SG'
478+
smis_sg_8 = 'OS-myhost-SRP_1-Diamond-NONE-I-CD-SG'
479+
480+
# New parent storage groups
481+
rest_parent_sg = 'OS-myhost-I-myportgroup-SG'
482+
483+
# New storage groups
484+
rest_sg_1 = 'OS-myhost-No_SLO-os-iscsi-pg'
485+
rest_sg_2 = 'OS-myhost-SRP_1-DiamodNONE-os-iscsi-pg-CD'
486+
rest_sg_3 = 'OS-myhost-SRP_1-DiamodNONE-os-iscsi-pg'
487+
rest_sg_4 = 'OS-myhost-SRP_1-DiamodOLTP-os-iscsi-pg-RE'
488+
rest_sg_5 = 'OS-host-with-dashes-SRP_1-DiamodOLTP-myportgroup-RE'
489+
rest_sg_6 = 'OS-myhost-SRP_1-DiamodOLTP-myportgroup-CD'
490+
491+
m_storagegroup = {'slo': 'Diamond',
492+
'workload': 'OLTP',
493+
'storageGroupId': 'test'}
494+
495+
m_maskingview = {'portGroupId': m_portgroup,
496+
'hostId': m_host_name,
497+
'storageGroupId': rest_parent_sg,
498+
'maskingViewId': rest_mv_1}
499+
500+
element_dict = {'new_mv_name': 'OS-myhost-I-myportgroup-MV',
501+
'workload': 'NONE',
502+
'new_sg_name': 'OS-myhost-SRP_1-DiamodNONE-myportgroup',
503+
'srp': 'SRP_1', 'port_group': 'myportgroup',
504+
'initiator_group': 'myinitiatorgroup',
505+
'new_sg_parent_name': 'OS-myhost-I-myportgroup-SG',
506+
'service_level': 'Diamond'}
507+
508+
element_dict_revert = {
509+
'service_level': 'Diamond',
510+
'port_group': 'myportgroup',
511+
'initiator_group': 'myinitiatorgroup',
512+
'srp': 'SRP_1',
513+
'new_mv_name': 'OS-myhost-SRP_1-Diamond-NONE-I-CD-MV',
514+
'new_sg_name': 'OS-myhost-SRP_1-Diamond-NONE-I-CD-SG',
515+
'workload': 'NONE'}
516+
517+
mv_components = {'portGroupId': m_portgroup,
518+
'hostId': m_host_name,
519+
'storageGroupId': rest_sg_1,
520+
'maskingViewId': rest_mv_1}
521+
522+
device_list = ['0064F', '0088E', '00890', '00891', '00DF2', '00DF3']
523+
524+
host_io_limit_source = {'host_io_limit_mb_sec': '2000',
525+
'host_io_limit_io_sec': '2000',
526+
'dynamicDistribution': 'Always'}
527+
528+
host_io_limit_target = {'host_io_limit_mb_sec': '4000',
529+
'host_io_limit_io_sec': '4000',
530+
'dynamicDistribution': 'Never'}
531+
532+
source_sg_details = {'storageGroupId': smis_sg_2,
533+
'slo': 'Diamond',
534+
'srp': 'SRP_1',
535+
'hostIOLimit': host_io_limit_source}
536+
537+
target_sg_details = {'storageGroupId': rest_sg_3,
538+
'slo': 'Diamond',
539+
'srp': 'SRP_1',
540+
'hostIOLimit': host_io_limit_target}

0 commit comments

Comments
 (0)