Skip to content

Commit 46a660f

Browse files
Merge pull request #60 from sophiegreen/master
Add ITs for missing xmltodict library
2 parents 9cc0ef0 + cba4922 commit 46a660f

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ echo "/* -----------------------------------------------------------------------
3333
echo "/* -------------------------------------------------------------------------- */"
3434
echo "/* Integration tests Python 3.8 */"
3535
echo "/* -------------------------------------------------------------------------- */"
36-
(set -x; ansible-test integration --python 3.8)
36+
(set -x; ansible-test integration cics_cmci --python 3.8)
37+
38+
echo "/* -------------------------------------------------------------------------- */"
39+
echo "/* Integration tests for missing libraries Python 3.8 */"
40+
echo "/* -------------------------------------------------------------------------- */"
41+
(set -x; pip uninstall xmltodict -y)
42+
(set -x; ansible-test integration cics_cmci_missing_libraries --python 3.8)
43+
(set -x; pip install -r prod-requirements.txt)
44+
3745
echo $?
3846
deactivate
3947

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
10+
tasks:
11+
- name: test missing xmltodict library
12+
ibm.ibm_zos_cics.cmci_get:
13+
cmci_host: '{{ cmci_host }}'
14+
cmci_port: '{{ cmci_port }}'
15+
cmci_user: '{{ cmci_user }}'
16+
cmci_password: '{{ cmci_password }}'
17+
insecure: true
18+
context: '{{ context }}'
19+
scope: '{{ scope }}'
20+
type: 'cicsprogram'
21+
failed_when: false
22+
register: result
23+
24+
- name: debug
25+
debug:
26+
msg: '{{ result.msg }}'
27+
28+
- name: assert
29+
assert:
30+
that:
31+
- result.failed is false
32+
- '{{ result.msg[:58] == "Failed to import the required Python library (encoder) on " }}'
33+
- '{{ result.msg[-232:] == "Please read the module documentation and install it in the appropriate location.
34+
If the required library is installed, but Ansible is using the wrong Python interpreter, please
35+
consult the documentation on ansible_python_interpreter" }}'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) IBM Corporation 2020
3+
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
4+
set -eux # This is important to ensure that return codes from failing tests are propagated
5+
ansible-playbook -e "@cmci-variables.yml" playbooks/cmci_missing_xmltodict.yml

0 commit comments

Comments
 (0)