Commit graph

394 commits

Author SHA1 Message Date
Thomas Waldmann
c4ffbd2a17 prepare to support multiple chunkers 2019-02-13 04:24:14 +01:00
Thomas Waldmann
e878ca5189 test_mount_hardlinks: get rid of fakeroot-caused test fails, fixes #3389 2019-02-11 17:47:34 +01:00
Thomas Waldmann
600e798201 borg init --make-parent-dirs parent1/parent2/repo_dir, fixes #4235 2019-02-04 17:12:11 +01:00
Thomas Waldmann
f4e1ba5995 fix duplicate test method name, fixes #4311
thanks to Anthony Sottile for finding this!
2019-02-03 02:37:49 +01:00
Manuel Riel
9ab0a095ab Add --rsh command line option to complement BORG_RSH env var. Fixes #… (#4290)
Add --rsh command line option to complement BORG_RSH env var. Fixes #1701
2019-01-31 13:54:17 +01:00
Manu
e155822474 Quit with error message when no config key is provided. Fixes #4223 2019-01-30 11:31:53 +08:00
Thomas Waldmann
c87393cab7 remove deprecated option: --list-format
replaced by: --format
2018-12-11 22:42:48 +01:00
Thomas Waldmann
933e82a49c remove deprecated option: --keep-tag-files
replaced by: --keep-exclude-tags
2018-12-11 22:41:23 +01:00
Thomas Waldmann
7cd1b8151e remove deprecated command: borg change-passphrase
replaced by: borg key change-passphrase
2018-12-11 22:36:39 +01:00
Thomas Waldmann
3d05a4b114 xattrs: linux does not allow user.* xattrs on symlinks 2018-11-16 23:15:04 +01:00
Thomas Waldmann
53971e8e79 xattr key names must start with user. on linux
... or the call will just error with "operation not supported"
2018-11-16 23:15:04 +01:00
Thomas Waldmann
d0a01c532e pytest4 complains if we directly call the fixture function, fixes #4172
just added a normal function with the code, call it from fixture and
also from unittest test method.
2018-11-16 01:30:31 +01:00
Emmo Emminghaus
733a2bfa30 Introduce borg.platformflags.is_<os> 2018-11-10 23:34:43 +01:00
Emmo Emminghaus
973921df5a remove unneded code and remarks, added needed except clause 2018-11-10 21:56:39 +01:00
Emmo Emminghaus
558ca61d20 remove posix issues and fixup for unsupported methodes 2018-11-10 21:48:46 +01:00
step21
0d26ad3661 Explicitly convert environment variable to str to address #4136 2018-10-31 09:41:02 +01:00
Thomas Waldmann
5c66a60f79 flake8: fix W605 (invalid escape sequences) 2018-10-29 12:36:07 +01:00
Thomas Waldmann
10cdadb2f8 flake8: fix F841 2018-10-29 12:36:03 +01:00
Thomas Waldmann
eebc33a281 dump-repo-objs: filename layout improvements
(cherry picked from commit 24812b0317)
2018-08-09 08:29:46 +02:00
Thomas Waldmann
3c173cc03b wrap msgpack, fixes #3632, fixes #2738
wrap msgpack to avoid future upstream api changes making troubles
or that we would have to globally spoil our code with extra params.

make sure the packing is always with use_bin_type=False,
thus generating "old" msgpack format (as borg always did) from
bytes objects.

make sure the unpacking is always with raw=True,
thus generating bytes objects.

note:

safe unicode encoding/decoding for some kinds of data types is done in Item
class (see item.pyx), so it is enough if we care for bytes objects on the
msgpack level.

also wrap exception handling, so borg code can catch msgpack specific
exceptions even if the upstream msgpack code raises way too generic
exceptions typed Exception, TypeError or ValueError.
We use own Exception classes for this, upstream classes are deprecated
2018-08-06 17:32:55 +02:00
Thomas Waldmann
9654126247 minor change: simplify test setup
most of the files created via self.create_test_files() are not needed.
the only one is the empty file, so just create it here.

also: move repo init to after test file creation.
2018-08-06 14:28:46 +02:00
Thomas Waldmann
52f1cd4bc6 argparse: work around bad default in py 3.7.0a/b/rc, fixes #3996 2018-07-30 01:04:14 +01:00
Thomas Waldmann
a7dd2560ba remove loggerDict.clear() from tearDown method, fixes #3805
It causes problems with the new caching in the py37 logger module.

Removing loggerDict.clear() fixes this and makes the tests work again.
Also, it does not seem to have any negative effect, neither on py36
nor on py37.

See also: https://bugs.python.org/issue34269
2018-07-29 12:29:26 +01:00
Thomas Waldmann
efe60bd640 test fixes 2018-07-14 14:29:28 +02:00
Thomas Waldmann
44b4f9645d xattrs: use follow_symlinks=False as default, more tests
it's like we do it everywhere else because this is what we usually need.
2018-07-08 15:08:01 +02:00
Thomas Waldmann
394d59e6d8 xattr: implement set_all to complement get_all
also: follow_symlinks param defaults to False (we do never use True)

fix tests, xattrs are set via FD now.
2018-07-07 15:47:56 +02:00
Thomas Waldmann
c29c3063b0 xattr: use bytes typed path for listxattr, getxattr, setxattr 2018-07-07 15:47:56 +02:00
Thomas Waldmann
9deb90db71 xattr: use bytes typed names for listxattr, getxattr, setxattr 2018-07-07 15:47:56 +02:00
Thomas Waldmann
b5a9ac5682 xattr: use bytes typed values for listattr, getxattr, setxattr
- getxattr should only return bytes, not None
- setxattr should not get a None value, just bytes
- remove unneeded tmp vars
2018-07-07 15:47:56 +02:00
Thomas Waldmann
99149684bf xattr: move to platform package, use cython, fixes #2495
this code used to live in borg.xattr and used ctypes
(and was the only ctypes-using code in borg).

the low level code now was converted to cython and
the platform code moved to platform package.

got rid of the code that tried to find the libc.
2018-07-07 15:47:56 +02:00
Thomas Waldmann
04e14933e7 tests: trying to debug test fails on travis, #3494
- reordered code a little, so files are touched in different order

let's see if this changes anything.

- create_regular_file: giving size AND contents is not supported

the code did not create a 4096 bytes long file, but just a 1 byte
long file. adding an assertion to avoid unsupported usage.

(cherry picked from commit 2d490aa8c8)
2018-06-30 23:24:34 +02:00
Thomas Waldmann
acb15fd960 tests: fetch less data via os.urandom
freebsd12 is unhappy with having to deliver 50MiB random in one go
and fails with BlockingIOError "temporary unavailable" when trying.

for test_lz4_buffer_allocation, it is good enough to fetch 5MiB and
concatenate that 10 times.
2018-06-29 09:36:00 +02:00
Rémi Oudin
73410861ae borg config --list <repo>, fixes #3612
Add --list option to dump the repo configuration / the default values.

Also: fixes argument order in borg config tests
2018-06-08 08:26:32 +02:00
Thomas Waldmann
b1e7e7f90a
cleanup: get rid of Cache.do_files, replace with cache_mode
not do_files == (cache_mode == 'd')  # d)isabled
2018-03-24 17:04:20 -07:00
Thomas Waldmann
0a46d3330c add test for issue #3688 2018-03-17 18:24:55 +01:00
Thomas Waldmann
2d637d8ead borg config: add some validation, fixes #3566
only a few basic checks, it does not prevent all stupidities.
2018-03-05 17:50:06 +01:00
Thomas Waldmann
4e0f369d0a fix borg create never showing M status
the problem was that the upper layer code did not have enough information
about the file, whether it is known or not - and thus, could not decide
correctly whether status should be M)odified or A)dded.

now, file_known_and_unchanged method returns an additional "known"
boolean to fix this.

also: add comment about files cache loading in cache_mode='r'
2018-02-26 11:07:20 +01:00
Thomas Waldmann
246a8d57ee fix erroneously skipped zstd compressor tests, fixes #3606 2018-02-10 20:10:21 +01:00
Thomas Waldmann
835fede85f fixup: tests 2018-01-20 13:34:46 +01:00
Thomas Waldmann
c5a339384e added BORG_BASE_DIR, s/get_home_dir/get_base_dir/g, docs, fixes #3338
also: sorted env var docs by level
2017-12-23 01:42:18 +01:00
Thomas Waldmann
0abf42f29e modify borg check unit test so it "hangs", see #3444
it doesn't infinitely hang, but slows down considerably.

(cherry picked from commit a68d28bfa4)
2017-12-16 21:44:10 +01:00
Thomas Waldmann
11b2311e6e add zstd compression
based on willyvmm's work in PR #3116, but some changes:

- removed any mulithreading changes
- add zstandard in setup.py install_requires
- tests
- fix: minimum compression level is 1 (not 0)
- use 3 for the default compression level
- use ID 03 00 for zstd
- only convert to bytes if we don't have bytes yet
- move zstd code so that code blocks are ordered by ID
- other cosmetic fixes
2017-12-15 00:29:26 +01:00
Thomas Waldmann
75854c1243 security: fix enforcement of --restrict-to-path in args processing
Fixes CVE-2017-15914 (affects releases 1.1.0, 1.1.1, 1.1.2,
but not 1.0.x).

Thanks to Florian Apolloner for discovering/reporting this!

Also: added tests for this.
(cherry picked from commit ea0203bb0d)
2017-12-02 18:13:11 +01:00
TW
c5dc75ae23
Merge pull request #3312 from milkey-mouse/borg-config-cmd
Add borg config command
2017-11-24 16:56:15 +01:00
Milkey Mouse
1e520203cb
Fix borg config flake8 failures
Suppressed E731 so lambdas can be assigned to vars
2017-11-23 14:54:53 -08:00
Milkey Mouse
5b47cf6fa5
Add borg config command (fixes #3304)
This command works similarly to "git config" - it parses repo and
cache configs to get, set, and delete values. It only works on local
repos so a malicious client can't e.g. override their storage quota
or reset the append_only flag.

Add tests for borg config

Add documentation for borg config

Change manual config edits -> borg config

There were a couple places in the documentation where it was advised
to edit the repository or cache config file, a process that is stream-
lined by borg config.
2017-11-23 14:51:54 -08:00
Thomas Waldmann
e97deafb16 borg mount: support hardlinks correctly, add tests
previous commit did not yet support hardlinks correctly, if the
hardlink master was excluded somehow.

added some tests for this, also refactored related tests slightly.
2017-11-21 15:39:47 +01:00
Thomas Waldmann
f9cd6f7512 crc32: deal with unaligned buffer, tests, fixes #3317
fixing only the (generic) slice-by-8 crc32 implementation,
it is assumed that CPUs supporting CLMUL can also efficiently
and correctly deal with unaligned accesses.

slice-by-8 is used e.g. on ARM cpus and they might not (efficiently)
support unaligned memory access, leading to bus errors or low
performance.
2017-11-14 15:27:51 +01:00
TW
b3c11dee6c
Merge pull request #3318 from milkey-mouse/borgfs-formatting-test
Check borgfs rst formatting in tests
2017-11-14 00:29:24 +01:00
Sam H
b0141c1dc9 include item birthtime in archive (where available) (#3313)
include item birthtime in archive, fixes #3272

* use `safe_ns` when reading birthtime into attributes
* proper order for `birthtime` in `ITEM_KEYS` list
* use `bigint` wrapper for consistency
* Add tests to verify that birthtime is normally preserved, but not preserved when `--nobirthtime` is passed to `borg create`.
2017-11-13 14:55:10 +01:00