Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests docker #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Running the tests locally

The tests bring up docker containers using a `provision_docker` role.
`docker` needs to be running on the VM or server that you are running these tests.
Here's how

### Install pre-requisites
```
# yum install docker ansible
# systemctl start docker

```

You need to ensure `provision_docker` is installed under your tests directory

```
# ansible-galaxy install -r tests/requirements.yml -p tests/roles/
```

### Running the test

```
# ansible-playbook -i tests/inventory tests/test_docker.yml
```

1 change: 1 addition & 0 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost ansible_connection=local
2 changes: 2 additions & 0 deletions tests/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- src: chrismeyersfsu.provision_docker
name: provision_docker
17 changes: 17 additions & 0 deletions tests/test-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Bring up docker containers
hosts: localhost
gather_facts: false
vars:
inventory:
- name: host1
image: "gluster/glusterd2-nightly"
roles:
- { role: provision_docker, provision_docker_inventory: "{{inventory}}" }


- name: Hello world
hosts: docker_containers
tasks:
- name: Test docker
command: 'echo ”Hello World”'