summaryrefslogtreecommitdiff
path: root/src/test/test-copy.c
Commit message (Collapse)AuthorAgeFilesLines
* test-copy: never call alloca() in a loopLennart Poettering2016-04-291-8/+14
| | | | | | | That's a total no-no, hence rework this to use malloc()-based memory instead of alloca()-based memory. Also see CODING_STYLE about this.
* copy: also copy AF_UNIX socketsLennart Poettering2016-04-291-0/+9
| | | | | | | | We previously would fail with EOPNOTSUPP when encountering an AF_UNIX socket in the directory tree to copy. Fix that, and copy them too (even if they are dead in the result). Fixes: #2914
* test-copy: use correct data type for max_bytesMartin Pitt2016-03-211-3/+3
| | | | | | | | copy_bytes() and the comparisons in test_copy_bytes_regular_file() expect an uint64_t, not a size_t. On 32 bit architectures the latter is 32 bit, leading to truncation errors. Fixes regression from commit 7a827fcb.
* test-copy: test with different max_bytes valuesZbigniew Jędrzejewski-Szmek2016-03-151-10/+25
|
* test-copy: add a test shuffling bytes between normal filesZbigniew Jędrzejewski-Szmek2016-03-151-0/+46
| | | | | | | | | | | | I started looking into adding copy_file_range support, and discovered that we can improve the way we call sendfile: - sendfile(2) man page is missing an important bit: the number of bytes to copy cannot be too big (SSIZE_MAX actually), and the description of EINVAL return code does not mention this either, - our implementation works but calls sendfile over and over with a small size, which seems suboptimal. First add a test which (under strace) can be used to see current behaviour.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move a number of fs operations into fs-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-3/+4
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* tree-wide: never use the off_t unless glibc makes us use itLennart Poettering2015-09-101-1/+1
| | | | | | | | | | | off_t is a really weird type as it is usually 64bit these days (at least in sane programs), but could theoretically be 32bit. We don't support off_t as 32bit builds though, but still constantly deal with safely converting from off_t to other types and back for no point. Hence, never use the type anymore. Always use uint64_t instead. This has various benefits, including that we can expose these values directly as D-Bus properties, and also that the values parse the same in all cases.
* fileio: consolidate write_string_file*()Daniel Mack2015-07-061-3/+3
| | | | | | | Merge write_string_file(), write_string_file_no_create() and write_string_file_atomic() into write_string_file() and provide a flags mask that allows combinations of atomic writing, newline appending and automatic file creation. Change all users accordingly.
* test: fix test-copy without /etc/os-release.Dimitri John Ledkov2015-06-231-1/+3
|
* test-copy: test copy_bytes()Zbigniew Jędrzejewski-Szmek2015-06-101-0/+35
|
* util: rework rm_rf() logicLennart Poettering2015-04-061-4/+5
| | | | | | | | - Move to its own file rm-rf.c - Change parameters into a single flags parameter - Remove "honour sticky" logic, it's unused these days
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-031-6/+6
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* machined: when cloning a raw disk image, also set the NOCOW flagLennart Poettering2015-01-081-1/+1
|
* copy: use btrfs reflinking only whe we know we copy full filesLennart Poettering2014-12-121-2/+2
|
* copy: teach copy_bytes() sendfile() support, and then replace ↵Lennart Poettering2014-11-071-0/+26
| | | | sendfile_full() by it
* tests: add test-copyRonny Chevalier2014-10-311-0/+115