diff --git a/integration/eureka_test.go b/integration/eureka_test.go new file mode 100644 index 000000000..5ba9d729a --- /dev/null +++ b/integration/eureka_test.go @@ -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) +} diff --git a/integration/fixtures/eureka/simple.toml b/integration/fixtures/eureka/simple.toml new file mode 100644 index 000000000..16ef16d5e --- /dev/null +++ b/integration/fixtures/eureka/simple.toml @@ -0,0 +1,7 @@ +defaultEntryPoints = ["http"] +[entryPoints] + [entryPoints.http] + address = ":8000" +[eureka] +endpoint = "http://127.0.0.1:8761/eureka" +delay = "1m" diff --git a/integration/integration_test.go b/integration/integration_test.go index 119cd6644..ec033cd56 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -33,6 +33,7 @@ func init() { check.Suite(&MarathonSuite{}) check.Suite(&ConstraintSuite{}) check.Suite(&MesosSuite{}) + check.Suite(&EurekaSuite{}) } var traefikBinary = "../dist/traefik" diff --git a/integration/resources/compose/eureka.yml b/integration/resources/compose/eureka.yml new file mode 100644 index 000000000..0282abb01 --- /dev/null +++ b/integration/resources/compose/eureka.yml @@ -0,0 +1,4 @@ +eureka: + image: netflixoss/eureka:1.3.1 + ports: + - "8761:8080"