Commit 6e87d52a authored by Simon McVittie's avatar Simon McVittie

test/dbus-daemon: Mark max-connections-per-user as unimplemented on Windows

The implementation of the max-connections-per-user limit works in terms
of Unix uids, so it doesn't apply on Windows.

This is not a problem in practice, because it only makes sense to limit
connections per user if you have multiple users, and we don't support
the well-known system bus on Windows.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 6d40ef87
......@@ -660,6 +660,11 @@ test_canonical_path_uae (Fixture *f,
dbus_clear_message (&m);
}
static Config max_connections_per_user_config = {
NULL, 1, "valid-config-files/max-connections-per-user.conf",
TEST_USER_ME, SPECIFY_ADDRESS
};
static void
test_max_connections (Fixture *f,
gconstpointer context)
......@@ -667,10 +672,27 @@ test_max_connections (Fixture *f,
DBusError error = DBUS_ERROR_INIT;
DBusConnection *third_conn;
DBusConnection *failing_conn;
#ifdef DBUS_WIN
const Config *config = context;
#endif
if (f->skip)
return;
#ifdef DBUS_WIN
if (config == &max_connections_per_user_config)
{
/* <limit name="max_connections_per_user"/> is currently only
* implemented in terms of Unix uids. It could be implemented for
* Windows SIDs too, but there wouldn't be much point, because we
* don't support use of a multi-user dbus-daemon on Windows, so
* in practice all connections have the same SID. */
g_test_skip ("Maximum connections per Windows SID are not "
"implemented");
return;
}
#endif
/* We have two connections already */
g_assert (f->left_conn != NULL);
g_assert (f->right_conn != NULL);
......@@ -2021,11 +2043,6 @@ static Config max_completed_connections_config = {
TEST_USER_ME, SPECIFY_ADDRESS
};
static Config max_connections_per_user_config = {
NULL, 1, "valid-config-files/max-connections-per-user.conf",
TEST_USER_ME, SPECIFY_ADDRESS
};
static Config max_replies_per_connection_config = {
NULL, 1, "valid-config-files/max-replies-per-connection.conf",
TEST_USER_ME, SPECIFY_ADDRESS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment