]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: test-imapc-client - Client now sends LOGOUT and server expects it
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 12 Apr 2020 08:34:14 +0000 (11:34 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 25 May 2020 18:20:52 +0000 (18:20 +0000)
src/lib-imap-client/test-imapc-client.c

index f745a56b5fe4ffefde1265b313fd5d772700bf12..b9059163342b8d00606ed8ea2778cc243ed63649 100644 (file)
@@ -158,6 +158,7 @@ static void test_run_client_server(
        ioloop = io_loop_create();
        imapc_client = imapc_client_init(&client_set_copy);
        client_test();
+       imapc_client_logout(imapc_client);
        test_assert(array_count(&imapc_cmd_last_replies) == 0);
        if (imapc_client != NULL)
                imapc_client_deinit(&imapc_client);
@@ -386,6 +387,9 @@ static void test_imapc_reconnect_server(void)
        test_assert(test_imapc_server_expect("3 NOOP"));
        o_stream_nsend_str(server.output, "3 OK \r\n");
 
+       test_assert(test_imapc_server_expect("5 LOGOUT"));
+       o_stream_nsend_str(server.output, "5 OK \r\n");
+
        test_assert(i_stream_read_next_line(server.input) == NULL);
 }
 
@@ -450,6 +454,9 @@ static void test_imapc_reconnect_resend_cmds_server(void)
        test_assert(test_imapc_server_expect("3 RETRY2"));
        o_stream_nsend_str(server.output, "3 OK \r\n");
 
+       test_assert(test_imapc_server_expect("6 LOGOUT"));
+       o_stream_nsend_str(server.output, "6 OK \r\n");
+
        test_assert(i_stream_read_next_line(server.input) == NULL);
 }
 
@@ -581,6 +588,9 @@ static void test_imapc_reconnect_mailbox_server(void)
        test_assert(test_imapc_server_expect("3 RETRY"));
        o_stream_nsend_str(server.output, "3 OK \r\n");
 
+       test_assert(test_imapc_server_expect("7 LOGOUT"));
+       o_stream_nsend_str(server.output, "7 OK \r\n");
+
        test_assert(i_stream_read_next_line(server.input) == NULL);
 }