Skip to content

Commit

Permalink
Small fixes in testing playbooks
Browse files Browse the repository at this point in the history
- Changed playbooks directing to 'docker' as host to 'all'.
- Updated of README.md for testing.
  • Loading branch information
marianavillarp committed Feb 10, 2023
1 parent f678b57 commit 97c2ff7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ The sample playbook [`ibmmq.yml`](ansible_collections/ibm/ibmmq/ibmmq.yml) insta
- On Mac:

```shell
export ANSIBLE_LIBRARY=${ANSIBLE_LIBRARY}:<PATH-TO>/ansible_mq/ansible_collections/ibm/ibmmq/library
export ANSIBLE_LIBRARY=${ANSIBLE_LIBRARY}:<PATH-TO>/mq-ansible/ansible_collections/ibm/ibmmq/library
```

- On Windows:

```shell
set ANSIBLE_LIBRARY=%ANSIBLE_LIBRARY%;<PATH-TO>/ansible_mq/ansible_collections/ibm/ibmmq/library
set ANSIBLE_LIBRARY=%ANSIBLE_LIBRARY%;<PATH-TO>/mq-ansible/ansible_collections/ibm/ibmmq/library
```

2. Run the following command to execute the tasks within the playbook:
Expand Down Expand Up @@ -201,16 +201,20 @@ These playbooks test the functionality and performance of our roles and the queu

To run the test playbooks first:

1. make sure you are in the right directory
1. copy your `inventory.ini` file to the `tests/playbooks` directory
```shell
cp invenotry.ini tests/playbooks
```
2. go to the `tests/playbooks` directory
```shell
cd tests/playbooks
```
2. export the modules to your Ansible library
3. export the modules to your Ansible library
```shell
export ANSIBLE_LIBRARY=${ANSIBLE_LIBRARY}:<PATH-TO>/ansible_mq/ansible_collections/ibm/ibmmq/library
```
- ##### *Note*: change `<PATH-TO>` to your local directory path:
3. run all test playbooks with `python3 main.py`
4. run all test playbooks with `python3 main.py`

## License

Expand Down
1 change: 1 addition & 0 deletions ansible_collections/ibm/ibmmq/tests/playbooks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import subprocess
subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'test_install.yml'])
subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'setup_test.yml'])
subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'test_absent_qmgr.yml'])
subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'test_present_qmgr.yml'])
subprocess.run(['ansible-playbook', '--inventory', 'inventory.ini', 'test_running_qmgr.yml'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: test downloading and installing MQ
hosts: docker
hosts: all
become: true
environment:
PATH: /opt/mqm/bin:{{ ansible_env.PATH }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: test downloading and installing MQ
hosts: docker
hosts: all
become: false
environment:
PATH: /opt/mqm/bin:{{ ansible_env.PATH }}
Expand Down

0 comments on commit 97c2ff7

Please sign in to comment.