(t *testing.T)
| 337 | } |
| 338 | |
| 339 | func TestFindVMByIDInGroup_NotFound(t *testing.T) { |
| 340 | s1 := newSingleNodeWithVMServer("t1", "pve1", 100, "web", "running") |
| 341 | defer s1.Close() |
| 342 | |
| 343 | mgr := NewGroupClientManager("g", testutils.NewTestLogger(), &MockCache{}) |
| 344 | err := mgr.Initialize(context.Background(), []ProfileEntry{ |
| 345 | {Name: "prod", Config: &MockConfig{Addr: s1.URL, User: "u", Password: "p"}}, |
| 346 | }) |
| 347 | require.NoError(t, err) |
| 348 | |
| 349 | _, _, err = mgr.FindVMByIDInGroup(context.Background(), 999) |
| 350 | require.Error(t, err) |
| 351 | |
| 352 | var ambig *AmbiguousVMIDError |
| 353 | assert.False(t, errors.As(err, &ambig), "not-found should not be AmbiguousVMIDError") |
| 354 | } |
| 355 | |
| 356 | func TestDeduplicateGroupVMs(t *testing.T) { |
| 357 | vms := []*VM{ |
nothing calls this directly
no test coverage detected