Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. func TestGetOverlayConfig(t *testing.T) {
  2. overlayUUID := uuid.UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1,
  3. 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
  4. underlayUUID := uuid.UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1,
  5. 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0x00}
  6. config := AppNetworkConfig{
  7. OverlayNetworkList: []OverlayNetworkConfig{
  8. OverlayNetworkConfig{Network: overlayUUID},
  9. },
  10. UnderlayNetworkList: []UnderlayNetworkConfig{
  11. UnderlayNetworkConfig{Network: underlayUUID},
  12. },
  13. }
  14. testMatrix := map[string]struct {
  15. network uuid.UUID
  16. config AppNetworkConfig
  17. }{
  18. "Overlay UUID": {
  19. network: overlayUUID,
  20. config: config,
  21. },
  22. }
  23. for testname, test := range testMatrix {
  24. t.Logf("Running test case %s", testname)
  25. config := test.config.getOverlayConfig(overlayUUID)
  26. assert.IsType(t, test.config, config)
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement