210_clustering_custom_hostname_2_test.sh 796 B

1234567891011121314151617181920212223242526272829
  1. #! /bin/bash
  2. # shellcheck disable=SC1091
  3. . ./config.sh
  4. start_suite "Launch 2 scopes and check they cluster automatically, with custom weave domain"
  5. weave_on "$HOST1" launch --dns-domain foo.local "$HOST1" "$HOST2"
  6. weave_on "$HOST2" launch --dns-domain foo.local "$HOST1" "$HOST2"
  7. scope_on "$HOST1" launch --weave.hostname=bar.foo.local
  8. scope_on "$HOST2" launch --weave.hostname bar.foo.local
  9. docker_on "$HOST1" run -dit --name db1 peterbourgon/tns-db
  10. docker_on "$HOST2" run -dit --name db2 peterbourgon/tns-db
  11. sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports
  12. check() {
  13. has_container "$1" weave 2
  14. has_container "$1" weavescope 2
  15. has_container "$1" db1
  16. has_container "$1" db2
  17. }
  18. check "$HOST1"
  19. check "$HOST2"
  20. scope_end_suite