(t *testing.T)
| 394 | } |
| 395 | |
| 396 | func TestSyncMutations(t *testing.T) { |
| 397 | testutil.InstallZapLogger(t) |
| 398 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) |
| 399 | defer cancel() |
| 400 | |
| 401 | peerHostAddr := testutil.AllocOpenBindAddr(t) |
| 402 | peerClientAddr := testutil.AllocOpenBindAddr(t) |
| 403 | |
| 404 | peerHostConfig := &v1.Config{ |
| 405 | Version: migrations.CurrentVersion, |
| 406 | Instance: defaultHostID, |
| 407 | Repos: []*v1.Repo{ |
| 408 | { |
| 409 | Id: defaultRepoID, |
| 410 | Guid: defaultRepoGUID, |
| 411 | Uri: "test-uri", |
| 412 | }, |
| 413 | }, |
| 414 | Multihost: &v1.Multihost{ |
| 415 | Identity: identity1, |
| 416 | AuthorizedClients: []*v1.Multihost_Peer{ |
| 417 | { |
| 418 | Keyid: identity2.Keyid, |
| 419 | InstanceId: defaultClientID, |
| 420 | }, |
| 421 | }, |
| 422 | }, |
| 423 | } |
| 424 | |
| 425 | peerClientConfig := &v1.Config{ |
| 426 | Version: migrations.CurrentVersion, |
| 427 | Instance: defaultClientID, |
| 428 | Repos: []*v1.Repo{ |
| 429 | { |
| 430 | Id: defaultRepoID, |
| 431 | Guid: defaultRepoGUID, |
| 432 | Uri: "backrest://" + defaultHostID, // TODO: get rid of the :// requirement |
| 433 | }, |
| 434 | }, |
| 435 | Multihost: &v1.Multihost{ |
| 436 | Identity: identity2, |
| 437 | KnownHosts: []*v1.Multihost_Peer{ |
| 438 | { |
| 439 | Keyid: identity1.Keyid, |
| 440 | InstanceId: defaultHostID, |
| 441 | InstanceUrl: fmt.Sprintf("http://%s", peerHostAddr), |
| 442 | Permissions: []*v1.Multihost_Permission{ |
| 443 | { |
| 444 | Type: v1.Multihost_Permission_PERMISSION_READ_OPERATIONS, |
| 445 | Scopes: []string{ |
| 446 | "repo:" + defaultRepoID, |
| 447 | }, |
| 448 | }, |
| 449 | }, |
| 450 | }, |
| 451 | }, |
| 452 | }, |
| 453 | } |
nothing calls this directly
no test coverage detected