(x *testing.T)
| 76 | } |
| 77 | |
| 78 | func TestFillSlot(x *testing.T) { |
| 79 | s, addr := openProxy() |
| 80 | defer s.Close() |
| 81 | |
| 82 | var c = NewApiClient(addr) |
| 83 | c.SetXAuth(config.ProductName, config.ProductAuth, s.Model().Token) |
| 84 | |
| 85 | expect := make(map[int]*models.Slot) |
| 86 | |
| 87 | for i := 0; i < 16; i++ { |
| 88 | slot := &models.Slot{ |
| 89 | Id: i, |
| 90 | Locked: i%2 == 0, |
| 91 | BackendAddr: "x.x.x.x:xxxx", |
| 92 | } |
| 93 | assert.MustNoError(c.FillSlots(slot)) |
| 94 | expect[i] = slot |
| 95 | } |
| 96 | verifySlots(c, expect) |
| 97 | |
| 98 | slots := []*models.Slot{} |
| 99 | for i := 0; i < 16; i++ { |
| 100 | slot := &models.Slot{ |
| 101 | Id: i, |
| 102 | Locked: i%2 != 0, |
| 103 | BackendAddr: "y.y.y.y:yyyy", |
| 104 | MigrateFrom: "x.x.x.x:xxxx", |
| 105 | } |
| 106 | slots = append(slots, slot) |
| 107 | expect[i] = slot |
| 108 | } |
| 109 | assert.MustNoError(c.FillSlots(slots...)) |
| 110 | verifySlots(c, expect) |
| 111 | } |
| 112 | |
| 113 | func TestStartAndShutdown(x *testing.T) { |
| 114 | s, addr := openProxy() |
nothing calls this directly
no test coverage detected