(t *testing.T, cert *tls.Certificate)
| 150 | } |
| 151 | |
| 152 | func NewTLSServerGroup(t *testing.T, cert *tls.Certificate) { |
| 153 | s := NewServerTLS("https://cfssl1.local:8888, https://cfssl2.local:8888", helpers.CreateTLSConfig(nil, cert)) |
| 154 | |
| 155 | ogl, ok := s.(*orderedListGroup) |
| 156 | if !ok { |
| 157 | t.Fatalf("expected NewServer to return an ordered group list with a list of servers, instead got a %T = %+v", ogl, ogl) |
| 158 | } |
| 159 | |
| 160 | if len(ogl.remotes) != 2 { |
| 161 | t.Fatalf("expected the remote to have two servers, but it has %d", len(ogl.remotes)) |
| 162 | } |
| 163 | |
| 164 | hosts := ogl.Hosts() |
| 165 | if len(hosts) != 2 { |
| 166 | t.Fatalf("expected 2 hosts in the group, but have %d", len(hosts)) |
| 167 | } |
| 168 | |
| 169 | if hosts[0] != "https://cfssl1.local:8888" { |
| 170 | t.Fatalf("expected to see https://cfssl1.local:8888, but saw %s", |
| 171 | hosts[0]) |
| 172 | } |
| 173 | |
| 174 | if hosts[1] != "https://cfssl2.local:8888" { |
| 175 | t.Fatalf("expected to see https://cfssl2.local:8888, but saw %s", |
| 176 | hosts[1]) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestNewOGLGroup(t *testing.T) { |
| 181 | strategy := StrategyFromString("ordered_list") |
no test coverage detected
searching dependent graphs…