summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorAndres Beltran <abeltran@microsoft.com>2024-10-30 18:51:53 +0100
committerAndres Beltran <abeltran@microsoft.com>2024-11-01 19:41:27 +0100
commitedae62120f13b24d51812d1d7c0ab24acb420305 (patch)
tree2d62fab844500d024d58cb72e245716b8345df60 /src/test
parentcore/service: don't propagate stop jobs if RestartMode=direct (#34768) (diff)
downloadsystemd-edae62120f13b24d51812d1d7c0ab24acb420305.tar.xz
systemd-edae62120f13b24d51812d1d7c0ab24acb420305.zip
namespace-util: add util function to check if id-mapped mounts are supported for a given path
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-namespace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c
index 2a684ce096..37bce0ae1d 100644
--- a/src/test/test-namespace.c
+++ b/src/test/test-namespace.c
@@ -205,6 +205,14 @@ TEST(protect_kernel_logs) {
assert_se(wait_for_terminate_and_check("ns-kernellogs", pid, WAIT_LOG) == EXIT_SUCCESS);
}
+TEST(idmapping_supported) {
+ assert_se(is_idmapping_supported("/run") >= 0);
+ assert_se(is_idmapping_supported("/var/lib") >= 0);
+ assert_se(is_idmapping_supported("/var/cache") >= 0);
+ assert_se(is_idmapping_supported("/var/log") >= 0);
+ assert_se(is_idmapping_supported("/etc") >= 0);
+}
+
static int intro(void) {
if (!have_namespaces())
return log_tests_skipped("Don't have namespace support");