350_container_to_container_edge_no_weave_test.sh 665 B

12345678910111213141516171819202122
  1. #! /bin/bash
  2. # shellcheck disable=SC1091
  3. . ./config.sh
  4. start_suite "Test short lived connections between containers without Weave (no NAT)"
  5. scope_on "$HOST1" launch
  6. docker_on "$HOST1" run -d --name nginx nginx
  7. wait_for_containers "$HOST1" 60 nginx
  8. nginx_ip="$(docker_on "$HOST1" inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx)"
  9. docker_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \
  10. wget $nginx_ip:80/ -O - >/dev/null || true; \
  11. sleep 1; \
  12. done"
  13. wait_for_containers "$HOST1" 60 client
  14. has_container "$HOST1" nginx
  15. has_container "$HOST1" client
  16. has_connection containers "$HOST1" client nginx
  17. scope_end_suite