Skip to content

Commit 6a5c4e2

Browse files
committed
Add ITs for the scheme (http/https) being incorrect
1 parent b01a80c commit 6a5c4e2

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) IBM Corporation 2020
2+
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
3+
---
4+
- name: CMCI Integration Test
5+
collections:
6+
- ibm.ibm_zos_cics
7+
hosts: 'localhost'
8+
gather_facts: 'false'
9+
vars:
10+
http_port: 28953
11+
http_scope: IYCWEMW1
12+
13+
tasks:
14+
- name: test https with incorrect scheme
15+
ibm.ibm_zos_cics.cmci_get:
16+
cmci_host: '{{ cmci_host }}'
17+
cmci_port: '{{ cmci_port }}'
18+
cmci_user: '{{ cmci_user }}'
19+
cmci_password: '{{ cmci_password }}'
20+
21+
context: '{{ context }}'
22+
scope: '{{ scope }}'
23+
type: 'cicsprogram'
24+
scheme: 'http'
25+
insecure: true
26+
failed_when: false
27+
register: result
28+
29+
- name: debug https
30+
debug:
31+
msg: '{{ result.msg }}'
32+
33+
- name: assert https
34+
assert:
35+
that:
36+
- result.failed is false
37+
- result.msg == "Error performing CMCI request: (\"Connection aborted.\",
38+
RemoteDisconnected(\"Remote end closed connection without response\"))"
39+
40+
41+
- name: test http with incorrect scheme
42+
ibm.ibm_zos_cics.cmci_get:
43+
cmci_host: '{{ cmci_host }}'
44+
cmci_port: '{{ http_port }}'
45+
cmci_user: '{{ cmci_user }}'
46+
cmci_password: '{{ cmci_password }}'
47+
48+
context: '{{ context }}'
49+
scope: '{{ http_scope }}'
50+
type: 'cicsprogram'
51+
scheme: 'https'
52+
insecure: true
53+
failed_when: false
54+
register: result
55+
56+
- name: debug http
57+
debug:
58+
msg: '{{ result.msg }}'
59+
60+
- name: assert http
61+
assert:
62+
that:
63+
- result.failed is false
64+
- result.msg == "Error performing CMCI request: (\"Connection aborted.\",
65+
RemoteDisconnected(\"Remote end closed connection without response\"))"

tests/integration/targets/cics_cmci/runme.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_incorrect_scope.yml
1111
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_incorrect_context.yml
1212
ansible-playbook -e "@cmci-variables.yml" playbooks/cics_cmci_http.yml
1313
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_install_bundle_failure.yml
14-
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_create_pipeline_failure.yml
14+
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_create_pipeline_failure.yml
15+
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_incorrect_scheme.yml

0 commit comments

Comments
 (0)