diff options
Diffstat (limited to 'src/bus-proxyd/test-bus-policy.c')
-rw-r--r-- | src/bus-proxyd/test-bus-policy.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bus-proxyd/test-bus-policy.c b/src/bus-proxyd/test-bus-policy.c index c9a027e877..a4b7b6af08 100644 --- a/src/bus-proxyd/test-bus-policy.c +++ b/src/bus-proxyd/test-bus-policy.c @@ -131,5 +131,21 @@ int main(int argc, char *argv[]) { policy_free(&p); + /* dbus1 test file: ownership */ + + assert_se(test_policy_load(&p, "check-own-rules.conf") >= 0); + policy_dump(&p); + + assert_se(policy_check_own(&p, &ucred, "org.freedesktop") == false); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystem") == false); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems") == true); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems.foo") == true); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems.foo.bar") == true); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems2") == false); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems2.foo") == false); + assert_se(policy_check_own(&p, &ucred, "org.freedesktop.ManySystems2.foo.bar") == false); + + policy_free(&p); + return EXIT_SUCCESS; } |