2016-02-25 23:31:35 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"os/exec"
|
|
|
|
"time"
|
|
|
|
|
2016-04-02 10:40:21 +00:00
|
|
|
"github.com/go-check/check"
|
|
|
|
|
2016-02-25 23:31:35 +00:00
|
|
|
checker "github.com/vdemeester/shakers"
|
|
|
|
)
|
|
|
|
|
2016-03-27 14:27:56 +00:00
|
|
|
// Etcd test suites (using libcompose)
|
|
|
|
type EtcdSuite struct{ BaseSuite }
|
|
|
|
|
|
|
|
func (s *EtcdSuite) SetUpSuite(c *check.C) {
|
|
|
|
s.createComposeProject(c, "etcd")
|
|
|
|
}
|
|
|
|
|
2016-02-25 23:31:35 +00:00
|
|
|
func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) {
|
|
|
|
cmd := exec.Command(traefikBinary, "--configFile=fixtures/etcd/simple.toml")
|
|
|
|
err := cmd.Start()
|
|
|
|
c.Assert(err, checker.IsNil)
|
|
|
|
defer cmd.Process.Kill()
|
|
|
|
|
|
|
|
time.Sleep(1000 * time.Millisecond)
|
|
|
|
// TODO validate : run on 80
|
|
|
|
resp, err := http.Get("http://127.0.0.1:8000/")
|
|
|
|
|
2016-03-15 17:57:56 +00:00
|
|
|
// Expected a 404 as we did not configure anything
|
|
|
|
c.Assert(err, checker.IsNil)
|
|
|
|
c.Assert(resp.StatusCode, checker.Equals, 404)
|
2016-02-25 23:31:35 +00:00
|
|
|
}
|