test(integration-test): First test for eureka

This commit is contained in:
Julien Salleyron 2016-11-16 23:21:47 +01:00
parent 2af6cc4d1b
commit d2dcec40e1
4 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,34 @@
package main
import (
"net/http"
"os/exec"
"time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers"
)
// Eureka test suites (using libcompose)
type EurekaSuite struct{ BaseSuite }
func (s *EurekaSuite) SetUpSuite(c *check.C) {
s.createComposeProject(c, "eureka")
s.composeProject.Start(c)
}
func (s *EurekaSuite) TestSimpleConfiguration(c *check.C) {
cmd := exec.Command(traefikBinary, "--configFile=fixtures/eureka/simple.toml")
err := cmd.Start()
c.Assert(err, checker.IsNil)
defer cmd.Process.Kill()
time.Sleep(500 * time.Millisecond)
// TODO validate : run on 80
resp, err := http.Get("http://127.0.0.1:8000/")
// Expected a 404 as we did not configure anything
c.Assert(err, checker.IsNil)
c.Assert(resp.StatusCode, checker.Equals, 404)
}

View file

@ -0,0 +1,7 @@
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":8000"
[eureka]
endpoint = "http://127.0.0.1:8761/eureka"
delay = "1m"

View file

@ -33,6 +33,7 @@ func init() {
check.Suite(&MarathonSuite{})
check.Suite(&ConstraintSuite{})
check.Suite(&MesosSuite{})
check.Suite(&EurekaSuite{})
}
var traefikBinary = "../dist/traefik"

View file

@ -0,0 +1,4 @@
eureka:
image: netflixoss/eureka:1.3.1
ports:
- "8761:8080"