Skip to content

Commit b84fbf2

Browse files
authored
Merge pull request #68 from stewartfrancis/integration-tests-linux
Make integration test error message more flexible to accommodate multiple platforms
2 parents fa58a95 + 5477483 commit b84fbf2

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
collections:
66
- ibm.ibm_zos_cics
77
hosts: 'localhost'
8-
gather_facts: 'false'
8+
gather_facts: 'true'
9+
10+
vars:
11+
mac_message: >-
12+
.*nodename nor servname provided, or not known$
13+
linux_message: >-
14+
.*Name or service not known$
15+
error_message: "{{ mac_message if ansible_system == 'Darwin' else linux_message }}"
916

1017
tasks:
1118
- name: test invalid host
@@ -30,4 +37,4 @@
3037
that:
3138
- result.failed is false
3239
- '{{ result.msg[:76] == "Error performing CMCI request: <urllib3.connection.HTTPSConnection object at" }}'
33-
- '{{ result.msg[-92:] == "Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known" }}'
40+
- '{{ result.msg is match(error_message) }}'

tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_port.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
that:
3030
- result.failed is false
3131
- '{{ result.msg[:76] == "Error performing CMCI request: <urllib3.connection.HTTPSConnection object at" }}'
32-
- '{{ result.msg[-67:] == "Failed to establish a new connection: [Errno 61] Connection refused" }}'
32+
- '{{ result.msg[-18:] == "Connection refused" }}'

0 commit comments

Comments
 (0)