(x *testing.T)
| 111 | } |
| 112 | |
| 113 | func TestStartAndShutdown(x *testing.T) { |
| 114 | s, addr := openProxy() |
| 115 | defer s.Close() |
| 116 | |
| 117 | var c = NewApiClient(addr) |
| 118 | c.SetXAuth(config.ProductName, config.ProductAuth, s.Model().Token) |
| 119 | |
| 120 | expect := make(map[int]*models.Slot) |
| 121 | |
| 122 | for i := 0; i < 16; i++ { |
| 123 | slot := &models.Slot{ |
| 124 | Id: i, |
| 125 | BackendAddr: "x.x.x.x:xxxx", |
| 126 | } |
| 127 | assert.MustNoError(c.FillSlots(slot)) |
| 128 | expect[i] = slot |
| 129 | } |
| 130 | verifySlots(c, expect) |
| 131 | |
| 132 | err1 := c.Start() |
| 133 | assert.MustNoError(err1) |
| 134 | |
| 135 | err2 := c.Shutdown() |
| 136 | assert.MustNoError(err2) |
| 137 | |
| 138 | err3 := c.Start() |
| 139 | assert.Must(err3 != nil) |
| 140 | } |
nothing calls this directly
no test coverage detected