aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Barth <david.barth@canonical.com>2015-09-22 09:40:12 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-09-22 09:40:12 +0200
commit71e55e0f6cb1c949656441ee4f90585590efc68f (patch)
tree4452a5ccaf332d7de3f160279a467882cba8e6a3 /tests
parent56462d6bfd5c99a0a5a47044cf536d286cb170c4 (diff)
downloadremote-logon-service-71e55e0f6cb1c949656441ee4f90585590efc68f.tar.gz
remote-logon-service-71e55e0f6cb1c949656441ee4f90585590efc68f.tar.bz2
remote-logon-service-71e55e0f6cb1c949656441ee4f90585590efc68f.zip
ensure that the availability of a server gets signaled, even in the absence of an exec line
Diffstat (limited to 'tests')
-rw-r--r--tests/server-test.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/server-test.c b/tests/server-test.c
index 06b6233..f5e50c7 100644
--- a/tests/server-test.c
+++ b/tests/server-test.c
@@ -37,27 +37,29 @@ test_update_signal (void)
Server * server = NULL;
server = server_new_from_keyfile(keyfile, groupname);
g_assert(server != NULL);
- g_assert(g_strcmp0(server->name, "My Server") == 0);
- g_assert(g_strcmp0(server->uri, "http://my.domain.com") == 0);
UccsServer * userver = UCCS_SERVER(server);
g_assert(userver != NULL);
gboolean signaled = FALSE;
g_signal_connect(G_OBJECT(server), SERVER_SIGNAL_STATE_CHANGED, G_CALLBACK(state_signal), &signaled);
-
- if (server->state == SERVER_STATE_ALLGOOD) {
- signaled = FALSE;
- uccs_server_set_exec(userver, "thisshouldnotexist");
- g_assert(signaled);
- g_assert(server->state == SERVER_STATE_UNAVAILABLE);
- }
+ server->state = SERVER_STATE_UNAVAILABLE;
signaled = FALSE;
- uccs_server_set_exec(userver, "ls");
+ uccs_notify_state_change(userver);
+ /* a change from available to good is notified */
g_assert(signaled);
g_assert(server->state == SERVER_STATE_ALLGOOD);
+ signaled = FALSE;
+ server->state = SERVER_STATE_ALLGOOD;
+ userver->last_network = NM_STATE_DISCONNECTED;
+ userver->min_network = NM_STATE_CONNECTED_GLOBAL;
+ uccs_notify_state_change(userver);
+ /* if the server becomes unavailable, it is notified as well */
+ g_assert(signaled);
+ g_assert(server->state == SERVER_STATE_UNAVAILABLE);
+
return;
}