From f7332f4793472a4763d79ff3c1978bec8e5f604a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 23 Feb 2015 12:03:50 -0300 Subject: [PATCH] Rearrange testing infrastructure --- test/bin/curl | 1 + test/colab_test.sh | 4 ++-- test/ip_helper.sh | 3 ++- test/test_helper.sh | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/bin/curl b/test/bin/curl index 8967727..d623217 100755 --- a/test/bin/curl +++ b/test/bin/curl @@ -5,6 +5,7 @@ set -e unset http_proxy unset https_proxy +ROOTDIR=$(readlink -f $(dirname $0)/../..) . $(dirname $0)/../ip_helper.sh /usr/bin/curl \ diff --git a/test/colab_test.sh b/test/colab_test.sh index 57bbbe2..b733312 100644 --- a/test/colab_test.sh +++ b/test/colab_test.sh @@ -13,11 +13,11 @@ test_colab_running() { } test_colab_responds() { - assertTrue 'colab responds' "run_on integration curl --header 'Host: softwarepublico.dev' http://localhost:8001" + assertTrue 'colab responds' "run_on integration curl-host 'softwarepublico.dev' http://localhost:8001" } test_nginx_responds() { - assertTrue 'nginx reponds' "run_on integration curl --header 'Host: softwarepublico.dev' http://localhost" + assertTrue 'nginx reponds' "run_on integration curl-host 'softwarepublico.dev' http://localhost" } test_nginx_virtualhost() { diff --git a/test/ip_helper.sh b/test/ip_helper.sh index 3687df5..f2b5f60 100644 --- a/test/ip_helper.sh +++ b/test/ip_helper.sh @@ -6,5 +6,6 @@ # # Each node in the `peers:` entry in nodes.yaml will have its own variable # -eval $(ruby -ryaml -e 'YAML.load_file("nodes.yaml").first[1]["peers"].each { |k,v| puts "#{k}=#{v}" }') + +eval $(sed -e '/\S*:\s*[0-9]\+\./!d; s/^\s*//; s/:\s*/=/' ${ROOTDIR:-/vagrant}/nodes.yaml) diff --git a/test/test_helper.sh b/test/test_helper.sh index f7ec965..16407a2 100644 --- a/test/test_helper.sh +++ b/test/test_helper.sh @@ -1,4 +1,5 @@ export PATH="$(dirname $0)/bin:$PATH" +export ROOTDIR="$(readlink -f $(dirname $0)/..)" run_on() { local vm="$1" -- libgit2 0.21.2