mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00:00
bisync: test scenarios #5164
Co-authored-by: Chris Nelson <stuff@cjnaz.com>
This commit is contained in:
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-new
vendored
Normal file
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-new
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-new
vendored
Normal file
10
cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-new
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
@@ -0,0 +1,8 @@
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt"
|
||||
- 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt_Path1"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt_Path2"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt"
|
||||
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
@@ -0,0 +1,8 @@
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt_Path1"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt_Path2"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt"
|
||||
@@ -0,0 +1,10 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt"
|
||||
- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt"
|
||||
68
cmd/bisync/testdata/test_check_sync/golden/test.log
vendored
Normal file
68
cmd/bisync/testdata/test_check_sync/golden/test.log
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
(01) : test check-sync
|
||||
|
||||
|
||||
(02) : test initial bisync
|
||||
(03) : bisync resync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Copying unique Path2 files to Path1
|
||||
INFO : Resynching Path1 to Path2
|
||||
INFO : Resync updating listings
|
||||
INFO : Bisync successful
|
||||
|
||||
(04) : test 1. run check-sync-only on a clean sync
|
||||
(05) : bisync check-sync-only
|
||||
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
|
||||
INFO : Bisync successful
|
||||
|
||||
(06) : test 2. inject modified listings into the workdir
|
||||
(07) : copy-as {datadir/}_testdir_path1.._testdir_path2.path1.lst {workdir/} {session}.path1.lst
|
||||
(08) : copy-as {datadir/}_testdir_path1.._testdir_path2.path2.lst {workdir/} {session}.path2.lst
|
||||
|
||||
(09) : test 3. run check-sync-only on modified listings
|
||||
(10) : bisync check-sync-only
|
||||
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
|
||||
ERROR : - Path1 file not found in Path2 - file2.txt
|
||||
ERROR : - Path2 file not found in Path1 - file1.txt
|
||||
ERROR : Bisync critical error: path1 and path2 are out of sync, run --resync to recover
|
||||
ERROR : Bisync aborted. Must run --resync to recover.
|
||||
Bisync error: bisync aborted
|
||||
(11) : copy-listings check-sync-only
|
||||
|
||||
(12) : test 4. run normal sync to check that it aborts
|
||||
(13) : bisync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run
|
||||
ERROR : Bisync aborted. Must run --resync to recover.
|
||||
Bisync error: bisync aborted
|
||||
|
||||
(14) : test 5. prune failure listings after critical abort
|
||||
(15) : delete-glob {workdir/} *.lst
|
||||
(16) : delete-glob {workdir/} *.lst-err
|
||||
(17) : delete-glob {workdir/} *.lst-new
|
||||
|
||||
(18) : test 6. run resync
|
||||
(19) : bisync resync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Copying unique Path2 files to Path1
|
||||
INFO : Resynching Path1 to Path2
|
||||
INFO : Resync updating listings
|
||||
INFO : Bisync successful
|
||||
|
||||
(20) : test 7. run normal sync with check-sync enabled (default)
|
||||
(21) : bisync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Path1 checking for diffs
|
||||
INFO : Path2 checking for diffs
|
||||
INFO : No changes found
|
||||
INFO : Updating listings
|
||||
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
|
||||
INFO : Bisync successful
|
||||
|
||||
(22) : test 8. run normal sync with no-check-sync
|
||||
(23) : bisync no-check-sync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Path1 checking for diffs
|
||||
INFO : Path2 checking for diffs
|
||||
INFO : No changes found
|
||||
INFO : Updating listings
|
||||
INFO : Bisync successful
|
||||
1
cmd/bisync/testdata/test_check_sync/initial/RCLONE_TEST
vendored
Normal file
1
cmd/bisync/testdata/test_check_sync/initial/RCLONE_TEST
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete.
|
||||
0
cmd/bisync/testdata/test_check_sync/initial/file1.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file1.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file2.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file2.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file3.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file3.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file4.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file4.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file5.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file5.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file6.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file6.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file7.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file7.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file8.txt
vendored
Normal file
0
cmd/bisync/testdata/test_check_sync/initial/file8.txt
vendored
Normal file
8
cmd/bisync/testdata/test_check_sync/modfiles/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
8
cmd/bisync/testdata/test_check_sync/modfiles/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt"
|
||||
- 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt_Path1"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt_Path2"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt"
|
||||
8
cmd/bisync/testdata/test_check_sync/modfiles/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
8
cmd/bisync/testdata/test_check_sync/modfiles/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt_Path1"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt_Path2"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt"
|
||||
- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt"
|
||||
42
cmd/bisync/testdata/test_check_sync/scenario.txt
vendored
Normal file
42
cmd/bisync/testdata/test_check_sync/scenario.txt
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
test check-sync
|
||||
# Exercise listing integrity checks
|
||||
#
|
||||
# 1. Run check-sync-only on a clean sync
|
||||
# 2. Copy modified listings into the workdir
|
||||
# 3. Run check-sync-only on modified listings
|
||||
# 4. Run normal sync to check that it critical aborts
|
||||
# 5. Prune failure listings after critical abort
|
||||
# 6. Run resync
|
||||
# 7. Run normal sync with check-sync enabled (default)
|
||||
# 8. Run normal sync with no-check-sync
|
||||
|
||||
test initial bisync
|
||||
bisync resync
|
||||
|
||||
test 1. run check-sync-only on a clean sync
|
||||
bisync check-sync-only
|
||||
|
||||
test 2. inject modified listings into the workdir
|
||||
copy-as {datadir/}_testdir_path1.._testdir_path2.path1.lst {workdir/} {session}.path1.lst
|
||||
copy-as {datadir/}_testdir_path1.._testdir_path2.path2.lst {workdir/} {session}.path2.lst
|
||||
|
||||
test 3. run check-sync-only on modified listings
|
||||
bisync check-sync-only
|
||||
copy-listings check-sync-only
|
||||
|
||||
test 4. run normal sync to check that it aborts
|
||||
bisync
|
||||
|
||||
test 5. prune failure listings after critical abort
|
||||
delete-glob {workdir/} *.lst
|
||||
delete-glob {workdir/} *.lst-err
|
||||
delete-glob {workdir/} *.lst-new
|
||||
|
||||
test 6. run resync
|
||||
bisync resync
|
||||
|
||||
test 7. run normal sync with check-sync enabled (default)
|
||||
bisync
|
||||
|
||||
test 8. run normal sync with no-check-sync
|
||||
bisync no-check-sync
|
||||
Reference in New Issue
Block a user