* How the rclone_jobber test suite works
Each of the following sections describes one test case.

Test-script names start with "test_".
Each test_ script creates two directories:
- test_rclone_data
- test_rclone_backup

Each test_ script tests two or three job_ scripts.
Job-script names start with "job_".

Test procedure for each test script:
1. run the test script from the terminal
2. manually inspect output for expected results (expected results are listed in test output and enclosed in parenthesis)

rlcone_jobber.sh was tested on Linux Fedora 27, Gnome 3.26.2, rclone v1.39
rlcone_jobber.sh was tested on Linux Debian 9, Gnome 3.22.2, rclone v1.41

* test_last_snapshot.sh
Testing:
- filter exclude files ending with listed suffix
- attempt to restore deleted sub-directory from last snapshot

Passed 5/27/18

Expected result:
- file names ending in "_exe" are excluded from backup
- deleted directory direc1/direc1b/ can not be restored because move_old_files_to=\"\"

Dependencies:
- job_snapshot_backup_old_data_to_delete.sh
- job_snapshot_restore_from_last_snapshot.sh
- rclone_jobber.sh
- filter_rules

* test_restore_deleted_directory.sh
This test is similar to test_onedrive.sh but w/o encryption.

Testing:
- move_old_files_to="typo" should give pop-up warning and default to "dated_directory"
- attempt to back up a deleted top directory gets rclone message, and does not delete files
- restore deleted sub-directory

Passed 5/27/18

Expected result:
- 2 pop-up warnings:
:    WARNING: Parameter move_old_files_to=typo, but should be...
:    WARNING: Parameter move_old_files_to=typo, but should be...
- rclone_jobber.log (located in same directory as rclone_jobber.sh) contains a WARNINGs and a INFOs:
:    WARNING: Parameter move_old_files_to=typo, but should be...
:    ...
:    2018/02/19 16:17:51 INFO  : Local file system at /home/wolfv/test_rclone_backup/last_snapshot: ...
:    ...
- test will prompt for date_time of direc1b to restore
- data contains restored direc1/direc1b_$timestamp/f1b

Dependencies:
- job_dir_backup_to_dated_directory.sh
- job_dir_restore_from_dated_directory.sh
- rclone_jobber.sh

* test_USB.sh
This test script uses environment variable USB, set it to your USB's path.
For example, in Linux add this line to ~./profile file:
: export USB="/run/media/user/myUSB"

and then source from command line:
: $ source ~/.profile
: $ echo $USB
: /run/media/user/myUSB

Testing:
- backup to USB
- move_old_data="dated_files"
- restore dated file
- --checksum option

Passed 5/27/18

Expected result:
- old f1 file is restored in f1_<date>

Dependencies:
- job_USB_backup_to_USB.sh
- job_USB_restore_from_USB.sh
- rclone_jobber.sh

* test_1d.sh
"1d" means OneDrive remote.
This test is similar to test_restore_deleted_directory.sh but on encrypted OneDrive.

To set up a remote, follow instructions on https://rclone.org/onedrive/ substituting this value:
- name> onedrive

To set up encryption, follow instructions on https://rclone.org/crypt/ substituting these values:
- name> onedrive_crypt
- remote> onedrive:test_rclone_backup

Testing:
- backup to encrypted OneDrive
- same as [[*test_restore_deleted_directory.sh][test_restore_deleted_directory.sh]] 
- abort if job is already running (maybe previous run didn't finish)
- --checksum option

Open two terminals
Manually test "job aborted because it is already running."
: $ ./test_1d.sh

It takes 1 minute for a remote job to complete.
While that's running, call the backup job again from the other terminal:
: $ ./job_1d_backup_to_dated_directory.sh
: job_1d_backup_to_dated_directory.sh aborted because it is already running.

Passed 5/27/18

Expected result:
- see expected result listing in [[*test_restore_deleted_directory.sh][test_restore_deleted_directory.sh]]
- the OneDrive backup has two copies of deleted files: dated directory and OneDrive Recycle bin
  - deleted files are moved to a dated directory, which is use for restoring a deleted directory
  - deleted files are moved to the OneDrive Recycle bin (most cloud storage providers don't or provide a way to turn it off)
  - you can manually empty the OneDrive Recycle bin from the OneDrive website

Dependencies:
- job_1d_backup_to_dated_directory.sh
- job_1d_restore_from_dated_directory.sh
- rclone_jobber.sh

* test_check_range.sh
Testing:
- empty source
- null source string
- null dest string
- monitoring_URL

Passed 5/27/18

Expected result:
- all 3 backup jobs generate an error message, no backups are made
- monitoring_URL sends an email after 24 hrs grace period

Dependencies:
- job_check_empty_source.sh
- job_check_null_source.sh
- job_check_null_dest.sh
- rclone_jobber.sh

* License
[[http://creativecommons.org/publicdomain/zero/1.0/][http://i.creativecommons.org/p/zero/1.0/88x31.png]]\\
This README file and other files contained in this test_suite directory are for testing rclone_jobber.sh.
Written in 2018 by Wolfram Volpi, contact at https://github.com/wolfv6/rclone_jobber/issues.
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide.
This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

rclone_jobber is not affiliated with rclone.
