summaryrefslogtreecommitdiff
path: root/src/test/test-path-util.c
Commit message (Collapse)AuthorAge
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-08-24
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* path-util: make path_make_relative() support path including dotsYu Watanabe2018-08-24
|
* path-util: introduce path_simplify()Yu Watanabe2018-08-24
| | | | | | | | The function is similar to path_kill_slashes() but also removes initial './', trailing '/.', and '/./' in the path. When the second argument of path_simplify() is false, then it behaves as the same as path_kill_slashes(). Hence, this also replaces path_kill_slashes() with path_simplify().
* util-lib: introduce new empty_or_root() helper (#8746)Lennart Poettering2018-08-24
| | | | | | | | We check the same condition at various places. Let's add a trivial, common helper for this, and use it everywhere. It's not going to make things much faster or much shorter, but I think a lot more readable
* path-util: document a few other special cases for last_path_component()Lennart Poettering2018-08-24
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Prep v236 : Add missing SPDX-License-Identifier (8/9) src/testSven Eden2018-03-26
|
* test-mount-util: move test_path_is_mount_point hereZbigniew Jędrzejewski-Szmek2017-10-31
| | | | | | | path-util.c and mount-util.c are intertwined, but path_is_mount_point() is defined in mount-util.c. No functional difference.
* path-util: some updates to path_make_relative()Lennart Poettering2017-11-22
| | | | | | | | | | Don't miscount number of "../" to generate, if we "." is included in an input path. Also, refuse if we encounter "../" since we can't possibly follow that up properly, without file system access. Some other modernizations.
* Prep v235: Apply pending upstream updates in src/test [4/4]Sven Eden2017-08-30
|
* Prep v234: Apply missing upstream fixes in src/test (6/6)Sven Eden2017-07-25
|
* basic/path-util: allow flags for path_equal_or_files_sameZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | No functional change, just a new parameters and the tests that AT_SYMLINK_NOFOLLOW works as expected.
* tmpfiles: use safe_glob()Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | This filters out "." and ".." from glob results. Fixes #5655 and #5644. Any judgements on whether the path is "safe" are removed. We will not remove "/" under any name (including "/../" and such), but we will remove stuff that is specified using paths that include "//", "/./" and "/../". Such paths can be created when joining strings automatically, or for other reasons, and people generally know what ".." and "." is. Tests are added to make sure that the helper functions behave as expected.
* Prep v233.3: Add all possible coverage tests for elogindSven Eden2017-07-20
|
* Remove src/testAndy Wingo2015-04-19
|
* shared: add path_compare(), an ordering path comparisonMichal Schmidt2015-03-16
| | | | ... and make path_equal() a simple wrapper around it.
* systemctl: refuse to edit runtime dropins when they already exist in /etcZbigniew Jędrzejewski-Szmek2014-12-16
| | | | | | The check for existing unit files and dropins is unified. path_join() is updated to not insert duplicate separators.
* test-path-util: fix a leakThomas Hindoe Paaboel Andersen2014-12-04
|
* Do not check for existence of remote binariesZbigniew Jędrzejewski-Szmek2014-11-22
| | | | | | | | | | | | | | systemd-run would fail when run with -M or -H and an absolute path, if this path did not exists locally. Allow it to continue, since we don't have a nice way of checking if the binary exists remotely. The case where -M or -H is used and a local path is unchanged, and we still iterate over $PATH to find the binary. We need to convert to an absolute path, and we don't have a nice mechanism to check remotely, so we assume that the binary will be located in the same place locally and remotely. http://lists.freedesktop.org/archives/systemd-devel/2014-November/025418.html
* tests: add tests for path_startswithRonny Chevalier2014-10-31
|
* test-path-util: fix a mem leak and avoid confusing coverityThomas Hindoe Paaboel Andersen2014-09-30
| | | | Found with coverity. Fixes CID#1237754 and #1237790
* test-path-util: use assert_se in all assertionsFilipe Brandenburger2014-08-26
| | | | | | | | Otherwise they get optimized out when CPPFLAGS='-DNDEBUG' is used, and that causes the tests to fail. Tested: - make check TESTS='test-path-util' CPPFLAGS='-DNDEBUG'
* Add utility function to append root to pathZbigniew Jędrzejewski-Szmek2014-07-26
|
* consistently order cleanup attribute before typeThomas Hindoe Paaboel Andersen2014-06-22
|
* test: unit test for using alternate roots with path_strv_resolveMichael Marineau2014-06-20
|
* test-path-util: add tests for path_make_relative()Tanu Kaskinen2014-05-25
|
* test-path-util: fix running with separate build dirZbigniew Jędrzejewski-Szmek2014-04-16
| | | | | test-path-utils attempts to find itself, but if the binary is not in current directory, the test would fail.
* path-util: also check for existence of binary when given absolute pathZbigniew Jędrzejewski-Szmek2014-04-12
| | | | | | | | | In contrast to a filename-only argument, find_binary() did not actually check if an path exists, allowing the code to fail later on. This was OK, but it seems nicer to treat both paths identically. Also take advantage of path_make_absolute_cwd doing strdup() by itself if necessary to simplify.
* fsck: Search for fsck.type in PATHMike Gilbert2014-04-12
| | | | | | Modifies find_binary() to accept NULL in the second argument. fsck.type lookup logic moved to new fsck_exists() function, with a test.
* Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek2013-12-06
| | | | | | The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
* util: properly handle the root dir in PATH_FOREACH_PREFIXLennart Poettering2013-09-26
| | | | | Also add PATH_FOREACH_PREFIX_MORE which includes the specified dir itself in the iteration
* util: add macro for iterating through all prefixes of a pathLennart Poettering2013-09-25
| | | | Syntactic sugar in a macro PATH_FOREACH_PREFIX.
* run: allow non-absolute paths as commandZbigniew Jędrzejewski-Szmek2013-09-09
|
* test-path-util,test-sched-prio: uninitialize manager to appease valgrindZbigniew Jędrzejewski-Szmek2013-07-12
|
* test-path-util: fix another stupid test failureZbigniew Jędrzejewski-Szmek2013-03-29
|
* test-path-util: fix botched testZbigniew Jędrzejewski-Szmek2013-03-29
|
* tests: add some silly tests for path-util.cZbigniew Jędrzejewski-Szmek2013-03-28