From cc4fb64b34f87c8235abc5ed3d27c82aca681ae1 Mon Sep 17 00:00:00 2001 From: Emile Vauge Date: Mon, 6 Jun 2016 22:33:29 +0200 Subject: [PATCH] Add routes priorities in integration tests Signed-off-by: Emile Vauge --- examples/compose-marathon.yml | 9 --------- examples/whoami.json | 3 ++- integration/consul_test.go | 2 ++ integration/etcd_test.go | 5 +++-- integration/marathon_test.go | 13 +++++++++++++ integration/resources/compose/marathon.yml | 9 +++++---- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/examples/compose-marathon.yml b/examples/compose-marathon.yml index 7239cba8f..76233f396 100644 --- a/examples/compose-marathon.yml +++ b/examples/compose-marathon.yml @@ -41,12 +41,3 @@ marathon: MARATHON_ZK: zk://127.0.0.1:2181/marathon MARATHON_HOSTNAME: 127.0.0.1 command: --event_subscriber http_callback - -traefik: - image: containous/traefik - command: -c /dev/null --web --logLevel=DEBUG --marathon --marathon.domain marathon.localhost --marathon.endpoint http://172.17.0.1:8080 --marathon.watch - ports: - - "8000:80" - - "8081:8080" - volumes: - - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file diff --git a/examples/whoami.json b/examples/whoami.json index 980316388..5b3ab3da2 100644 --- a/examples/whoami.json +++ b/examples/whoami.json @@ -26,6 +26,7 @@ "labels": { "traefik.weight": "1", "traefik.protocol": "http", - "traefik.frontend.rule" : "Host:test.marathon.localhost" + "traefik.frontend.rule" : "Host:test.marathon.localhost", + "traefik.frontend.priority" : "10" } } diff --git a/integration/consul_test.go b/integration/consul_test.go index b87105de0..0c2c97058 100644 --- a/integration/consul_test.go +++ b/integration/consul_test.go @@ -100,11 +100,13 @@ func (s *ConsulSuite) TestNominalConfiguration(c *check.C) { frontend1 := map[string]string{ "traefik/frontends/frontend1/backend": "backend2", "traefik/frontends/frontend1/entrypoints": "http", + "traefik/frontends/frontend1/priority": "1", "traefik/frontends/frontend1/routes/test_1/rule": "Host:test.localhost", } frontend2 := map[string]string{ "traefik/frontends/frontend2/backend": "backend1", "traefik/frontends/frontend2/entrypoints": "http", + "traefik/frontends/frontend2/priority": "10", "traefik/frontends/frontend2/routes/test_2/rule": "Path:/test", } for key, value := range backend1 { diff --git a/integration/etcd_test.go b/integration/etcd_test.go index 1138eea3d..316d989b3 100644 --- a/integration/etcd_test.go +++ b/integration/etcd_test.go @@ -1,12 +1,11 @@ package main import ( + "github.com/go-check/check" "net/http" "os/exec" "time" - "github.com/go-check/check" - checker "github.com/vdemeester/shakers" "errors" @@ -104,11 +103,13 @@ func (s *EtcdSuite) TestNominalConfiguration(c *check.C) { frontend1 := map[string]string{ "/traefik/frontends/frontend1/backend": "backend2", "/traefik/frontends/frontend1/entrypoints": "http", + "/traefik/frontends/frontend1/priority": "1", "/traefik/frontends/frontend1/routes/test_1/rule": "Host:test.localhost", } frontend2 := map[string]string{ "/traefik/frontends/frontend2/backend": "backend1", "/traefik/frontends/frontend2/entrypoints": "http", + "/traefik/frontends/frontend2/priority": "10", "/traefik/frontends/frontend2/routes/test_2/rule": "Path:/test", } for key, value := range backend1 { diff --git a/integration/marathon_test.go b/integration/marathon_test.go index 0453cbea2..e029794f6 100644 --- a/integration/marathon_test.go +++ b/integration/marathon_test.go @@ -15,6 +15,19 @@ type MarathonSuite struct{ BaseSuite } func (s *MarathonSuite) SetUpSuite(c *check.C) { s.createComposeProject(c, "marathon") + s.composeProject.Start(c) + // wait for marathon + // err := utils.TryRequest("http://127.0.0.1:8080/ping", 60*time.Second, func(res *http.Response) error { + // body, err := ioutil.ReadAll(res.Body) + // if err != nil { + // return err + // } + // if !strings.Contains(string(body), "ping") { + // return errors.New("Incorrect marathon config") + // } + // return nil + // }) + // c.Assert(err, checker.IsNil) } func (s *MarathonSuite) TestSimpleConfiguration(c *check.C) { diff --git a/integration/resources/compose/marathon.yml b/integration/resources/compose/marathon.yml index d489db2fa..13113e51e 100644 --- a/integration/resources/compose/marathon.yml +++ b/integration/resources/compose/marathon.yml @@ -6,7 +6,7 @@ zk: ZK_ID: " 1" master: - image: mesosphere/mesos-master:0.23.0-1.0.ubuntu1404 + image: mesosphere/mesos-master:0.28.1-2.0.20.ubuntu1404 net: host environment: MESOS_ZK: zk://127.0.0.1:2181/mesos @@ -17,7 +17,7 @@ master: MESOS_WORK_DIR: /var/lib/mesos slave: - image: mesosphere/mesos-slave:0.23.0-1.0.ubuntu1404 + image: mesosphere/mesos-slave:0.28.1-2.0.20.ubuntu1404 net: host pid: host privileged: true @@ -31,12 +31,13 @@ slave: - /usr/bin/docker:/usr/bin/docker:ro - /usr/lib/x86_64-linux-gnu/libapparmor.so.1:/usr/lib/x86_64-linux-gnu/libapparmor.so.1:ro - /var/run/docker.sock:/var/run/docker.sock + - /lib/x86_64-linux-gnu/libsystemd-journal.so.0:/lib/x86_64-linux-gnu/libsystemd-journal.so.0 marathon: - image: mesosphere/marathon:v0.9.2 + image: mesosphere/marathon:v1.1.1 net: host environment: MARATHON_MASTER: zk://127.0.0.1:2181/mesos MARATHON_ZK: zk://127.0.0.1:2181/marathon MARATHON_HOSTNAME: 127.0.0.1 - command: --event_subscriber http_callback + command: --event_subscriber http_callback \ No newline at end of file