summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2004-04-09 19:50:29 +0000
committerJon Trowbridge <trow@ximian.com>2004-04-09 19:50:29 +0000
commite039be5838a6befdb4a378fcdc1fc2e7606d4222 (patch)
treef3f4a33480ee755422819c1572298a354551a737 /test
parent8056390e00ca6576323d6c41a4dc725bcba9b527 (diff)
2004-04-09 Jon Trowbridge <trow@ximian.com>
* bus/config-parser.c (bus_config_parser_new): Added a 'parent' argument. If non-null, the newly-constructed BusConfigParser will be initialized with the parent's BusLimits instead of the default values. (include_file): When including a config file, pass in the current parser as the parent and then copy the BusLimits from the included BusConfigParser pack to the current parser. (process_test_valid_subdir): Renamed from process_test_subdir. (process_test_equiv_subdir): Added. Walks through a directory, descending into each subdirectory and loading the config files it finds there. If any subdirectory contains two config files that don't produce identical BusConfigParser structs, fail. For now, the BusConfigParser's BusPolicies are not compared. (bus_config_parser_test): Call both process_test_valid_subdir and process_test_equiv_subdir. * bus/config-loader-libxml.c (bus_config_load): Take a parent argument and pass it along to the call to bus_config_parser_new. Also made a few small changes to allow this code to compile. * bus/config-loader-expat.c (bus_config_load): Take a parent argument and pass it along to the call to bus_config_parser_new. * bus/bus.c (bus_context_new): Load the config file with a NULL parent argument.
Diffstat (limited to 'test')
-rw-r--r--test/data/equiv-config-files/basic/basic-1.conf25
-rw-r--r--test/data/equiv-config-files/basic/basic-2.conf5
-rw-r--r--test/data/equiv-config-files/basic/basic.d/basic.conf13
-rw-r--r--test/data/equiv-config-files/entities/basic.d/basic.conf13
-rw-r--r--test/data/equiv-config-files/entities/entities-1.conf14
-rw-r--r--test/data/equiv-config-files/entities/entities-2.conf5
6 files changed, 75 insertions, 0 deletions
diff --git a/test/data/equiv-config-files/basic/basic-1.conf b/test/data/equiv-config-files/basic/basic-1.conf
new file mode 100644
index 00000000..4500ad70
--- /dev/null
+++ b/test/data/equiv-config-files/basic/basic-1.conf
@@ -0,0 +1,25 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <user>mybususer</user>
+ <listen>unix:path=/foo/bar</listen>
+ <listen>tcp:port=1234</listen>
+ <includedir>basic.d</includedir>
+ <servicedir>/usr/share/foo</servicedir>
+ <include ignore_missing="yes">nonexistent.conf</include>
+ <policy context="default">
+ <allow user="*"/>
+ </policy>
+
+ <limit name="max_incoming_bytes">5000</limit>
+ <limit name="max_outgoing_bytes">5000</limit>
+ <limit name="max_message_size">300</limit>
+ <limit name="activation_timeout">5000</limit>
+ <limit name="auth_timeout">6000</limit>
+ <limit name="max_completed_connections">50</limit>
+ <limit name="max_incomplete_connections">80</limit>
+ <limit name="max_connections_per_user">64</limit>
+ <limit name="max_pending_activations">64</limit>
+ <limit name="max_services_per_connection">256</limit>
+
+</busconfig>
diff --git a/test/data/equiv-config-files/basic/basic-2.conf b/test/data/equiv-config-files/basic/basic-2.conf
new file mode 100644
index 00000000..49e707e8
--- /dev/null
+++ b/test/data/equiv-config-files/basic/basic-2.conf
@@ -0,0 +1,5 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+<include>basic-1.conf</include>
+</busconfig> \ No newline at end of file
diff --git a/test/data/equiv-config-files/basic/basic.d/basic.conf b/test/data/equiv-config-files/basic/basic.d/basic.conf
new file mode 100644
index 00000000..d109d71d
--- /dev/null
+++ b/test/data/equiv-config-files/basic/basic.d/basic.conf
@@ -0,0 +1,13 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <user>mybususer</user>
+ <listen>unix:path=/foo/bar</listen>
+ <listen>tcp:port=1234</listen>
+ <includedir>basic.d</includedir>
+ <servicedir>/usr/share/foo</servicedir>
+ <include ignore_missing="yes">nonexistent.conf</include>
+ <policy context="default">
+ <allow user="*"/>
+ </policy>
+</busconfig>
diff --git a/test/data/equiv-config-files/entities/basic.d/basic.conf b/test/data/equiv-config-files/entities/basic.d/basic.conf
new file mode 100644
index 00000000..d109d71d
--- /dev/null
+++ b/test/data/equiv-config-files/entities/basic.d/basic.conf
@@ -0,0 +1,13 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <user>mybususer</user>
+ <listen>unix:path=/foo/bar</listen>
+ <listen>tcp:port=1234</listen>
+ <includedir>basic.d</includedir>
+ <servicedir>/usr/share/foo</servicedir>
+ <include ignore_missing="yes">nonexistent.conf</include>
+ <policy context="default">
+ <allow user="*"/>
+ </policy>
+</busconfig>
diff --git a/test/data/equiv-config-files/entities/entities-1.conf b/test/data/equiv-config-files/entities/entities-1.conf
new file mode 100644
index 00000000..3d3cea79
--- /dev/null
+++ b/test/data/equiv-config-files/entities/entities-1.conf
@@ -0,0 +1,14 @@
+<!-- This config file contains XML entities -->
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <user>mybususer</user>
+ <listen>unix:path=/foo/&lt;bar&gt;</listen>
+ <listen>tcp:port=1234</listen>
+ <includedir>basic.&#100;</includedir>
+ <servicedir>/usr/&amp;share/foo</servicedir>
+ <include ignore_missing="ye&#115;">nonexistent.conf&#110;</include>
+ <policy context="&#100;efault">
+ <allow user="*"/>
+ </policy>
+</busconfig>
diff --git a/test/data/equiv-config-files/entities/entities-2.conf b/test/data/equiv-config-files/entities/entities-2.conf
new file mode 100644
index 00000000..9ffabeae
--- /dev/null
+++ b/test/data/equiv-config-files/entities/entities-2.conf
@@ -0,0 +1,5 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+<include>entities-1.conf</include>
+</busconfig> \ No newline at end of file