Commit Graph

20 Commits

Author SHA1 Message Date
Jerome Charaoui
6b517acacc tests: don't fail if remote /var/backups unmounted 2021-01-06 22:36:20 -05:00
Jerome Charaoui
ad38ad49d1 tests: only unmount backupdir if necessary 2021-01-06 22:36:20 -05:00
Jerome Charaoui
3733864bfb tests: make filename optional in set/delconfig 2021-01-06 22:36:20 -05:00
Jerome Charaoui
20ea06b603 tests: improve testaction and runaction
Auto-find test component/file and check status code.
2021-01-06 22:36:20 -05:00
Jerome Charaoui
5bc6b9c1b5 tests: improve setconfig_repeat 2021-01-06 22:36:20 -05:00
Jerome Charaoui
1869192529 tests: add makegpgkeys common function
This is needed to test duplicity pubkey encryption.
2021-01-06 22:36:20 -05:00
Jerome Charaoui
f67cdd49d0 tests: Fix typo in common.bash 2021-01-06 22:36:20 -05:00
Jerome Charaoui
dd17ed2340 tests: Overhaul, expand common functions 2021-01-06 22:36:20 -05:00
Jerome Charaoui
9332906386 tests: Declare useful global vars in common.bash 2021-01-06 22:36:20 -05:00
Jerome Charaoui
4d6307184e tests: Unique /var/backups cleanup function 2021-01-06 22:36:20 -05:00
Jerome Charaoui
bd25f93c91 tests: Drop using /tmp/backups as destination dir
Instead use /var/backups for both local and remote backups to simplify
things.
2021-01-06 22:36:20 -05:00
Jerome Charaoui
41b8e661ca tests: Fix setconfig when value contains spaces 2021-01-06 22:36:20 -05:00
Jerome Charaoui
54fd9f10b8 tests: Improve handling of log file during teardown 2021-01-06 22:36:20 -05:00
Jerome Charaoui
6f5411db03 tests: Use crudini instead of sed for config edits 2021-01-06 22:36:20 -05:00
Jerome Charaoui
75161fb65e tests: Fix comment 2021-01-06 22:36:20 -05:00
Jerome Charaoui
1dcc1eba76 tests: Support paths in setconfig 2021-01-06 22:36:20 -05:00
Jerome Charaoui
4dd6a0971d tests: Fix setconfig() and make more robust 2021-01-06 22:36:20 -05:00
Jerome Charaoui
57b2f217a8 tests: Support component-specific setup & teardown
This introduces support for setup_*, teardown_*, being_* and finish_*
functions in component tests. For example, when testing the sh handler
component in "sh.bats", this will invoke setup_sh and teardown_sh for
each test case, and begin_sh and finish_sh at the beginning of the first
test case and at the end of the last one.
2021-01-06 22:36:20 -05:00
Jerome Charaoui
4c56e50857 tests: Show debug logfile when a test case fails 2021-01-06 22:36:20 -05:00
Jerome Charaoui
427ff780a4 tests: Introduce bats-based testsuite
- Depends on being run inside vagrant
 - Installs dependencies automatically
 - Environment is fully reset for each test
 - Adds testcases for backupninja and sys handler
 - Docs are missing but will be added

Two tests are currently failing due to two bugs, one of which has gone
unreported.
2021-01-06 22:36:20 -05:00