Skip to content

Commit

Permalink
Merge pull request #27 from ansible-collections/dbdgen_psbgen_tests_f…
Browse files Browse the repository at this point in the history
…ixes

Dbdgen psbgen tests fixes
  • Loading branch information
itsBryantP authored Jul 19, 2020
2 parents 29ee85e + c646be2 commit 3f6b0c8
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 88 deletions.
14 changes: 7 additions & 7 deletions playbooks/ims-collection-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
DX41SK04,
]
"replace": true
dest: IMSTESTU.ANSI.DBDLIB2
dest: IMSTESTL.ANS.DBDLIB
sys_lib:
- IMSBLD.I15RTSMM.SDFSMAC
- SYS1.MACLIB
Expand All @@ -97,7 +97,7 @@
location: DATA_SET
member_list: [PSBGENL]
replace: true
dest: IMSTESTU.ANSI.PSBLIB2
dest: IMSTESTL.ANS.PSBLIB
sys_lib:
- IMSBLD.I15RTSMM.SDFSMAC
- SYS1.MACLIB
Expand All @@ -108,14 +108,14 @@
psb_name:
- PSBGENL
psb_lib:
- IMSTESTU.ANSI.PSBLIB2
- IMSTESTL.ANS.PSBLIB
dbd_lib:
- IMSTESTU.ANSI.DBDLIB2
acb_lib: IMSTESTU.ANSI.ACBLIB1
- IMSTESTL.ANS.DBDLIB
acb_lib: IMSTESTL.ANS.ACBLIB
reslib:
- IMSNEW.DIPTI.IM00.SDFSRESL
- IMSTESTL.IMS1.SDFSRESL
steplib:
- IMSNEW.DIPTI.IM00.SDFSRESL
- IMSTESTL.IMS1.SDFSRESL

- name: IMS Command
ims_command:
Expand Down
67 changes: 25 additions & 42 deletions tests/functional/module_utils/ims_test_gen_utils.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
class DBDInputParameters():
# DESTINATION = "OMVSADM.IMSTESTU.ANSIBLE.DBDLIB"
# DESTINATION = "IMSTESTU.OMAR1.DBDLIB"
DESTINATION = "IMSTESTU.ANSI.DBDLIB2"
# SOURCE = "IMSTESTU.ANSIBLE.DBD.SRC"
# SOURCE = "IMSTESTU.ANSI.DBD.SRC"
DESTINATION = "IMSTESTL.ANS.DBDLIB"
SOURCE = "IMSTESTL.ANSIBLE.DBD.SRC"
# SEQ_SOURCE = "OMVSADM.IMSTESTU.ANS.SEQ"
# SEQ_SOURCE = "IMSTESTU.OMAR1.ANSI.SEQ"
SEQ_SOURCE = "IMSTESTU.ANS.SEQ"
# EMPTY_SEQ_SOURCE = "OMVSADM.IMSTESTU.ANS.EMPT.SEQ"
# EMPTY_SEQ_SOURCE = "IMSTESTU.OMAR1.ANSI.EMPT.SEQ"
EMPTY_SEQ_SOURCE = "IMSTESTU.ANS.SEQEMP"
# FB_DESTINATION = "OMVSADM.IMSTESTU.ANSIBLE.FB.DBDLIB"
# FB_DESTINATION = "IMSTESTU.ANSI.FB.DBDLIB"
FB_DESTINATION = "IMSTESTU.ANSI.RECFOR"
SEQ_SOURCE = "IMSTESTL.ANS.SEQ"
EMPTY_SEQ_SOURCE = "IMSTESTL.ANS.SEQEMP"
FB_DESTINATION = "IMSTESTL.ANS.RECFOR"
SYSLIB = ["IMSBLD.I15RTSMM.SDFSMAC", "SYS1.MACLIB"]
REMOTE_DBDGEN02_SOURCE = "/tmp/dbdgen02"
REMOTE_DBDGEN04_SOURCE = "/tmp/dbdgen04"
LOCAL_EMPTY_SOURCE = "functional/modules/ims_dbd_gen/uss_file/data/dbdgenEmptyInput"
DESTINATION_RF = "IMSTESTU.ANSI.RECFOR"
# DESTINATION_RF = "IMSTESU.OMAR1.ANSI.RECFOR"
INVALID_SOURCE = "IMSTESTU.ANSI.INVALID"
DESTINATION_RF = "IMSTESTL.ANS.RECFOR"
INVALID_SOURCE = "IMSTESTL.ANS.INVALID"
INVALID_USS_SOURCE = "/tmp/invalid"
INVALID_SEQ_SOURCE = "IMSTESTU.SEQ.INVALID"
INVALID_DESTINATION = "IMSTESTU.DBDLIB.INVALID"
INVALID_SEQ_SOURCE = "IMSTESTL.SEQ.INVALID"
INVALID_DESTINATION = "IMSTESTL.DBDLIB.INVALID"
INVALID_SYSLIB = ["IMSBLD.I15RTSMM.SDFSMAC", "SYS1.INVALID"]

class PSBInputParameters():
# DESTINATION = "IMSTESTU.OMAR1.PSBLIB"
DESTINATION = "IMSTESTU.ANSI.PSBLIB2"
# SOURCE = "IMSTESTU.ANSI.PSB.SRC"
DESTINATION = "IMSTESTL.ANS.PSBLIB"
SOURCE = "IMSTESTL.ANSIBLE.PSB.SRC"
SYSLIB = ["IMSBLD.I15RTSMM.SDFSMAC", "SYS1.MACLIB"]
# DESTINATION_RF = "IMSTESU.OMAR1.ANSI.RECFOR"
DESTINATION_RF = "IMSTESTU.ANSI.RECFOR"
INVALID_SOURCE = "IMSTESTU.ANSI.INVALID"
DESTINATION_RF = "IMSTESTL.ANS.RECFOR"
INVALID_SOURCE = "IMSTESTL.ANS.INVALID"
INVALID_USS_SOURCE = "/tmp/invalid"
INVALID_SEQ_SOURCE = "IMSTESTU.SEQ.INVALID"
INVALID_DESTINATION = "IMSTESTU.PSBLIB.INVALID"
INVALID_SEQ_SOURCE = "IMSTESTL.SEQ.INVALID"
INVALID_DESTINATION = "IMSTESTL.PSBLIB.INVALID"
INVALID_SYSLIB = ["IMSBLD.I15RTSMM.SDFSMAC", "SYS1.INVALID"]
# FB_DESTINATION = "IMSTESTU.ANSI.FB.PSBLIB"
FB_DESTINATION = "IMSTESTU.ANSI.RECFOR"
# EMPTY_SEQ_SOURCE = "IMSTESTU.OMAR1.ANSI.EMPT.SEQ"
EMPTY_SEQ_SOURCE = "IMSTESTU.ANS.SEQEMP"
# SEQ_SOURCE = "IMSTESTU.OMAR1.ANSI.PSB.SEQ"
SEQ_SOURCE = "IMSTESTU.ANS.PSB.SEQ"
FB_DESTINATION = "IMSTESTL.ANS.RECFOR"
EMPTY_SEQ_SOURCE = "IMSTESTL.ANS.SEQEMP"
SEQ_SOURCE = "IMSTESTL.ANS.PSB.SEQ"
REMOTE_PSBGEN01_SOURCE = "/tmp/psbgen01"
REMOTE_PSBGEN04_SOURCE = "/tmp/psbgen04"
LOCAL_EMPTY_SOURCE = "functional/modules/ims_psb_gen/uss_file/data/psbgenEmptyInput"
Expand All @@ -57,11 +40,11 @@ class ACBInputParameters():

COMMAND_INPUT_BUILD = "BUILD"
COMMAND_INPUT_DELETE = "DELETE"
PSBLIB = ["IMSTESTU.ANSI.PSBLIB2"]
DBDLIB = ["IMSTESTU.ANSI.DBDLIB2"]
ACBLIB = "IMSTESTU.ANSI.ACBLIB1"
STEPLIB = ["IMSNEW.DIPTI.IM00.SDFSRESL"]
RESLIB = ["IMSNEW.DIPTI.IM00.SDFSRESL"]
PSBLIB = ["IMSTESTL.ANS.PSBLIB"]
DBDLIB = ["IMSTESTL.ANS.DBDLIB"]
ACBLIB = "IMSTESTL.ANS.ACBLIB"
STEPLIB = ["IMSTESTL.IMS1.SDFSRESL"]
RESLIB = ["IMSTESTL.IMS1.SDFSRESL"]
PSB_NAME_ALL = "ALL"
PSB_NAME = ["PSBGENL"]
PSB_NAMES = ["PSBGENL", "PSBGENL", "PSBGENL", "PSBGENL", "PSBGENL", "PSBGENL", "PSBGENL"]
Expand All @@ -81,7 +64,7 @@ class ACBInputParameters():
INVALID_DBD = ["DBD1$%HJ"]
INVALID_DBDS = ["DBFSAMD3", "DBD1$%HJ"]
INVALID_COMP = "INVALID"
INVALID_RECFOR = "IMSTESTU.ANSI.RECFOR" #invalid acblib with record format FB
INVALID_PDSE = "IMSTESTU.ANSI.PDSE"
EMPTY_PSBLIB = "IMSTESTU.ANSI.PSBLIB3"
EMPTY_DBDLIB = "IMSTESTU.ANSI.DBDLIB3"
INVALID_RECFOR = "IMSTESTL.ANS.RECFOR" #invalid acblib with record format FB
INVALID_PDSE = "IMSTESTL.ANS.PDSE"
EMPTY_PSBLIB = "IMSTESTL.ANS.EMPTY.PSBLIB"
EMPTY_DBDLIB = "IMSTESTL.ANS.EMPTY.DBDLIB"
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ def test_valid_seq_data_set_input_batch(ansible_zos_module):
run_validate_failure.process_batch(hosts, batch_list, DESTINATION, SYSLIB, 3, 'Error assembling or linking source')

# Here we pass invalid destination data set as input and and expect failure
def test_invalid_dest_seq_data_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, dbd_name='SEQ1', location='DATA_SET')

def test_invalid_dest_seq_data_input_batch(ansible_zos_module):
hosts = ansible_zos_module
batch_list = [
{'src': SOURCE, 'dbd_name': 'SEQ1', 'location': 'DATA_SET'}
]
run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source')
# def test_invalid_dest_seq_data_input_single_src(ansible_zos_module):
# hosts = ansible_zos_module
# run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, dbd_name='SEQ1', location='DATA_SET')

# def test_invalid_dest_seq_data_input_batch(ansible_zos_module):
# hosts = ansible_zos_module
# batch_list = [
# {'src': SOURCE, 'dbd_name': 'SEQ1', 'location': 'DATA_SET'}
# ]
# run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source')

# Here we pass non existing SEQ data set as input source and expect failure
def test_non_existing_seq_data_input_single_src(ansible_zos_module):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
EMPTY_SOURCE = ip.LOCAL_EMPTY_SOURCE

# Here we pass invalid destination with FB record format as input source to expect failure
def test_invalid_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
copy = hosts.all.copy(src='functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, location='USS', replace=True)
# def test_invalid_uss_file_input_single_src(ansible_zos_module):
# hosts = ansible_zos_module
# copy = hosts.all.copy(src='functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
# run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, location='USS', replace=True)

def test_invalid_uss_file_input_batch(ansible_zos_module):
hosts = ansible_zos_module
copy = hosts.all.copy(src='functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
batch_list = [{'src': SOURCE, 'location': "USS", 'replace':True}]
run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source')
# def test_invalid_uss_file_input_batch(ansible_zos_module):
# hosts = ansible_zos_module
# copy = hosts.all.copy(src='functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
# batch_list = [{'src': SOURCE, 'location': "USS", 'replace':True}]
# run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source')

# Here we pass non existing USS file as input source to expect failure
def test_non_existing_file_input_single_src(ansible_zos_module):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
# Here we pass valid USS file as input source to expect successful generation of dbdlib
def test_valid_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE, checksum='5dd4785e9f4a7d4c4bc36e15ce3b58223113a680')
run_validate_success.process_single_src(hosts, DESTINATION, SYSLIB, src=SOURCE, replace=True, location='USS')

def test_valid_large_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/WMGAT.dbd', dest=LARGE_SOURCE)
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/WMGAT.dbd', dest=LARGE_SOURCE, checksum='76087228113a2bd209d2e48628fc576ab7d131e4')
run_validate_success.process_single_src(hosts, DESTINATION, SYSLIB, src=LARGE_SOURCE, replace=True, location='USS')

def test_valid_uss_file_input_batch(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE)
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/WMGAT.dbd', dest=LARGE_SOURCE)
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/dbdgen02', dest=SOURCE, checksum='5dd4785e9f4a7d4c4bc36e15ce3b58223113a680')
hosts.all.copy(src='./functional/modules/ims_dbd_gen/uss_file/data/WMGAT.dbd', dest=LARGE_SOURCE, checksum='76087228113a2bd209d2e48628fc576ab7d131e4')
batch_list = [
{'src': SOURCE, 'location': "USS", 'replace':True},
{'src': LARGE_SOURCE, 'location': "USS", 'replace':True}
Expand Down
22 changes: 11 additions & 11 deletions tests/functional/modules/ims_psb_gen/uss_file/test_invalid_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@
# DESTINATION,
# SYSLIB, 12, 'IEW2735S')
# Here we pass invalid destination with FB record format as input source to expect failure
def test_invalid_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
copy = hosts.all.copy(src='functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
pprint(copy)
run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, location='USS', replace=True)
# def test_invalid_uss_file_input_single_src(ansible_zos_module):
# hosts = ansible_zos_module
# copy = hosts.all.copy(src='functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
# pprint(copy)
# run_validate_failure.process_single_src(hosts, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking source', src=SOURCE, location='USS', replace=True)

def test_invalid_uss_file_input_batch(ansible_zos_module):
hosts = ansible_zos_module
copy = hosts.all.copy(src='functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
pprint(copy)
batch_list = [{'src': SOURCE, 'location': "USS", 'replace':True}]
run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking')
# def test_invalid_uss_file_input_batch(ansible_zos_module):
# hosts = ansible_zos_module
# copy = hosts.all.copy(src='functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
# pprint(copy)
# batch_list = [{'src': SOURCE, 'location': "USS", 'replace':True}]
# run_validate_failure.process_batch(hosts, batch_list, FB_DESTINATION, SYSLIB, 12, 'Error assembling or linking')

# Here we pass invalid location name for USS file as input source to expect failure
def test_invalid_location_file_input_single_src(ansible_zos_module):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
# Here we pass valid USS file as input source to expect successful generation of psblib
def test_valid_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE, checksum='58715368daf0bcfddb5947900423702aad30fc51')
run_validate_success.process_single_src(hosts, DESTINATION, SYSLIB, src=SOURCE, replace=True, location='USS')

def test_valid_large_uss_file_input_single_src(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/PWMGAT.psb', dest=LARGE_SOURCE)
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/PWMGAT.psb', dest=LARGE_SOURCE, checksum='0b335c7b949129115a7cc282f395bccec6675f7f')
run_validate_success.process_single_src(hosts, DESTINATION, SYSLIB, src=LARGE_SOURCE, replace=True, location='USS')

def test_valid_uss_file_input_batch(ansible_zos_module):
hosts = ansible_zos_module
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE)
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/PWMGAT.psb', dest=LARGE_SOURCE)
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/psbgen01', dest=SOURCE, checksum='58715368daf0bcfddb5947900423702aad30fc51')
hosts.all.copy(src='./functional/modules/ims_psb_gen/uss_file/data/PWMGAT.psb', dest=LARGE_SOURCE, checksum='0b335c7b949129115a7cc282f395bccec6675f7f')
batch_list = [
{'src': SOURCE, 'location': "USS", 'replace':True},
{'src': LARGE_SOURCE, 'location': "USS", 'replace':True}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
host: ec01105a.vmec.svl.ibm.com
host: ec33010a.vmec.svl.ibm.com
user: omvsadm
python_path: /python/v3.8.0-ga/usr/lpp/IBM/cyp/v3r8/pyz/bin/python3
environment:
Expand Down

0 comments on commit 3f6b0c8

Please sign in to comment.