52 lines · 2.6 KB · Text
RawDownload
# tests whether rclone check and rclone sync output exactly the same file lists.# uses two different old versions of rclone source code for the src and dst # to produce a more realistic test than makefiles# (has lots of files with same name but different content) # Filling src and dst with two different versions of rclone source!:exec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.49.1.zip $SRC/src.zipexec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.54.1.zip $DST/dst.zipexec unzip $SRC/src.zip -d $SRCexec unzip $DST/dst.zip -d $DST  # running rclone check for baseline test:# error is expected here:! exec rclone check $SRC $DST --match $WORK/CHECKmatch.txt --combined $WORK/CHECKcombined.txt --missing-on-src $WORK/CHECKmissingonsrc.txt --missing-on-dst $WORK/CHECKmissingondst.txt --error $WORK/CHECKerr.txt --differ $WORK/CHECKdiffer.txt -q # running sync with output files:exec rclone sync $SRC $DST --match $WORK/SYNCmatch.txt --combined $WORK/SYNCcombined.txt --missing-on-src $WORK/SYNCmissingonsrc.txt --missing-on-dst $WORK/SYNCmissingondst.txt --error $WORK/SYNCerr.txt --differ $WORK/SYNCdiffer.txt # sorting them by line and diffing:exec sort $WORK/CHECKmatch.txt -o $WORK/CHECKmatch.txtexec sort $WORK/CHECKcombined.txt -o $WORK/CHECKcombined.txtexec sort $WORK/CHECKmissingonsrc.txt -o $WORK/CHECKmissingonsrc.txtexec sort $WORK/CHECKmissingondst.txt -o $WORK/CHECKmissingondst.txtexec sort $WORK/CHECKerr.txt -o $WORK/CHECKerr.txtexec sort $WORK/CHECKdiffer.txt -o $WORK/CHECKdiffer.txt exec sort $WORK/SYNCmatch.txt -o $WORK/SYNCmatch.txtexec sort $WORK/SYNCcombined.txt -o $WORK/SYNCcombined.txtexec sort $WORK/SYNCmissingonsrc.txt -o $WORK/SYNCmissingonsrc.txtexec sort $WORK/SYNCmissingondst.txt -o $WORK/SYNCmissingondst.txtexec sort $WORK/SYNCerr.txt -o $WORK/SYNCerr.txtexec sort $WORK/SYNCdiffer.txt -o $WORK/SYNCdiffer.txt # diff match check vs. sync:cmp $WORK/CHECKmatch.txt $WORK/SYNCmatch.txt# diff combined check vs. sync:cmp $WORK/CHECKcombined.txt $WORK/SYNCcombined.txt# diff missingonsrc check vs. sync:cmp $WORK/CHECKmissingonsrc.txt $WORK/SYNCmissingonsrc.txt# diff missingondst check vs. sync:cmp $WORK/CHECKmissingondst.txt $WORK/SYNCmissingondst.txt# diff error check vs. sync:cmp $WORK/CHECKerr.txt $WORK/SYNCerr.txt# diff differ check vs. sync:cmp $WORK/CHECKdiffer.txt $WORK/SYNCdiffer.txt # verify accuracyexec rclone check $SRC $DSTexec diff -rya --suppress-common-lines $SRC $DST[!windows] exec rsync -aEvhPu $SRC/ $WORK/rsyncDst[!windows] exec rclone check $DST $WORK/rsyncDst