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
b1323051
Commit
b1323051
authored
Sep 18, 2013
by
Markus Rothe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: don't listen on public ports
parent
dc79171f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
23 additions
and
23 deletions
+23
-23
test_connect_delay.cpp
tests/test_connect_delay.cpp
+4
-4
test_disconnect_inproc.cpp
tests/test_disconnect_inproc.cpp
+1
-1
test_probe_router.cpp
tests/test_probe_router.cpp
+1
-1
test_req_request_ids.cpp
tests/test_req_request_ids.cpp
+1
-1
test_req_strict.cpp
tests/test_req_strict.cpp
+1
-1
test_security_curve.cpp
tests/test_security_curve.cpp
+1
-1
test_security_null.cpp
tests/test_security_null.cpp
+6
-6
test_security_plain.cpp
tests/test_security_plain.cpp
+1
-1
test_spec_dealer.cpp
tests/test_spec_dealer.cpp
+1
-1
test_spec_pushpull.cpp
tests/test_spec_pushpull.cpp
+1
-1
test_spec_rep.cpp
tests/test_spec_rep.cpp
+1
-1
test_spec_req.cpp
tests/test_spec_req.cpp
+1
-1
test_spec_router.cpp
tests/test_spec_router.cpp
+1
-1
test_stream.cpp
tests/test_stream.cpp
+2
-2
No files found.
tests/test_connect_delay.cpp
View file @
b1323051
...
...
@@ -41,7 +41,7 @@ int main (void)
val
=
0
;
rc
=
zmq_setsockopt
(
to
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
to
,
"tcp://
*
:6555"
);
rc
=
zmq_bind
(
to
,
"tcp://
127.0.0.1
:6555"
);
assert
(
rc
==
0
);
// Create a socket pushing to two endpoints - only 1 message should arrive.
...
...
@@ -100,7 +100,7 @@ int main (void)
// Bind the valid socket
to
=
zmq_socket
(
context
,
ZMQ_PULL
);
assert
(
to
);
rc
=
zmq_bind
(
to
,
"tcp://
*
:5560"
);
rc
=
zmq_bind
(
to
,
"tcp://
127.0.0.1
:5560"
);
assert
(
rc
==
0
);
val
=
0
;
...
...
@@ -174,7 +174,7 @@ int main (void)
int
on
=
1
;
rc
=
zmq_setsockopt
(
frontend
,
ZMQ_DELAY_ATTACH_ON_CONNECT
,
&
on
,
sizeof
(
on
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
backend
,
"tcp://
*
:5560"
);
rc
=
zmq_bind
(
backend
,
"tcp://
127.0.0.1
:5560"
);
assert
(
rc
==
0
);
rc
=
zmq_connect
(
frontend
,
"tcp://localhost:5560"
);
assert
(
rc
==
0
);
...
...
@@ -205,7 +205,7 @@ int main (void)
assert
(
backend
);
rc
=
zmq_setsockopt
(
backend
,
ZMQ_LINGER
,
&
zero
,
sizeof
(
zero
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
backend
,
"tcp://
*
:5560"
);
rc
=
zmq_bind
(
backend
,
"tcp://
127.0.0.1
:5560"
);
assert
(
rc
==
0
);
// Ping backend to frontend so we know when the connection is up
...
...
tests/test_disconnect_inproc.cpp
View file @
b1323051
...
...
@@ -39,7 +39,7 @@ int main(int argc, char** argv) {
zmq_setsockopt
(
subSocket
,
ZMQ_SUBSCRIBE
,
"foo"
,
3
)
&&
printf
(
"zmq_setsockopt: %s
\n
"
,
zmq_strerror
(
errno
));
zmq_bind
(
pubSocket
,
"inproc://someInProcDescriptor"
)
&&
printf
(
"zmq_bind: %s
\n
"
,
zmq_strerror
(
errno
));
//zmq_bind(pubSocket, "tcp://
*
:30010") && printf("zmq_bind: %s\n", zmq_strerror(errno));
//zmq_bind(pubSocket, "tcp://
127.0.0.1
:30010") && printf("zmq_bind: %s\n", zmq_strerror(errno));
int
more
;
size_t
more_size
=
sizeof
(
more
);
...
...
tests/test_probe_router.cpp
View file @
b1323051
...
...
@@ -28,7 +28,7 @@ int main (void)
// Create server and bind to endpoint
void
*
server
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
server
);
int
rc
=
zmq_bind
(
server
,
"tcp://
*
:5560"
);
int
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:5560"
);
assert
(
rc
==
0
);
// Create client and connect to server, doing a probe
...
...
tests/test_req_request_ids.cpp
View file @
b1323051
...
...
@@ -42,7 +42,7 @@ int main (void)
rc
=
zmq_connect
(
req
,
"tcp://localhost:5555"
);
assert
(
rc
==
0
);
rc
=
zmq_bind
(
router
,
"tcp://
*
:5555"
);
rc
=
zmq_bind
(
router
,
"tcp://
127.0.0.1
:5555"
);
assert
(
rc
==
0
);
// Send a multi-part request.
...
...
tests/test_req_strict.cpp
View file @
b1323051
...
...
@@ -36,7 +36,7 @@ int main (void)
rc
=
zmq_setsockopt
(
req
,
ZMQ_REQ_REQUEST_IDS
,
&
enabled
,
sizeof
(
int
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
req
,
"tcp://
*
:5555"
);
rc
=
zmq_bind
(
req
,
"tcp://
127.0.0.1
:5555"
);
assert
(
rc
==
0
);
const
size_t
services
=
5
;
...
...
tests/test_security_curve.cpp
View file @
b1323051
...
...
@@ -109,7 +109,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_setsockopt
(
server
,
ZMQ_IDENTITY
,
"IDENT"
,
6
);
assert
(
rc
==
0
);
rc
=
zmq_bind
(
server
,
"tcp://
*
:9998"
);
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:9998"
);
assert
(
rc
==
0
);
// Check CURVE security with valid credentials
...
...
tests/test_security_null.cpp
View file @
b1323051
...
...
@@ -83,12 +83,12 @@ int main (void)
// We first test client/server with no ZAP domain
// Libzmq does not call our ZAP handler, the connect must succeed
rc
=
zmq_bind
(
server
,
"tcp://
*
:9000"
);
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:9000"
);
assert
(
rc
==
0
);
rc
=
zmq_connect
(
client
,
"tcp://localhost:9000"
);
assert
(
rc
==
0
);
bounce
(
server
,
client
);
zmq_unbind
(
server
,
"tcp://
*
:9000"
);
zmq_unbind
(
server
,
"tcp://
127.0.0.1
:9000"
);
zmq_disconnect
(
client
,
"tcp://localhost:9000"
);
// Now define a ZAP domain for the server; this enables
...
...
@@ -111,18 +111,18 @@ int main (void)
//// The above code should not be required
//rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "WRONG", 5);
//assert (rc == 0);
//rc = zmq_bind (server, "tcp://
*
:9001");
//rc = zmq_bind (server, "tcp://
127.0.0.1
:9001");
//assert (rc == 0);
//rc = zmq_connect (client, "tcp://localhost:9001");
//assert (rc == 0);
//expect_bounce_fail (server, client);
//zmq_unbind (server, "tcp://
*
:9001");
//zmq_unbind (server, "tcp://
127.0.0.1
:9001");
//zmq_disconnect (client, "tcp://localhost:9001");
// Now use the right domain, the test must pass
rc
=
zmq_setsockopt
(
server
,
ZMQ_ZAP_DOMAIN
,
"TEST"
,
4
);
assert
(
rc
==
0
);
rc
=
zmq_bind
(
server
,
"tcp://
*
:9002"
);
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:9002"
);
assert
(
rc
==
0
);
rc
=
zmq_connect
(
client
,
"tcp://localhost:9002"
);
assert
(
rc
==
0
);
...
...
@@ -132,7 +132,7 @@ int main (void)
// never succeeds and the test hangs.
// **************************************************************
bounce
(
server
,
client
);
zmq_unbind
(
server
,
"tcp://
*
:9002"
);
zmq_unbind
(
server
,
"tcp://
127.0.0.1
:9002"
);
zmq_disconnect
(
client
,
"tcp://localhost:9002"
);
// Shutdown
...
...
tests/test_security_plain.cpp
View file @
b1323051
...
...
@@ -90,7 +90,7 @@ int main (void)
int
as_server
=
ZMQ_SERVER
;
rc
=
zmq_setsockopt
(
server
,
ZMQ_PLAIN_NODE
,
&
as_server
,
sizeof
(
int
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
server
,
"tcp://
*
:9998"
);
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:9998"
);
assert
(
rc
==
0
);
char
username
[
256
];
...
...
tests/test_spec_dealer.cpp
View file @
b1323051
...
...
@@ -222,7 +222,7 @@ int main (void)
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
*
:5555"
};
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
127.0.0.1
:5555"
};
const
char
*
connects
[]
=
{
"inproc://a"
,
"tcp://localhost:5555"
};
for
(
int
transports
=
0
;
transports
<
2
;
++
transports
)
{
...
...
tests/test_spec_pushpull.cpp
View file @
b1323051
...
...
@@ -260,7 +260,7 @@ int main (void)
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
*
:5555"
};
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
127.0.0.1
:5555"
};
const
char
*
connects
[]
=
{
"inproc://a"
,
"tcp://localhost:5555"
};
for
(
int
transport
=
0
;
transport
<
2
;
++
transport
)
{
...
...
tests/test_spec_rep.cpp
View file @
b1323051
...
...
@@ -125,7 +125,7 @@ int main (void)
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
*
:5555"
};
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
127.0.0.1
:5555"
};
const
char
*
connects
[]
=
{
"inproc://a"
,
"tcp://localhost:5555"
};
for
(
int
transport
=
0
;
transport
<
2
;
++
transport
)
{
...
...
tests/test_spec_req.cpp
View file @
b1323051
...
...
@@ -217,7 +217,7 @@ int main (void)
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
*
:5555"
};
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
127.0.0.1
:5555"
};
const
char
*
connects
[]
=
{
"inproc://a"
,
"tcp://localhost:5555"
};
for
(
int
transport
=
0
;
transport
<
2
;
transport
++
)
{
...
...
tests/test_spec_router.cpp
View file @
b1323051
...
...
@@ -179,7 +179,7 @@ int main (void)
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
*
:5555"
};
const
char
*
binds
[]
=
{
"inproc://a"
,
"tcp://
127.0.0.1
:5555"
};
const
char
*
connects
[]
=
{
"inproc://a"
,
"tcp://localhost:5555"
};
for
(
int
transport
=
0
;
transport
<
2
;
++
transport
)
{
...
...
tests/test_stream.cpp
View file @
b1323051
...
...
@@ -54,7 +54,7 @@ test_stream_to_dealer (void)
int
zero
=
0
;
rc
=
zmq_setsockopt
(
stream
,
ZMQ_LINGER
,
&
zero
,
sizeof
(
zero
));
assert
(
rc
==
0
);
rc
=
zmq_bind
(
stream
,
"tcp://
*
:5556"
);
rc
=
zmq_bind
(
stream
,
"tcp://
127.0.0.1
:5556"
);
assert
(
rc
==
0
);
// We'll be using this socket as the other peer
...
...
@@ -173,7 +173,7 @@ test_stream_to_stream (void)
void
*
server
=
zmq_socket
(
ctx
,
ZMQ_STREAM
);
assert
(
server
);
rc
=
zmq_bind
(
server
,
"tcp://
*
:8080"
);
rc
=
zmq_bind
(
server
,
"tcp://
127.0.0.1
:8080"
);
assert
(
rc
==
0
);
void
*
client
=
zmq_socket
(
ctx
,
ZMQ_STREAM
);
...
...
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