(t *testing.T)
| 269 | } |
| 270 | |
| 271 | func TestSimpleOperationSync(t *testing.T) { |
| 272 | testutil.InstallZapLogger(t) |
| 273 | ctx, _ := context.WithTimeout(context.Background(), 10*time.Second) |
| 274 | |
| 275 | peerHostAddr := testutil.AllocOpenBindAddr(t) |
| 276 | peerClientAddr := testutil.AllocOpenBindAddr(t) |
| 277 | |
| 278 | peerHostConfig := &v1.Config{ |
| 279 | Version: migrations.CurrentVersion, |
| 280 | Instance: defaultHostID, |
| 281 | Repos: []*v1.Repo{ |
| 282 | { |
| 283 | Id: defaultRepoID, |
| 284 | Guid: defaultRepoGUID, |
| 285 | Uri: "test-uri", |
| 286 | }, |
| 287 | }, |
| 288 | Multihost: &v1.Multihost{ |
| 289 | Identity: identity1, |
| 290 | AuthorizedClients: []*v1.Multihost_Peer{ |
| 291 | { |
| 292 | Keyid: identity2.Keyid, |
| 293 | InstanceId: defaultClientID, |
| 294 | }, |
| 295 | }, |
| 296 | }, |
| 297 | } |
| 298 | |
| 299 | peerClientConfig := &v1.Config{ |
| 300 | Version: migrations.CurrentVersion, |
| 301 | Instance: defaultClientID, |
| 302 | Repos: []*v1.Repo{ |
| 303 | { |
| 304 | Id: defaultRepoID, |
| 305 | Guid: defaultRepoGUID, |
| 306 | Uri: "backrest://" + defaultHostID, // TODO: get rid of the :// requirement |
| 307 | }, |
| 308 | }, |
| 309 | Multihost: &v1.Multihost{ |
| 310 | Identity: identity2, |
| 311 | KnownHosts: []*v1.Multihost_Peer{ |
| 312 | { |
| 313 | Keyid: identity1.Keyid, |
| 314 | InstanceId: defaultHostID, |
| 315 | InstanceUrl: fmt.Sprintf("http://%s", peerHostAddr), |
| 316 | Permissions: []*v1.Multihost_Permission{ |
| 317 | { |
| 318 | Type: v1.Multihost_Permission_PERMISSION_READ_OPERATIONS, |
| 319 | Scopes: []string{ |
| 320 | "repo:" + defaultRepoID, |
| 321 | }, |
| 322 | }, |
| 323 | }, |
| 324 | }, |
| 325 | }, |
| 326 | }, |
| 327 | } |
| 328 |
nothing calls this directly
no test coverage detected