(t *testing.T)
| 341 | } |
| 342 | |
| 343 | func TestFailDelete(t *testing.T) { |
| 344 | log.SetupZapLogger(log.GetDefaultLogOpts()) |
| 345 | ctrl := gomock.NewController(t) |
| 346 | defer ctrl.Finish() |
| 347 | p := pubsub.NewMockPubSubInterface(ctrl) |
| 348 | p.EXPECT().Subscribe(common.PubSubAPIServer, gomock.Any()).Times(1) |
| 349 | c := New(p) |
| 350 | assert.NotNil(t, c) |
| 351 | |
| 352 | addEndpoints := common.NewRetinaEndpoint("pod1", "ns1", nil) |
| 353 | |
| 354 | // Delete non-existing retina endpoint returns no error. |
| 355 | err := c.DeleteRetinaEndpoint(addEndpoints.Key()) |
| 356 | assert.NoError(t, err) |
| 357 | |
| 358 | svc := common.NewRetinaSvc("svc1", "ns1", nil, nil, nil) |
| 359 | err = c.DeleteRetinaSvc(svc.Key()) |
| 360 | assert.Error(t, err) |
| 361 | |
| 362 | node := common.NewRetinaNode("node1", net.IPv4(1, 2, 3, 4), "zone-1") |
| 363 | |
| 364 | err = c.DeleteRetinaNode(node.Name()) |
| 365 | assert.Error(t, err) |
| 366 | } |
| 367 | |
| 368 | func TestCachingNamespace(t *testing.T) { |
| 369 | log.SetupZapLogger(log.GetDefaultLogOpts()) |
nothing calls this directly
no test coverage detected