From: Lennart Poettering Date: Wed, 26 Nov 2014 19:58:34 +0000 (+0100) Subject: bus-policy: also add in other bus policy tests from dbus1 X-Git-Tag: v218~322 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=55e189007c707fb827b8b287903c258de234bd12 bus-policy: also add in other bus policy tests from dbus1 dbus1 only checks if these files parse correctly so let's do the same for now. --- diff --git a/Makefile.am b/Makefile.am index 5545aa187..ddd0df137 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1384,7 +1384,9 @@ EXTRA_DIST += \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ test/bus-policy/signals.conf \ - test/bus-policy/check-own-rules.conf + test/bus-policy/check-own-rules.conf \ + test/bus-policy/many-rules.conf \ + test/bus-policy/test.conf EXTRA_DIST += \ diff --git a/src/bus-proxyd/test-bus-policy.c b/src/bus-proxyd/test-bus-policy.c index a4b7b6af0..3140e083c 100644 --- a/src/bus-proxyd/test-bus-policy.c +++ b/src/bus-proxyd/test-bus-policy.c @@ -147,5 +147,17 @@ int main(int argc, char *argv[]) { policy_free(&p); + /* dbus1 test file: many rules */ + + assert_se(test_policy_load(&p, "many-rules.conf") >= 0); + policy_dump(&p); + policy_free(&p); + + /* dbus1 test file: generic test */ + + assert_se(test_policy_load(&p, "test.conf") >= 0); + policy_dump(&p); + policy_free(&p); + return EXIT_SUCCESS; } diff --git a/test/bus-policy/many-rules.conf b/test/bus-policy/many-rules.conf new file mode 100644 index 000000000..70dd538c1 --- /dev/null +++ b/test/bus-policy/many-rules.conf @@ -0,0 +1,61 @@ + + + mybususer + unix:path=/foo/bar + tcp:port=1234 + basic.d + + /usr/share/foo + nonexistent.conf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5000 + 5000 + 300 + 5000 + 6000 + 50 + 80 + 64 + 64 + 256 + 512 + + diff --git a/test/bus-policy/test.conf b/test/bus-policy/test.conf new file mode 100644 index 000000000..ee6afcdfb --- /dev/null +++ b/test/bus-policy/test.conf @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + +