(t *testing.T)
| 197 | } |
| 198 | |
| 199 | func TestConvertEndpointSpec(t *testing.T) { |
| 200 | source := []composetypes.ServicePortConfig{ |
| 201 | { |
| 202 | Protocol: "udp", |
| 203 | Target: 53, |
| 204 | Published: 1053, |
| 205 | Mode: "host", |
| 206 | }, |
| 207 | { |
| 208 | Target: 8080, |
| 209 | Published: 80, |
| 210 | }, |
| 211 | } |
| 212 | endpoint := convertEndpointSpec("vip", source) |
| 213 | |
| 214 | expected := swarm.EndpointSpec{ |
| 215 | Mode: swarm.ResolutionMode(strings.ToLower("vip")), |
| 216 | Ports: []swarm.PortConfig{ |
| 217 | { |
| 218 | TargetPort: 8080, |
| 219 | PublishedPort: 80, |
| 220 | }, |
| 221 | { |
| 222 | Protocol: "udp", |
| 223 | TargetPort: 53, |
| 224 | PublishedPort: 1053, |
| 225 | PublishMode: "host", |
| 226 | }, |
| 227 | }, |
| 228 | } |
| 229 | |
| 230 | assert.Check(t, is.DeepEqual(expected, *endpoint)) |
| 231 | } |
| 232 | |
| 233 | func TestConvertServiceNetworksOnlyDefault(t *testing.T) { |
| 234 | networkConfigs := networkMap{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…