summaryrefslogtreecommitdiffstats
path: root/src/test/test-conf-parser.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:25:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:25:59 +0000
commit1e34d75027c0773e21b35688c27034d5af5e635c (patch)
tree7f3e33142d7a4d06037846454f08b1b0350b2a95 /src/test/test-conf-parser.c
parentAdding upstream version 256.4. (diff)
downloadsystemd-1e34d75027c0773e21b35688c27034d5af5e635c.tar.xz
systemd-1e34d75027c0773e21b35688c27034d5af5e635c.zip
Adding upstream version 256.5.upstream/256.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-conf-parser.c')
-rw-r--r--src/test/test-conf-parser.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index 4e236bd..5643053 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -7,6 +7,7 @@
#include "log.h"
#include "macro.h"
#include "mkdir.h"
+#include "rm-rf.h"
#include "string-util.h"
#include "strv.h"
#include "tests.h"
@@ -393,19 +394,16 @@ TEST(config_parse) {
}
TEST(config_parse_standard_file_with_dropins_full) {
- _cleanup_(rmdir_and_freep) char *root = NULL;
+ _cleanup_(rm_rf_physical_and_freep) char *root = NULL;
_cleanup_close_ int rfd = -EBADF;
int r;
- assert_se(mkdtemp_malloc(NULL, &root) >= 0);
+ ASSERT_OK(rfd = mkdtemp_open("/tmp/test-config-parse-XXXXXX", 0, &root));
assert_se(mkdir_p_root(root, "/etc/kernel/install.conf.d", UID_INVALID, GID_INVALID, 0755));
assert_se(mkdir_p_root(root, "/run/kernel/install.conf.d", UID_INVALID, GID_INVALID, 0755));
assert_se(mkdir_p_root(root, "/usr/lib/kernel/install.conf.d", UID_INVALID, GID_INVALID, 0755));
assert_se(mkdir_p_root(root, "/usr/local/lib/kernel/install.conf.d", UID_INVALID, GID_INVALID, 0755));
- rfd = open(root, O_CLOEXEC|O_DIRECTORY);
- assert_se(rfd >= 0);
-
assert_se(write_string_file_at(rfd, "usr/lib/kernel/install.conf", /* this one is ignored */
"A=!!!", WRITE_STRING_FILE_CREATE) == 0);
assert_se(write_string_file_at(rfd, "usr/local/lib/kernel/install.conf",