Test a server-side copy if possible, or the backup path if not
(t *testing.T)
| 609 | |
| 610 | // Test a server-side copy if possible, or the backup path if not |
| 611 | func TestServerSideCopy(t *testing.T) { |
| 612 | ctx := context.Background() |
| 613 | r := fstest.NewRun(t) |
| 614 | file1 := r.WriteObject(ctx, "sub dir/hello world", "hello world", t1) |
| 615 | r.CheckRemoteItems(t, file1) |
| 616 | |
| 617 | FremoteCopy, _, finaliseCopy, err := fstest.RandomRemote() |
| 618 | require.NoError(t, err) |
| 619 | defer finaliseCopy() |
| 620 | t.Logf("Server side copy (if possible) %v -> %v", r.Fremote, FremoteCopy) |
| 621 | |
| 622 | ctx = predictDstFromLogger(ctx) |
| 623 | err = CopyDir(ctx, FremoteCopy, r.Fremote, false) |
| 624 | require.NoError(t, err) |
| 625 | testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t) |
| 626 | |
| 627 | fstest.CheckItems(t, FremoteCopy, file1) |
| 628 | } |
| 629 | |
| 630 | // Test copying a file over itself |
| 631 | func TestCopyOverSelf(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…