From bbd33e46aa6194c1086939f7cf8538c067186455 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 4 Jun 2012 12:06:53 -0400 Subject: Primary server support: basic support in failover code Now there are two list of servers for each service. If currently selected server is only backup, then an event will be scheduled which tries to get connection to one of primary servers and if it succeeds, it starts using this server instead of the one which is currently connected to. --- src/tests/fail_over-tests.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/tests/fail_over-tests.c') diff --git a/src/tests/fail_over-tests.c b/src/tests/fail_over-tests.c index 8d6bdd3d..6f4843ca 100644 --- a/src/tests/fail_over-tests.c +++ b/src/tests/fail_over-tests.c @@ -230,14 +230,15 @@ START_TEST(test_fo_resolve_service) fail_if(fo_new_service(ctx->fo_ctx, "ntp", &service[2]) != EOK); /* Add servers. */ - fail_if(fo_add_server(service[0], "localhost", 20, NULL) != EOK); - fail_if(fo_add_server(service[0], "127.0.0.1", 80, NULL) != EOK); + fail_if(fo_add_server(service[0], "localhost", 20, NULL, true) != EOK); + fail_if(fo_add_server(service[0], "127.0.0.1", 80, NULL, false) != EOK); - fail_if(fo_add_server(service[1], "localhost", 30, NULL) != EOK); - fail_if(fo_add_server(service[1], "127.0.0.1", 389, NULL) != EOK); - fail_if(fo_add_server(service[1], "127.0.0.1", 389, NULL) != EEXIST); + fail_if(fo_add_server(service[1], "localhost", 30, NULL, false) != EOK); + fail_if(fo_add_server(service[1], "127.0.0.1", 389, NULL, true) != EOK); + fail_if(fo_add_server(service[1], "127.0.0.1", 389, NULL, true) != EEXIST); + fail_if(fo_add_server(service[1], "127.0.0.1", 389, NULL, false) != EEXIST); - fail_if(fo_add_server(service[2], NULL, 123, NULL) != EOK); + fail_if(fo_add_server(service[2], NULL, 123, NULL, true) != EOK); /* Make requests. */ get_request(ctx, service[0], EOK, 20, PORT_WORKING, -1); -- cgit