libmount: make dlopen() dependency

This commit is contained in:
Lennart Poettering
2025-09-26 08:29:37 +09:00
committed by Yu Watanabe
parent b97b8fd4e3
commit b3243f4bee
25 changed files with 270 additions and 113 deletions
+4 -3
View File
@@ -215,7 +215,7 @@ simple_tests += files(
############################################################
common_test_dependencies = [
libmount,
libmount_cflags,
librt,
libseccomp_cflags,
libselinux,
@@ -289,6 +289,7 @@ executables += [
'dependencies' : [
libblkid_cflags,
libkmod_cflags,
libmount_cflags,
libp11kit_cflags,
libseccomp_cflags,
],
@@ -341,7 +342,7 @@ executables += [
test_template + {
'sources' : files('test-libmount.c'),
'dependencies' : [
libmount,
libmount_cflags,
threads,
],
},
@@ -359,7 +360,7 @@ executables += [
},
test_template + {
'sources' : files('test-mount-util.c'),
'dependencies' : libmount,
'dependencies' : libmount_cflags,
},
test_template + {
'sources' : files('test-netlink-manual.c'),
+2
View File
@@ -12,6 +12,7 @@
#include "libarchive-util.h"
#include "libaudit-util.h"
#include "libfido2-util.h"
#include "libmount-util.h"
#include "main-func.h"
#include "module-util.h"
#include "pam-util.h"
@@ -58,6 +59,7 @@ static int run(int argc, char **argv) {
ASSERT_DLOPEN(dlopen_libacl, HAVE_ACL);
ASSERT_DLOPEN(dlopen_libblkid, HAVE_BLKID);
ASSERT_DLOPEN(dlopen_libseccomp, HAVE_SECCOMP);
ASSERT_DLOPEN(dlopen_libmount, true);
return 0;
}
+4 -4
View File
@@ -32,7 +32,7 @@ static void test_libmount_unescaping_one(
/* We allow this call and the checks below to fail in some cases. See the case definitions below. */
r = mnt_table_next_fs(table, iter, &fs);
r = sym_mnt_table_next_fs(table, iter, &fs);
if (r != 0 && may_fail) {
log_error_errno(r, "mnt_table_next_fs failed: %m");
return;
@@ -41,8 +41,8 @@ static void test_libmount_unescaping_one(
assert_se(x = cescape(string));
assert_se(source = mnt_fs_get_source(fs));
assert_se(target = mnt_fs_get_target(fs));
assert_se(source = sym_mnt_fs_get_source(fs));
assert_se(target = sym_mnt_fs_get_target(fs));
assert_se(cs = cescape(source));
assert_se(ct = cescape(target));
@@ -63,7 +63,7 @@ static void test_libmount_unescaping_one(
assert_se(may_fail || streq(source, expected_source));
assert_se(may_fail || streq(target, expected_target));
assert_se(mnt_table_next_fs(table, iter, &fs) == 1);
assert_se(sym_mnt_table_next_fs(table, iter, &fs) == 1);
}
TEST(libmount_unescaping) {
+2 -2
View File
@@ -361,7 +361,7 @@ TEST(umount_recursive) {
for (;;) {
struct libmnt_fs *fs;
r = mnt_table_next_fs(table, iter, &fs);
r = sym_mnt_table_next_fs(table, iter, &fs);
if (r == 1)
break;
if (r < 0) {
@@ -369,7 +369,7 @@ TEST(umount_recursive) {
_exit(EXIT_FAILURE);
}
log_debug("left after complete umount: %s", mnt_fs_get_target(fs));
log_debug("left after complete umount: %s", sym_mnt_fs_get_target(fs));
}
_exit(EXIT_SUCCESS);