Skip to content

Commit

Permalink
shift tests onto unique port numbers, hopefully fixes zeromq#175 and z…
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamg committed May 26, 2017
1 parent a848672 commit 9a783d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/tests/test_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ BOOST_AUTO_TEST_CASE(strawhouse)
// create and bind a server socket
zmqpp::socket server(context, zmqpp::socket_type::push);
//server.set(zmqpp::socket_option::zap_domain, "global");
server.bind("tcp://*:9000");
server.bind("tcp://*:9001");

// create and connect a client socket
zmqpp::socket client(context, zmqpp::socket_type::pull);
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9001");

// Send a single message from server to client
zmqpp::message request;
Expand Down Expand Up @@ -115,13 +115,13 @@ BOOST_AUTO_TEST_CASE(woodhouse)
// create and bind a server socket
zmqpp::socket server(context, zmqpp::socket_type::pull);
server.set(zmqpp::socket_option::plain_server, 1);
server.bind("tcp://*:9000");
server.bind("tcp://*:9002");

// create and connect a client socket
zmqpp::socket client(context, zmqpp::socket_type::push);
client.set(zmqpp::socket_option::plain_username, "admin");
client.set(zmqpp::socket_option::plain_password, "password");
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9002");

// Send a single message from client to server
zmqpp::message request;
Expand Down Expand Up @@ -182,14 +182,14 @@ BOOST_AUTO_TEST_CASE(stonehouse)
int as_server = 1;
server.set(zmqpp::socket_option::curve_server, as_server);
server.set(zmqpp::socket_option::curve_secret_key, server_keypair.secret_key);
server.bind("tcp://*:9000");
server.bind("tcp://*:9003");

// create and connect a client socket
zmqpp::socket client(context, zmqpp::socket_type::push);
client.set(zmqpp::socket_option::curve_server_key, server_keypair.public_key);
client.set(zmqpp::socket_option::curve_public_key, client_keypair.public_key);
client.set(zmqpp::socket_option::curve_secret_key, client_keypair.secret_key);
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9003");

// Send a single message from client to server
zmqpp::message request;
Expand All @@ -209,10 +209,10 @@ BOOST_AUTO_TEST_CASE(custom_metadata)
{
zmqpp::context context;
zmqpp::socket client(context, zmqpp::socket_type::req);
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9004");

zmqpp::socket server(context, zmqpp::socket_type::rep);
server.bind("tcp://*:9000");
server.bind("tcp://*:9004");

zmqpp::message request;
request << "1.0" << "0001" << "test" << "192.168.55.1" << "BOB" << "PLAIN" << "admin" << "secret";
Expand Down Expand Up @@ -308,14 +308,14 @@ BOOST_AUTO_TEST_CASE(ironhouse)
int as_server = 1;
server.set(zmqpp::socket_option::curve_server, as_server);
server.set(zmqpp::socket_option::curve_secret_key, server_keypair.secret_key);
server.bind("tcp://*:9000");
server.bind("tcp://*:9005");

// create and connect a client socket
zmqpp::socket client(context, zmqpp::socket_type::pull);
client.set(zmqpp::socket_option::curve_server_key, server_keypair.public_key);
client.set(zmqpp::socket_option::curve_public_key, client_keypair.public_key);
client.set(zmqpp::socket_option::curve_secret_key, client_keypair.secret_key);
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9005");

// Send a single message from server to client
zmqpp::message request;
Expand All @@ -341,7 +341,7 @@ static void client_task(zmqpp::curve::keypair& client_keypair, std::string serve
client.set(zmqpp::socket_option::curve_server_key, server_public_key);
client.set(zmqpp::socket_option::curve_public_key, client_keypair.public_key);
client.set(zmqpp::socket_option::curve_secret_key, client_keypair.secret_key);
client.connect("tcp://127.0.0.1:9000");
client.connect("tcp://127.0.0.1:9006");

// Wait for our message, that signals the test was successful
zmqpp::message response;
Expand Down Expand Up @@ -381,7 +381,7 @@ static void server_task(zmqpp::curve::keypair& server_keypair, std::vector<std::
int as_server = 1;
server.set(zmqpp::socket_option::curve_server, as_server);
server.set(zmqpp::socket_option::curve_secret_key, server_keypair.secret_key);
server.bind("tcp://*:9000");
server.bind("tcp://*:9006");

// Send a single message from server to client
zmqpp::message request;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_socket_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ BOOST_AUTO_TEST_CASE( get_socket_options_tcp_only )
{
zmqpp::context context;
zmqpp::socket socket(context, zmqpp::socket_type::subscribe);
socket.bind("tcp://*:54321");
socket.bind("tcp://*:54322");

// TODO: reenable once I have curve key generation working to test against
// CHECK_GET(socket, std::string, curve_public_key);
Expand Down

0 comments on commit 9a783d0

Please sign in to comment.