(c *C)
| 46 | } |
| 47 | |
| 48 | func (s *SupervisorSuite) TestInitFromExistingConfig(c *C) { |
| 49 | e := testutils.NewResponder("Hi, I'm endpoint") |
| 50 | defer e.Close() |
| 51 | |
| 52 | b := MakeBatch(Batch{Addr: "localhost:11800", Route: `Path("/")`, URL: e.URL}) |
| 53 | c.Assert(s.ng.UpsertBackend(b.B), IsNil) |
| 54 | c.Assert(s.ng.UpsertServer(b.BK, b.S, engine.NoTTL), IsNil) |
| 55 | c.Assert(s.ng.UpsertFrontend(b.F, engine.NoTTL), IsNil) |
| 56 | c.Assert(s.ng.UpsertListener(b.L), IsNil) |
| 57 | |
| 58 | sup := New(newProxy, s.ng, Options{Clock: s.clock}) |
| 59 | |
| 60 | // When |
| 61 | c.Assert(sup.Start(), IsNil) |
| 62 | defer sup.Stop() |
| 63 | |
| 64 | // Then |
| 65 | time.Sleep(10 * time.Millisecond) |
| 66 | c.Assert(GETResponse(c, b.FrontendURL("/")), Equals, "Hi, I'm endpoint") |
| 67 | } |
| 68 | |
| 69 | func (s *SupervisorSuite) TestInitOnTheFly(c *C) { |
| 70 | e := testutils.NewResponder("Hi, I'm endpoint") |
nothing calls this directly
no test coverage detected