summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAdrian Szyndela <adrian.s@samsung.com>2020-03-30 09:26:14 +0200
committerAdrian Szyndela <adrian.s@samsung.com>2020-04-02 11:49:00 +0200
commit209f6856c7c81a70c96e1d5726d138bad0ff9425 (patch)
tree396759c788d098299d1a138f3ebe8d2502b74151 /src/test
parent7c41bee61ed80e15524b340fea1faec3ecc62a24 (diff)
downloadsystemd-209f6856c7c81a70c96e1d5726d138bad0ff9425.tar.gz
systemd-209f6856c7c81a70c96e1d5726d138bad0ff9425.tar.bz2
systemd-209f6856c7c81a70c96e1d5726d138bad0ff9425.zip
test-copy: allow copy from symlinked dir
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-copy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index 68905c662d..37ab70888c 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -78,8 +78,9 @@ static void test_copy_file_fd(void) {
}
static void test_copy_tree(void) {
- char original_dir[] = "/var/tmp/test-copy_tree/";
+ char path_original_dir[] = "/var/tmp/test-copy_tree/";
char copy_dir[] = "/var/tmp/test-copy_tree-copy/";
+ _cleanup_free_ char *original_dir = NULL;
char **files = STRV_MAKE("file", "dir1/file", "dir1/dir2/file", "dir1/dir2/dir3/dir4/dir5/file");
char **links = STRV_MAKE("link", "file",
"link2", "dir1/file");
@@ -91,6 +92,9 @@ static void test_copy_tree(void) {
log_info("%s", __func__);
+ assert_se(chase_symlinks(path_original_dir, NULL, CHASE_NONEXISTENT, &original_dir, NULL) >= 0);
+ assert_se(strextend(&original_dir, "/", NULL));
+
(void) rm_rf(copy_dir, REMOVE_ROOT|REMOVE_PHYSICAL);
(void) rm_rf(original_dir, REMOVE_ROOT|REMOVE_PHYSICAL);