Test server-side copying a file over itself
(t *testing.T)
| 645 | |
| 646 | // Test server-side copying a file over itself |
| 647 | func TestServerSideCopyOverSelf(t *testing.T) { |
| 648 | ctx := context.Background() |
| 649 | r := fstest.NewRun(t) |
| 650 | file1 := r.WriteObject(ctx, "sub dir/hello world", "hello world", t1) |
| 651 | r.CheckRemoteItems(t, file1) |
| 652 | |
| 653 | FremoteCopy, _, finaliseCopy, err := fstest.RandomRemote() |
| 654 | require.NoError(t, err) |
| 655 | defer finaliseCopy() |
| 656 | t.Logf("Server side copy (if possible) %v -> %v", r.Fremote, FremoteCopy) |
| 657 | |
| 658 | ctx = predictDstFromLogger(ctx) |
| 659 | err = CopyDir(ctx, FremoteCopy, r.Fremote, false) |
| 660 | require.NoError(t, err) |
| 661 | testLoggerVsLsf(ctx, FremoteCopy, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) |
| 662 | fstest.CheckItems(t, FremoteCopy, file1) |
| 663 | |
| 664 | file2 := r.WriteObject(ctx, "sub dir/hello world", "hello world again", t2) |
| 665 | r.CheckRemoteItems(t, file2) |
| 666 | |
| 667 | ctx = predictDstFromLogger(ctx) |
| 668 | err = CopyDir(ctx, FremoteCopy, r.Fremote, false) |
| 669 | require.NoError(t, err) |
| 670 | testLoggerVsLsf(ctx, FremoteCopy, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) |
| 671 | fstest.CheckItems(t, FremoteCopy, file2) |
| 672 | } |
| 673 | |
| 674 | // Test moving a file over itself |
| 675 | func TestMoveOverSelf(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…