Skip to content

Commit

Permalink
in tests make sure our autoheal only stops our containers
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-wtioit committed Jul 9, 2021
1 parent 576ceef commit 0028fbc
Showing 1 changed file with 4 additions and 39 deletions.
43 changes: 4 additions & 39 deletions tests/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
restart: unless-stopped
environment:
AUTOHEAL_INTERVAL: 1
AUTOHEAL_CONTAINER_LABEL: "AUTOHEAL_${COMPOSE_PROJECT_NAME}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock

Expand All @@ -13,7 +14,7 @@ services:
dockerfile: Dockerfile
context: ..
labels:
autoheal: "true"
- "AUTOHEAL_${COMPOSE_PROJECT_NAME}=true"
depends_on:
- target
- autoheal
Expand All @@ -40,7 +41,7 @@ services:
dockerfile: Dockerfile
context: ..
labels:
autoheal: "true"
- "AUTOHEAL_${DOCKER_COMPOSE_PROJECT}=true"
depends_on:
- target
- autoheal
Expand Down Expand Up @@ -68,7 +69,7 @@ services:
dockerfile: Dockerfile
context: ..
labels:
autoheal: "true"
- "AUTOHEAL_${COMPOSE_PROJECT_NAME}=true"
depends_on:
- target_smtp
- autoheal
Expand Down Expand Up @@ -108,42 +109,6 @@ services:
aliases:
- smtp.example.com

test_ping:
image: bash
depends_on:
- proxy_preresolve
- proxy_without_preresolve
# ping all proxies (to make sure it is supported)
command:
bash -c 'ping -c 1 target_preresolve.example.com && ping -c 1
target_without_preresolve.example.com'

test_wait:
image: bash
depends_on:
- proxy_preresolve
# wait 5 seconds (default dns timeout for proxies)
command: timeout 10 sleep 5

test_proxy_preresolve:
image: curlimages/curl
depends_on:
- proxy_preresolve
command: timeout 10 curl -v 'target_preresolve.example.com'

test_proxy_without_preresolve:
image: curlimages/curl
depends_on:
- proxy_without_preresolve
command: timeout 10 curl -v 'target_without_preresolve.example.com'

test_proxy_smtp:
image: curlimages/curl
depends_on:
- proxy_smtp
# -X QUIT because mailhog doesn't support HELP
command: timeout 10 curl -v 'smtp://target_smtp.example.com:1025' -X QUIT

networks:
# we do not allow communication to the outside
simulated_outside:
Expand Down

0 comments on commit 0028fbc

Please sign in to comment.