File tree Expand file tree Collapse file tree 5 files changed +51
-8
lines changed
tests/integration/targets
cics_cmci_missing_requests_library
cics_cmci_missing_xmltodict_library Expand file tree Collapse file tree 5 files changed +51
-8
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ echo "/* -----------------------------------------------------------------------
39
39
echo " /* Integration tests for missing libraries Python 3.8 */"
40
40
echo " /* -------------------------------------------------------------------------- */"
41
41
(set -x; pip uninstall xmltodict -y)
42
- (set -x; ansible-test integration cics_cmci_missing_libraries --python 3.8)
42
+ (set -x; ansible-test integration cics_cmci_missing_xmltodict_library --python 3.8)
43
+ (set -x; pip install -r prod-requirements.txt)
44
+ (set -x; pip uninstall requests -y)
45
+ (set -x; ansible-test integration cics_cmci_missing_requests_library --python 3.8)
43
46
(set -x; pip install -r prod-requirements.txt)
44
47
45
48
echo $?
Original file line number Diff line number Diff line change
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 requests library
12
+ ibm.ibm_zos_cics.cmci_get :
13
+ cmci_host : ' host'
14
+ cmci_port : ' 12345'
15
+ cmci_user : ' user'
16
+ cmci_password : ' validpassword'
17
+ insecure : true
18
+ context : ' content'
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[:59] == "Failed to import the required Python library (requests) 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" }}'
Original file line number Diff line number Diff line change 2
2
# Copyright (c) IBM Corporation 2020
3
3
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
4
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
5
+ ansible-playbook playbooks/cmci_missing_requests .yml
Original file line number Diff line number Diff line change 10
10
tasks :
11
11
- name : test missing xmltodict library
12
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 }} '
13
+ cmci_host : ' host '
14
+ cmci_port : ' 12345 '
15
+ cmci_user : ' user '
16
+ cmci_password : ' validpassword '
17
17
insecure : true
18
- context : ' {{ context }} '
19
- scope : ' {{ scope }} '
18
+ context : ' content '
19
+ scope : ' scope'
20
20
type : ' cicsprogram'
21
21
failed_when : false
22
22
register : result
Original file line number Diff line number Diff line change
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 playbooks/cmci_missing_xmltodict.yml
You can’t perform that action at this time.
0 commit comments