From b50c135a92eeab7b445530ec66a44264a61b1ba6 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 12 Feb 2015 15:07:14 -0200 Subject: [PATCH] Fix tests --- test/bin/curl | 13 +++++++++++++ test/colab_test.sh | 6 +++--- test/test_helper.sh | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 test/bin/curl diff --git a/test/bin/curl b/test/bin/curl new file mode 100755 index 0000000..dd8bf04 --- /dev/null +++ b/test/bin/curl @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +unset http_proxy +unset https_proxy + +/usr/bin/curl \ + --silent \ + --noproxy '*' \ + --fail \ + --header 'Host: softwarepublico.dev' \ + "$@" diff --git a/test/colab_test.sh b/test/colab_test.sh index cc7a022..14048e2 100644 --- a/test/colab_test.sh +++ b/test/colab_test.sh @@ -13,16 +13,16 @@ test_colab_running() { } test_colab_responds() { - assertTrue 'colab responds' 'run_on integration curl --fail http://localhost:8001' + assertTrue 'colab responds' "run_on integration $curl http://localhost:8001" } test_nginx_responds() { - assertTrue 'nginx reponds' 'run_on integration curl --fail http://localhost' + assertTrue 'nginx reponds' "run_on integration $curl http://localhost" } test_nginx_virtualhost() { local ip="$(grep integration: nodes.yaml | cut -d : -f 2)" - local title="$(curl --silent --header 'Host: beta.softwarepublico.gov.br' http://$ip/dashboard | grep '' | sed -e 's/^\s*//')" + local title="$(./test/bin/curl http://$ip/dashboard | grep '<title>' | sed -e 's/^\s*//')" assertEquals "<title>Home - Colab" "$title" } diff --git a/test/test_helper.sh b/test/test_helper.sh index e7c80f3..165c963 100644 --- a/test/test_helper.sh +++ b/test/test_helper.sh @@ -3,3 +3,5 @@ run_on() { shift vagrant ssh "$vm" -- "$@" } + +curl=/vagrant/test/bin/curl -- libgit2 0.21.2