You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/10/07 02:21:23 UTC

qpid-proton git commit: PROTON-1571: update C ssl test for libuv proactor

Repository: qpid-proton
Updated Branches:
  refs/heads/master bb7b82615 -> 9797c58b1


PROTON-1571: update C ssl test for libuv proactor

Test relied on event batching specific to epoll proactor, fixed test works on
libuv also.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9797c58b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9797c58b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9797c58b

Branch: refs/heads/master
Commit: 9797c58b179fdb95f4af2a0184e82a3b2205dbf0
Parents: bb7b826
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Oct 6 22:05:46 2017 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri Oct 6 22:12:49 2017 -0400

----------------------------------------------------------------------
 proton-c/src/tests/proactor.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9797c58b/proton-c/src/tests/proactor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/tests/proactor.c b/proton-c/src/tests/proactor.c
index 245284c..9e3b8db 100644
--- a/proton-c/src/tests/proactor.c
+++ b/proton-c/src/tests/proactor.c
@@ -783,7 +783,9 @@ static pn_event_type_t ssl_handler(test_handler_t *h, pn_event_t *e) {
    case PN_CONNECTION_REMOTE_OPEN: {
      pn_ssl_t *ssl = pn_ssl(pn_event_transport(e));
      TEST_CHECK(h->t, ssl);
-     TEST_CHECK(h->t, pn_ssl_get_protocol_name(ssl, NULL, 0));
+     char protocol[256];
+     TEST_CHECK(h->t, pn_ssl_get_protocol_name(ssl, protocol, sizeof(protocol)));
+     TEST_STR_IN(h->t, "TLS", protocol);
      return PN_CONNECTION_REMOTE_OPEN;
    }
    default:
@@ -794,6 +796,7 @@ static pn_event_type_t ssl_handler(test_handler_t *h, pn_event_t *e) {
 static pn_event_type_t ssl_server_handler(test_handler_t *h, pn_event_t *e) {
   switch (pn_event_type(e)) {
    case PN_CONNECTION_BOUND:
+    return ssl_handler(h, e);
    case PN_CONNECTION_REMOTE_OPEN: {
      pn_event_type_t et = ssl_handler(h, e);
      pn_connection_open(pn_event_connection(e));
@@ -807,6 +810,7 @@ static pn_event_type_t ssl_server_handler(test_handler_t *h, pn_event_t *e) {
 static pn_event_type_t ssl_client_handler(test_handler_t *h, pn_event_t *e) {
   switch (pn_event_type(e)) {
    case PN_CONNECTION_BOUND:
+    return ssl_handler(h, e);
    case PN_CONNECTION_REMOTE_OPEN: {
      pn_event_type_t et = ssl_handler(h, e);
      pn_connection_close(pn_event_connection(e));
@@ -839,7 +843,8 @@ static void test_ssl(test_t *t) {
   TEST_COND_EMPTY(t, last_condition);
   TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps));
   TEST_COND_EMPTY(t, last_condition);
-  TEST_PROACTORS_DRAIN(tps);
+  TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED);
+  TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED);
 
   /* Verify peer with good hostname */
   TEST_INT_EQUAL(t, 0, pn_ssl_domain_set_trusted_ca_db(cd, CERTIFICATE("tserver")));
@@ -851,7 +856,8 @@ static void test_ssl(test_t *t) {
   TEST_COND_EMPTY(t, last_condition);
   TEST_ETYPE_EQUAL(t, PN_CONNECTION_REMOTE_OPEN, TEST_PROACTORS_RUN(tps));
   TEST_COND_EMPTY(t, last_condition);
-  TEST_PROACTORS_DRAIN(tps);
+  TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED);
+  TEST_PROACTORS_RUN_UNTIL(tps, PN_TRANSPORT_CLOSED);
 
   /* Verify peer with bad hostname */
   c = pn_connection();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org