Skip to content

Commit 4b7b28f

Browse files
James PageJames Page
James Page
authored and
James Page
committed
Redirected mqsc_file in playbooks, modified main.py
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.
1 parent 9e511c0 commit 4b7b28f

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

ansible_collections/ibm/ibmmq/tests/playbooks/main.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,39 @@
2121
if rc.returncode == 0:
2222
print("<---- All Tests Completed Successfully ---->")
2323
else:
24-
print("<---- cleanup_test.yml failed ---->")
24+
print("<---- FATAL: cleanup_test.yml failed ---->")
2525
else:
26+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
2627
print("<---- test_web_console.yml failed ---->")
28+
if rc.returncode != 0:
29+
print("<---- FATAL: cleanup_test.yml failed ---->")
2730
else:
31+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
2832
print("<---- test_misc.yml failed ---->")
33+
if rc.returncode != 0:
34+
print("<---- FATAL: cleanup_test.yml failed ---->")
2935
else:
36+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
3037
print("<---- test_running_qmgr.yml failed ---->")
38+
if rc.returncode != 0:
39+
print("<---- FATAL: cleanup_test.yml failed ---->")
3140
else:
41+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
3242
print("<---- test_present_qmgr.yml failed ---->")
43+
if rc.returncode != 0:
44+
print("<---- FATAL: cleanup_test.yml failed ---->")
3345
else:
46+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
3447
print("<---- test_absent_qmgr.yml failed ---->")
48+
if rc.returncode != 0:
49+
print("<---- FATAL: cleanup_test.yml failed ---->")
3550
else:
51+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
3652
print("<---- setup_test.yml failed ---->")
53+
if rc.returncode != 0:
54+
print("<---- FATAL: cleanup_test.yml failed ---->")
3755
else:
38-
print("<---- test_install.yml failed ---->")
56+
rc = subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'cleanup_test.yml'])
57+
print("<---- test_install.yml failed ---->")
58+
if rc.returncode != 0:
59+
print("<---- FATAL: cleanup_test.yml failed ---->")

ansible_collections/ibm/ibmmq/tests/playbooks/test_misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
queue_manager:
8989
qmname: qm1_misc_2
9090
state: running
91-
mqsc_file: mqsc_display
91+
mqsc_file: '/var/mqm/mqsc_display'
9292
register: testout_1
9393
failed_when: False
9494
- name: dump run output

ansible_collections/ibm/ibmmq/tests/playbooks/test_present_qmgr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
queue_manager:
6666
qmname: 'qm1_present_mqsc'
6767
state: 'present'
68-
mqsc_file: mq-dev-config.mqsc
68+
mqsc_file: '/var/mqm/mq-dev-config.mqsc'
6969
register: testout_3
7070
failed_when: False
7171
- name: dump test output

ansible_collections/ibm/ibmmq/tests/playbooks/test_running_qmgr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
queue_manager:
2020
qmname: 'qm1_running'
2121
state: 'present'
22-
mqsc_file: mqsc_display
22+
mqsc_file: '/var/mqm/mqsc_display'
2323
register: testout
2424
failed_when: False
2525
- name: dump test output
@@ -36,7 +36,7 @@
3636
queue_manager:
3737
qmname: 'qm1_running'
3838
state: 'running'
39-
mqsc_file: mqsc_display
39+
mqsc_file: '/var/mqm/mqsc_display'
4040
register: testout
4141
failed_when: False
4242
- name: dump test output

0 commit comments

Comments
 (0)