From 87e8393b07f3653b2cec3c8198cb2ff3aad3019f Mon Sep 17 00:00:00 2001 From: Emile Vauge Date: Tue, 15 Mar 2016 18:57:56 +0100 Subject: [PATCH] Fix tests with lets encrypt Signed-off-by: Emile Vauge --- integration/basic_test.go | 7 +++---- integration/consul_test.go | 8 +++----- integration/etcd_test.go | 8 +++----- integration/marathon_test.go | 8 +++----- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/integration/basic_test.go b/integration/basic_test.go index 90dd2fd25..d9a9178a8 100644 --- a/integration/basic_test.go +++ b/integration/basic_test.go @@ -46,10 +46,9 @@ func (s *SimpleSuite) TestSimpleDefaultConfig(c *check.C) { // TODO validate : run on 80 resp, err := http.Get("http://127.0.0.1:8000/") - // Expected no response as we did not configure anything - c.Assert(resp, checker.IsNil) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, fmt.Sprintf("getsockopt: connection refused")) + // Expected a 404 as we did not configure anything + c.Assert(err, checker.IsNil) + c.Assert(resp.StatusCode, checker.Equals, 404) } func (s *SimpleSuite) TestWithWebConfig(c *check.C) { diff --git a/integration/consul_test.go b/integration/consul_test.go index c672cfde2..a59247adb 100644 --- a/integration/consul_test.go +++ b/integration/consul_test.go @@ -5,7 +5,6 @@ import ( "os/exec" "time" - "fmt" checker "github.com/vdemeester/shakers" check "gopkg.in/check.v1" ) @@ -20,8 +19,7 @@ func (s *ConsulSuite) TestSimpleConfiguration(c *check.C) { // TODO validate : run on 80 resp, err := http.Get("http://127.0.0.1:8000/") - // Expected no response as we did not configure anything - c.Assert(resp, checker.IsNil) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, fmt.Sprintf("getsockopt: connection refused")) + // Expected a 404 as we did not configure anything + c.Assert(err, checker.IsNil) + c.Assert(resp.StatusCode, checker.Equals, 404) } diff --git a/integration/etcd_test.go b/integration/etcd_test.go index 377bbc437..8352cc511 100644 --- a/integration/etcd_test.go +++ b/integration/etcd_test.go @@ -5,7 +5,6 @@ import ( "os/exec" "time" - "fmt" checker "github.com/vdemeester/shakers" check "gopkg.in/check.v1" ) @@ -20,8 +19,7 @@ func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) { // TODO validate : run on 80 resp, err := http.Get("http://127.0.0.1:8000/") - // Expected no response as we did not configure anything - c.Assert(resp, checker.IsNil) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, fmt.Sprintf("getsockopt: connection refused")) + // Expected a 404 as we did not configure anything + c.Assert(err, checker.IsNil) + c.Assert(resp.StatusCode, checker.Equals, 404) } diff --git a/integration/marathon_test.go b/integration/marathon_test.go index ea45381f4..40a42ffd6 100644 --- a/integration/marathon_test.go +++ b/integration/marathon_test.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "net/http" "os/exec" "time" @@ -20,8 +19,7 @@ func (s *MarathonSuite) TestSimpleConfiguration(c *check.C) { // TODO validate : run on 80 resp, err := http.Get("http://127.0.0.1:8000/") - // Expected no response as we did not configure anything - c.Assert(resp, checker.IsNil) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, fmt.Sprintf("getsockopt: connection refused")) + // Expected a 404 as we did not configure anything + c.Assert(err, checker.IsNil) + c.Assert(resp.StatusCode, checker.Equals, 404) }