mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 01:51:45 +00:00
Avoid fixed ports in the test suites
This commit is contained in:
committed by
Dennis Klein
parent
bfd08bb33f
commit
f4d39d224b
@@ -45,11 +45,9 @@ add_testhelper(runTestDevice
|
||||
${definitions}
|
||||
)
|
||||
|
||||
set(MQ_CONFIG "${CMAKE_BINARY_DIR}/test/testsuite_FairMQ.IOPatterns_config.json")
|
||||
set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice")
|
||||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq)
|
||||
set(SDK_TESTSUITE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sdk)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/config.json.in ${MQ_CONFIG})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/runner.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/runner.cxx)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestEnvironment.h.in ${CMAKE_CURRENT_BINARY_DIR}/TestEnvironment.h)
|
||||
|
||||
|
@@ -41,6 +41,7 @@ auto RunPushPullWithMsgResize(string const & transport, string const & _address)
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));
|
||||
|
||||
Channel push{"Push", "push", factory};
|
||||
@@ -102,6 +103,7 @@ auto RunMsgRebuild(const string& transport) -> void
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));
|
||||
|
||||
size_t const msgSize{100};
|
||||
@@ -134,6 +136,7 @@ auto RunPushPullWithAlignment(string const& transport, string const& _address) -
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));
|
||||
|
||||
Channel push{"Push", "push", factory};
|
||||
@@ -187,6 +190,7 @@ auto EmptyMessage(string const& transport, string const& _address) -> void
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));
|
||||
|
||||
Channel push{"Push", "push", factory};
|
||||
@@ -237,6 +241,7 @@ auto ZeroCopy() -> void
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory(TransportFactory::CreateTransportFactory("shmem", tools::Uuid(), &config));
|
||||
|
||||
unique_ptr<string> str(make_unique<string>("asdf"));
|
||||
@@ -268,7 +273,9 @@ auto ZeroCopyFromUnmanaged(string const& address) -> void
|
||||
ProgOptions config2;
|
||||
string session(tools::Uuid());
|
||||
config1.SetProperty<string>("session", session);
|
||||
config1.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
config2.SetProperty<string>("session", session);
|
||||
config2.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
// ref counts should be accessible accross different segments
|
||||
config2.SetProperty<uint16_t>("shm-segment-id", 2);
|
||||
auto factory1(TransportFactory::CreateTransportFactory("shmem", tools::Uuid(), &config1));
|
||||
|
@@ -10,7 +10,9 @@
|
||||
|
||||
#include <fairmq/tools/Unique.h>
|
||||
#include <fairmq/tools/Process.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -23,15 +25,22 @@ using namespace fair::mq::tools;
|
||||
|
||||
auto RunPoller(string transport, int pollType) -> void
|
||||
{
|
||||
size_t session{fair::mq::tools::UuidHash()};
|
||||
size_t session{UuidHash()};
|
||||
string data1IpcFile("/tmp/fmq_" + to_string(session) + "_data1_" + transport);
|
||||
string data2IpcFile("/tmp/fmq_" + to_string(session) + "_data2_" + transport);
|
||||
string data1Address("ipc://" + data1IpcFile);
|
||||
string data2Address("ipc://" + data2IpcFile);
|
||||
|
||||
auto pollout = execute_result{"", 0};
|
||||
thread poll_out_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice
|
||||
<< " --id pollout_"<< transport
|
||||
<< " --control static --color false"
|
||||
<< " --session " << session << " --mq-config \"" << mqConfig << "\"";
|
||||
<< " --control static"
|
||||
<< " --color false"
|
||||
<< " --session " << session
|
||||
<< " --channel-config name=data1,type=push,method=bind,address=" << data1Address
|
||||
<< " name=data2,type=push,method=bind,address=" << data2Address;
|
||||
pollout = execute(cmd.str(), "[POLLOUT]");
|
||||
});
|
||||
|
||||
@@ -40,8 +49,12 @@ auto RunPoller(string transport, int pollType) -> void
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice
|
||||
<< " --id pollin_" << transport
|
||||
<< " --control static --color false"
|
||||
<< " --session " << session << " --mq-config \"" << mqConfig << "\" --poll-type " << pollType;
|
||||
<< " --control static"
|
||||
<< " --color false"
|
||||
<< " --session " << session
|
||||
<< " --poll-type " << pollType
|
||||
<< " --channel-config name=data1,type=pull,method=connect,address=" << data1Address
|
||||
<< " name=data2,type=pull,method=connect,address=" << data2Address;
|
||||
pollin = execute(cmd.str(), "[POLLIN]");
|
||||
});
|
||||
|
||||
@@ -49,6 +62,9 @@ auto RunPoller(string transport, int pollType) -> void
|
||||
poll_in_thread.join();
|
||||
cerr << pollout.console_out << pollin.console_out;
|
||||
|
||||
std::remove(data1IpcFile.c_str());
|
||||
std::remove(data2IpcFile.c_str());
|
||||
|
||||
exit(pollout.exit_code + pollin.exit_code);
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,9 @@
|
||||
#include "runner.h"
|
||||
#include <fairmq/tools/Unique.h>
|
||||
#include <fairmq/tools/Process.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -23,20 +25,37 @@ using namespace fair::mq::tools;
|
||||
auto RunPair(string transport) -> void
|
||||
{
|
||||
size_t session{fair::mq::tools::UuidHash()};
|
||||
string ipcFile("/tmp/fmq_" + to_string(session) + "_data_" + transport);
|
||||
string address("ipc://" + ipcFile);
|
||||
|
||||
// ofi does not run with ipc://
|
||||
if (transport == "ofi") {
|
||||
address = "tcp://127.0.0.1:5957";
|
||||
}
|
||||
|
||||
auto pairleft = execute_result{"", 100};
|
||||
thread pairleft_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id pairleft_" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id pairleft_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=pair,method=bind,address=" << address;
|
||||
pairleft = execute(cmd.str(), "[PAIR L]");
|
||||
});
|
||||
|
||||
auto pairright = execute_result{"", 100};
|
||||
thread pairright_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id pairright_" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id pairright_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=pair,method=connect,address=" << address;
|
||||
pairright = execute(cmd.str(), "[PAIR R]");
|
||||
});
|
||||
|
||||
@@ -44,6 +63,8 @@ auto RunPair(string transport) -> void
|
||||
pairright_thread.join();
|
||||
cerr << pairleft.console_out << pairright.console_out;
|
||||
|
||||
std::remove(ipcFile.c_str());
|
||||
|
||||
exit(pairleft.exit_code + pairright.exit_code);
|
||||
}
|
||||
|
||||
|
@@ -7,9 +7,14 @@
|
||||
********************************************************************************/
|
||||
|
||||
#include "runner.h"
|
||||
|
||||
#include <fairmq/tools/Unique.h>
|
||||
#include <fairmq/tools/Process.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -23,28 +28,47 @@ using namespace fair::mq::tools;
|
||||
auto RunPubSub(string transport) -> void
|
||||
{
|
||||
size_t session{fair::mq::tools::UuidHash()};
|
||||
string dataIpcFile("/tmp/fmq_" + to_string(session) + "_data_" + transport);
|
||||
string ctrlIpcFile("/tmp/fmq_" + to_string(session) + "_ctrl_" + transport);
|
||||
string dataAddress("ipc://" + dataIpcFile);
|
||||
string ctrlAddress("ipc://" + ctrlIpcFile);
|
||||
|
||||
auto pub = execute_result{"", 0};
|
||||
thread pub_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id pub_" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id pub_" << transport
|
||||
<< " --control static"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=pub,method=bind,address=" << dataAddress
|
||||
<< " name=control,type=pull,method=bind,address=" << ctrlAddress;
|
||||
pub = execute(cmd.str(), "[PUB]");
|
||||
});
|
||||
|
||||
auto sub1 = execute_result{"", 0};
|
||||
thread sub1_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id sub_1" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id sub_1" << transport
|
||||
<< " --control static"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=sub,method=connect,address=" << dataAddress
|
||||
<< " name=control,type=push,method=connect,address=" << ctrlAddress;
|
||||
sub1 = execute(cmd.str(), "[SUB1]");
|
||||
});
|
||||
|
||||
auto sub2 = execute_result{"", 0};
|
||||
thread sub2_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id sub_2" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id sub_2" << transport
|
||||
<< " --control static"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=sub,method=connect,address=" << dataAddress
|
||||
<< " name=control,type=push,method=connect,address=" << ctrlAddress;
|
||||
sub2 = execute(cmd.str(), "[SUB2]");
|
||||
});
|
||||
|
||||
@@ -53,6 +77,9 @@ auto RunPubSub(string transport) -> void
|
||||
sub2_thread.join();
|
||||
cerr << pub.console_out << sub1.console_out << sub2.console_out << endl;
|
||||
|
||||
std::remove(dataIpcFile.c_str());
|
||||
std::remove(ctrlIpcFile.c_str());
|
||||
|
||||
exit(pub.exit_code + sub1.exit_code + sub2.exit_code);
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,9 @@
|
||||
#include "runner.h"
|
||||
#include <fairmq/tools/Unique.h>
|
||||
#include <fairmq/tools/Process.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -22,21 +24,33 @@ using namespace fair::mq::tools;
|
||||
|
||||
auto RunPushPull(string transport) -> void
|
||||
{
|
||||
size_t session{fair::mq::tools::UuidHash()};
|
||||
size_t session(fair::mq::tools::UuidHash());
|
||||
string ipcFile("/tmp/fmq_" + to_string(session) + "_data_" + transport);
|
||||
string address("ipc://" + ipcFile);
|
||||
|
||||
auto push = execute_result{"", 100};
|
||||
thread push_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id push_" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id push_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=push,method=bind,address=" << address;
|
||||
push = execute(cmd.str(), "[PUSH]");
|
||||
});
|
||||
|
||||
auto pull = execute_result{"", 100};
|
||||
thread pull_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id pull_" << transport << " --control static "
|
||||
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id pull_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data,type=pull,method=connect,address=" << address;
|
||||
pull = execute(cmd.str(), "[PULL]");
|
||||
});
|
||||
|
||||
@@ -44,15 +58,17 @@ auto RunPushPull(string transport) -> void
|
||||
pull_thread.join();
|
||||
cerr << push.console_out << pull.console_out;
|
||||
|
||||
std::remove(ipcFile.c_str());
|
||||
|
||||
exit(push.exit_code + pull.exit_code);
|
||||
}
|
||||
|
||||
TEST(PushPull, SingleMsg_MP_tcp_zeromq)
|
||||
TEST(PushPull, SingleMsg_MP_ipc_zeromq)
|
||||
{
|
||||
EXPECT_EXIT(RunPushPull("zeromq"), ::testing::ExitedWithCode(0), "PUSH-PULL test successfull");
|
||||
}
|
||||
|
||||
TEST(PushPull, SingleMsg_MP_tcp_shmem)
|
||||
TEST(PushPull, SingleMsg_MP_ipc_shmem)
|
||||
{
|
||||
EXPECT_EXIT(RunPushPull("shmem"), ::testing::ExitedWithCode(0), "PUSH-PULL test successfull");
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ auto RunSingleThreadedMultipart(string transport, string address1, string addres
|
||||
|
||||
fair::mq::ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
|
||||
auto factory = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config);
|
||||
|
||||
|
@@ -9,7 +9,9 @@
|
||||
#include "runner.h"
|
||||
#include <fairmq/tools/Unique.h>
|
||||
#include <fairmq/tools/Process.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -23,37 +25,45 @@ using namespace fair::mq::tools;
|
||||
auto RunReqRep(string transport) -> void
|
||||
{
|
||||
size_t session{fair::mq::tools::UuidHash()};
|
||||
string ipcFile("/tmp/fmq_" + to_string(session) + "_data_" + transport);
|
||||
string address("ipc://" + ipcFile);
|
||||
|
||||
auto rep = execute_result{"", 0};
|
||||
thread rep_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id rep_" << transport
|
||||
cmd << runTestDevice
|
||||
<< " --id rep_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --mq-config \"" << mqConfig << "\"";
|
||||
<< " --channel-config name=data,type=rep,method=bind,address=" << address;
|
||||
rep = execute(cmd.str(), "[REP]");
|
||||
});
|
||||
|
||||
auto req1 = execute_result{"", 0};
|
||||
thread req1_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id req_1" << transport
|
||||
cmd << runTestDevice
|
||||
<< " --id req_1" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --mq-config \"" << mqConfig << "\"";
|
||||
<< " --channel-config name=data,type=req,method=connect,address=" << address;
|
||||
req1 = execute(cmd.str(), "[REQ1]");
|
||||
});
|
||||
|
||||
auto req2 = execute_result{"", 0};
|
||||
thread req2_thread([&]() {
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id req_2" << transport
|
||||
cmd << runTestDevice
|
||||
<< " --id req_2" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --mq-config \"" << mqConfig << "\"";
|
||||
<< " --channel-config name=data,type=req,method=connect,address=" << address;
|
||||
req2 = execute(cmd.str(), "[REQ2]");
|
||||
});
|
||||
|
||||
@@ -62,6 +72,8 @@ auto RunReqRep(string transport) -> void
|
||||
req2_thread.join();
|
||||
cerr << req1.console_out << req2.console_out << rep.console_out;
|
||||
|
||||
std::remove(ipcFile.c_str());
|
||||
|
||||
exit(req1.exit_code + req2.exit_code + rep.exit_code);
|
||||
}
|
||||
|
||||
|
@@ -1,403 +0,0 @@
|
||||
{
|
||||
"fairMQOptions": {
|
||||
"devices": [
|
||||
{
|
||||
"id": "pairleft_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5557",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pairright_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5557",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pairleft_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5857",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pairright_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5857",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pairleft_ofi",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5957",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "ofi",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pairright_ofi",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5957",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "ofi",
|
||||
"type": "pair"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "push_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5557",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pull_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5557",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pull"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "push_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5857",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pull_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5857",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pull"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pub_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5556",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pub"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5555",
|
||||
"method": "bind",
|
||||
"name": "control",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pull"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sub_1zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5556",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "sub"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5555",
|
||||
"method": "connect",
|
||||
"name": "control",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "sub_2zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5556",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "sub"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5555",
|
||||
"method": "connect",
|
||||
"name": "control",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "req_1zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5558",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "req"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "req_2zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5558",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "req"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "req_1shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5758",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "req"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "req_2shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5758",
|
||||
"method": "connect",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "req"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "rep_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5558",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "rep"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "rep_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5758",
|
||||
"method": "bind",
|
||||
"name": "data",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "rep"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "transfer_timeout_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5559",
|
||||
"method": "bind",
|
||||
"name": "data-in",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pull"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5560",
|
||||
"method": "bind",
|
||||
"name": "data-out",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "transfer_timeout_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5959",
|
||||
"method": "bind",
|
||||
"name": "data-in",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pull"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:5960",
|
||||
"method": "bind",
|
||||
"name": "data-out",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pollout_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6000",
|
||||
"method": "bind",
|
||||
"name": "data1",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6001",
|
||||
"method": "bind",
|
||||
"name": "data2",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pollin_zeromq",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6000",
|
||||
"method": "connect",
|
||||
"name": "data1",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pull"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6001",
|
||||
"method": "connect",
|
||||
"name": "data2",
|
||||
"rateLogging": 0,
|
||||
"transport": "zeromq",
|
||||
"type": "pull"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pollout_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6004",
|
||||
"method": "bind",
|
||||
"name": "data1",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "push"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6005",
|
||||
"method": "bind",
|
||||
"name": "data2",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "push"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pollin_shmem",
|
||||
"channels": [
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6004",
|
||||
"method": "connect",
|
||||
"name": "data1",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pull"
|
||||
},
|
||||
{
|
||||
"address": "tcp://127.0.0.1:6005",
|
||||
"method": "connect",
|
||||
"name": "data2",
|
||||
"rateLogging": 0,
|
||||
"transport": "shmem",
|
||||
"type": "pull"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@@ -33,7 +33,9 @@ void RegionsCache(const string& transport, const string& address)
|
||||
ProgOptions config1;
|
||||
ProgOptions config2;
|
||||
config1.SetProperty<string>("session", to_string(session1));
|
||||
config1.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
config2.SetProperty<string>("session", to_string(session2));
|
||||
config2.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
|
||||
auto factory1 = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config1);
|
||||
auto factory2 = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config2);
|
||||
@@ -92,6 +94,7 @@ void RegionEventSubscriptions(const string& transport)
|
||||
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", to_string(session));
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
|
||||
auto factory = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config);
|
||||
|
||||
@@ -164,6 +167,7 @@ void RegionCallbacks(const string& transport, const string& _address)
|
||||
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", to_string(session));
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
|
||||
auto factory = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config);
|
||||
|
||||
|
@@ -19,7 +19,6 @@ namespace fair::mq::test
|
||||
using namespace std;
|
||||
|
||||
string runTestDevice = "@RUN_TEST_DEVICE@";
|
||||
string mqConfig = "@MQ_CONFIG@";
|
||||
|
||||
} // namespace fair::mq::test
|
||||
|
||||
|
@@ -41,6 +41,7 @@ void RunOptionsTest(const string& transport)
|
||||
{
|
||||
ProgOptions config;
|
||||
config.SetProperty<string>("session", tools::Uuid());
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
auto factory = TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config);
|
||||
Channel channel("Push", "push", factory);
|
||||
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio> // std::remove
|
||||
#include <sstream> // std::stringstream
|
||||
#include <thread>
|
||||
|
||||
@@ -40,13 +41,29 @@ void delayedInterruptor(TransportFactory& transport)
|
||||
auto RunTransferTimeout(string transport) -> void
|
||||
{
|
||||
size_t session{UuidHash()};
|
||||
string dataInIpcFile("/tmp/fmq_" + to_string(session) + "_datain_" + transport);
|
||||
string dataOutIpcFile("/tmp/fmq_" + to_string(session) + "_dataout_" + transport);
|
||||
string dataInAddress("ipc://" + dataInIpcFile);
|
||||
string dataOutAddress("ipc://" + dataOutIpcFile);
|
||||
|
||||
stringstream cmd;
|
||||
cmd << runTestDevice << " --id transfer_timeout_" << transport << " --control static --transport " << transport
|
||||
<< " --session " << session << " --color false --mq-config \"" << mqConfig << "\"";
|
||||
cmd << runTestDevice
|
||||
<< " --id transfer_timeout_" << transport
|
||||
<< " --control static"
|
||||
<< " --shm-segment-size 100000000"
|
||||
<< " --severity debug"
|
||||
<< " --transport " << transport
|
||||
<< " --session " << session
|
||||
<< " --color false"
|
||||
<< " --channel-config name=data-in,type=pull,method=bind,address=" << dataInAddress
|
||||
<< " name=data-out,type=push,method=bind,address=" << dataOutAddress;
|
||||
auto res = execute(cmd.str());
|
||||
|
||||
cerr << res.console_out;
|
||||
|
||||
std::remove(dataInIpcFile.c_str());
|
||||
std::remove(dataOutIpcFile.c_str());
|
||||
|
||||
exit(res.exit_code);
|
||||
}
|
||||
|
||||
@@ -57,6 +74,7 @@ void InterruptTransfer(const string& transport, const string& _address)
|
||||
|
||||
fair::mq::ProgOptions config;
|
||||
config.SetProperty<string>("session", to_string(session));
|
||||
config.SetProperty<size_t>("shm-segment-size", 100000000);
|
||||
|
||||
auto factory = TransportFactory::CreateTransportFactory(transport, Uuid(), &config);
|
||||
|
||||
|
Reference in New Issue
Block a user