Commit Graph

34 Commits

Author SHA1 Message Date
Michael Eischer 985722b102 Remove ctx from globalOptions
Previously the global context was either accessed via gopts.ctx,
stored in a local variable and then used within that function or
sometimes both. This makes it very hard to follow which ctx or a wrapped
version of it reaches which method.

Thus just drop the context from the globalOptions struct and pass it
explicitly to every command line handler method.
2022-10-03 00:19:46 +02:00
Michael Eischer ebab35581c Check in integration test that snapshots are listed before the index
As an exception prune is still allowed to load the index before
snapshots, as it uses exclusive locks. In case of problems with locking
it is also better to load snapshots created after loading the index, as
this will lead to a prune sanity check failure instead of a broken snapshot.
2022-04-09 12:27:27 +02:00
Greg 2e9180638e Fix test failures on Solaris
Add exceptions for symlinks, sticky bits, and device nodes in the same places where the BSDSs and/or Darwin have them.
2022-01-25 18:05:56 -08:00
Michael Eischer 2f8335554c Remove a few unused variables 2020-09-05 10:06:23 +02:00
Michael Eischer 88ad58d6cd integration tests: Redirect directory diff into intermediate buffer 2020-08-29 10:48:44 +02:00
Michael Eischer d465b5b9ad Revert "Darwin test fix: allow 1μs timestamp difference"
This reverts commit f3016a9096.
2020-05-01 17:11:30 +02:00
Iku Iwasa f080142137 Support NetBSD without fuse 2018-06-16 15:55:04 +09:00
Alexander Neumann c67a8452f7 Disable polynomial check for chunker for tests 2018-03-11 20:59:40 +01:00
Björn Ketelaars f63d7048f9 Fix test failing on OpenBSD #1307
Is seems that #1307 is similar to #1087, which describes a comparable
observation on Apple's new filesystem. #1389 Has been committed and
fixes the problem on Darwin.

Although I'm not sure if the root cause of the issue is the same the
solution is similar for OpenBSD, and leverages #1389.
2017-11-05 07:27:58 +01:00
Konrad Wojas f3016a9096 Darwin test fix: allow 1μs timestamp difference
On Darwin, allow a 1μs difference in restored timestamps, because
macOS <10.13 cannot restore with nanosecond precision and the current
version of Go (1.9.2) does not yet support the new syscall required
for this. (#1087 #1389)
2017-10-29 20:48:07 +08:00
Herbert 033589a66b Use rtest on these as well to keep codebase consistent 2017-10-02 17:48:08 +02:00
Herbert 3473c3f7b6 Remove all dot-imports 2017-10-02 15:06:39 +02:00
Alexander Neumann 9be24a1c9f Add cache
This commits adds rudimentary support for a cache directory, enabled by
default. The cache directory is created if it does not exist. The cache
is used if there's anything in it, newly created snapshot and index
files are written to the cache automatically.
2017-09-24 21:54:53 +02:00
Alexander Neumann a60e751217 Use .Equal() instead of == for time.Time
Closes #1238
2017-09-15 20:57:35 +02:00
Alexander Neumann d780b1eede Rework withTestEnvironment
Switch from a function passed as a parameter to a cleanup function,
which is also executed when the test function panics, so no temporary
directories are left behind.
2017-07-24 21:32:34 +02:00
Pauline Middelink 1717391f6c Fuse testing leaves test mountpoint around. Move it under the testing tree which is removed after each test. 2017-07-24 20:33:39 +02:00
Alexander Neumann 6caeff2408 Run goimports 2017-07-23 14:21:03 +02:00
Alexander Neumann 83d1a46526 Moves files 2017-07-23 14:19:13 +02:00
Alexander Neumann b63399d606 Move things around for gb
This moves all restic source files to src/, and all vendored
dependencies to vendor/src.
2016-02-20 17:31:20 +01:00
Alexander Neumann f05a32509e Add "Test" prefix to backend test functions 2016-01-23 19:12:02 +01:00
Alexander Neumann 1f9aea9905 fix test on windows, reset read-only flag 2015-11-08 22:41:45 +01:00
Alexander Neumann fcb769fa3b Merge pull request #262 from restic/fix-tests
Fix tests
2015-08-18 22:45:50 +02:00
Alexander Neumann 1a47ea4ab8 test helpers: add RemoveAll and ResetReadOnly
This is mainly needed in Windows, where files and dirs cannot be
removed unless they are writeable.
2015-08-18 21:40:40 +02:00
klauspost a3570af500 Create separate disEntry.equals for Windows.
Windows does not have UID/GID the same way as unix,
so we don't attempt to compare them.
2015-08-17 11:10:12 +02:00
Alexander Neumann deaca157fe restore: ignore errors
Also add a test for restoring a file that is owned by root. Closes #244.
2015-07-25 12:59:59 +02:00
Alexander Neumann 258b6a77ee Refactor skipping symlink ModTime checks, add OpenBSD 2015-07-20 21:29:21 +02:00
Alexander Neumann bd3ce5d4a3 Fix tests on freebsd 2015-07-20 21:08:29 +02:00
Florian Weingarten c2d5a9209e fix darwin integration tests 2015-07-09 11:13:40 -04:00
Alexander Neumann a99a460b32 Fix integration tests 2015-06-21 17:40:22 +02:00
Alexander Neumann 4388474cdc Restructure `cmd/restic`, no functional changes 2015-06-21 17:40:22 +02:00
Alexander Neumann 2fa259816b rename `opts` to `mainOpts` 2015-06-21 17:40:22 +02:00
Alexander Neumann a176b1b5a6 Add more integration tests 2015-06-21 17:40:22 +02:00
Alexander Neumann 12677b4f8a Use flag instead of build tag to run integration tests 2015-06-21 17:40:21 +02:00
Alexander Neumann 7c107acf0b More integration tests 2015-06-21 17:40:21 +02:00