Commit 37a51f8c3841c8784b4889adbe834b72ea24e372

Authored by Antonio Terceiro
1 parent b50c135a

test_helper: make IP addresses available as variables

Showing 2 changed files with 11 additions and 2 deletions   Show diff stats
test/colab_test.sh
... ... @@ -21,8 +21,7 @@ test_nginx_responds() {
21 21 }
22 22  
23 23 test_nginx_virtualhost() {
24   - local ip="$(grep integration: nodes.yaml | cut -d : -f 2)"
25   - local title="$(./test/bin/curl http://$ip/dashboard | grep '<title>' | sed -e 's/^\s*//')"
  24 + local title="$(./test/bin/curl http://$integration/dashboard | grep '<title>' | sed -e 's/^\s*//')"
26 25 assertEquals "<title>Home - Colab</title>" "$title"
27 26 }
28 27  
... ...
test/test_helper.sh
... ... @@ -5,3 +5,13 @@ run_on() {
5 5 }
6 6  
7 7 curl=/vagrant/test/bin/curl
  8 +
  9 +# make IP addresses avaliable at the environment so we can refer to hosts by
  10 +# name, e.g.
  11 +#
  12 +# curl http://$reverseproxy
  13 +# nmap -p 5423 $database
  14 +#
  15 +# Each node in the `peers:` entry in nodes.yaml will have its own variable
  16 +#
  17 +eval $(ruby -ryaml -e 'YAML.load_file("nodes.yaml").first[1]["peers"].each { |k,v| puts "#{k}=#{v}" }')
... ...