Skip to content

Commit

Permalink
Redirected mqsc_file in playbooks, modified main.py
Browse files Browse the repository at this point in the history
Test playbooks run successfully (apart from test_web_console; separate issue), as they are directed to use MQSC files from /var/mqm/.

main.py is modified to provide feedback on which tests failed and clean up appropriately.
  • Loading branch information
James Page authored and James Page committed Feb 20, 2023
1 parent 9e511c0 commit 4b7b28f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
25 changes: 23 additions & 2 deletions ansible_collections/ibm/ibmmq/tests/playbooks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,39 @@
if rc.returncode == 0:
print("<---- All Tests Completed Successfully ---->")
else:
print("<---- cleanup_test.yml failed ---->")
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_web_console.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_misc.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_running_qmgr.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_present_qmgr.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_absent_qmgr.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- setup_test.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
else:
print("<---- test_install.yml failed ---->")
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
print("<---- test_install.yml failed ---->")
if rc.returncode != 0:
print("<---- FATAL: cleanup_test.yml failed ---->")
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
queue_manager:
qmname: qm1_misc_2
state: running
mqsc_file: mqsc_display
mqsc_file: '/var/mqm/mqsc_display'
register: testout_1
failed_when: False
- name: dump run output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
queue_manager:
qmname: 'qm1_present_mqsc'
state: 'present'
mqsc_file: mq-dev-config.mqsc
mqsc_file: '/var/mqm/mq-dev-config.mqsc'
register: testout_3
failed_when: False
- name: dump test output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
queue_manager:
qmname: 'qm1_running'
state: 'present'
mqsc_file: mqsc_display
mqsc_file: '/var/mqm/mqsc_display'
register: testout
failed_when: False
- name: dump test output
Expand All @@ -36,7 +36,7 @@
queue_manager:
qmname: 'qm1_running'
state: 'running'
mqsc_file: mqsc_display
mqsc_file: '/var/mqm/mqsc_display'
register: testout
failed_when: False
- name: dump test output
Expand Down

0 comments on commit 4b7b28f

Please sign in to comment.