Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
13b972b2
Commit
13b972b2
authored
Aug 17, 2017
by
sigiesec
Committed by
Giesecke
Sep 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: no tests without ZAP handler where one is expected
Solution: added test case for NULL/PLAIN/CURVE
parent
9071265c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
test_security_zap.cpp
tests/test_security_zap.cpp
+14
-0
testutil_security.hpp
tests/testutil_security.hpp
+10
-6
No files found.
tests/test_security_zap.cpp
View file @
13b972b2
...
...
@@ -266,6 +266,20 @@ void test_zap_errors (socket_config_fn server_socket_config_,
client_socket_config_data_
);
shutdown_context_and_server_side
(
ctx
,
zap_thread
,
server
,
server_mon
,
handler
);
// no ZAP handler
fprintf
(
stderr
,
"test_zap_unsuccessful no ZAP handler started
\n
"
);
setup_context_and_server_side
(
&
ctx
,
&
handler
,
&
zap_thread
,
&
server
,
&
server_mon
,
my_endpoint
,
NULL
,
server_socket_config_
);
test_zap_unsuccessful
(
ctx
,
my_endpoint
,
server
,
server_mon
,
#ifdef ZMQ_BUILD_DRAFT_API
ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL
,
EFAULT
,
#else
0
,
0
,
#endif
client_socket_config_
,
client_socket_config_data_
);
shutdown_context_and_server_side
(
ctx
,
zap_thread
,
server
,
server_mon
,
handler
);
}
int
main
(
void
)
...
...
tests/testutil_security.hpp
View file @
13b972b2
...
...
@@ -336,12 +336,15 @@ void setup_context_and_server_side (
int
rc
=
zmq_bind
(
*
handler
,
"inproc://handler-control"
);
assert
(
rc
==
0
);
*
zap_thread
=
zmq_threadstart
(
zap_handler_
,
*
ctx
);
if
(
zap_handler_
)
{
*
zap_thread
=
zmq_threadstart
(
zap_handler_
,
*
ctx
);
char
*
buf
=
s_recv
(
*
handler
);
assert
(
buf
);
assert
(
streq
(
buf
,
"GO"
));
free
(
buf
);
char
*
buf
=
s_recv
(
*
handler
);
assert
(
buf
);
assert
(
streq
(
buf
,
"GO"
));
free
(
buf
);
}
else
*
zap_thread
=
NULL
;
// Server socket will accept connections
*
server
=
zmq_socket
(
*
ctx
,
ZMQ_DEALER
);
...
...
@@ -386,7 +389,8 @@ void shutdown_context_and_server_side (void *ctx,
close_zero_linger
(
server
);
// Wait until ZAP handler terminates
zmq_threadclose
(
zap_thread
);
if
(
zap_thread
)
zmq_threadclose
(
zap_thread
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment