Skip to content

Commit 26c48d3

Browse files
committed
wip
1 parent 48e6811 commit 26c48d3

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/client/test/CmwLightTest.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ TEST_CASE("RDA3", "[Client]") {
88
std::string nameserverExample = R"""(GSCD025 DigitizerDU2.dal025 rda3://9#Address:#string#18#tcp:%2F%2Fdal025:16134#ApplicationId:#string#114#app=DigitizerDU2;uid=root;host=dal025;pid=16912;os=Linux%2D3%2E10%2E101%2Drt111%2Dscu03;osArch=64bit;appArch=64bit;lang=C%2B%2B;#Language:#string#3#C%2B%2B#Name:#string#19#DigitizerDU2%2Edal025#Pid:#int#16912#ProcessName:#string#12#DigitizerDU2#StartTime:#long#1699343695922#UserName:#string#4#root#Version:#string#5#3%2E1%2E0
99
GSCD023 DigitizerDU2.fel0053 rda3://9#Address:#string#18#tcp:%2F%2Ffel0053:3717#ApplicationId:#string#115#app=DigitizerDU2;uid=root;host=fel0053;pid=31447;os=Linux%2D3%2E10%2E101%2Drt111%2Dscu03;osArch=64bit;appArch=64bit;lang=C%2B%2B;#Language:#string#3#C%2B%2B#Name:#string#20#DigitizerDU2%2Efel0053#Pid:#int#31447#ProcessName:#string#12#DigitizerDU2#StartTime:#long#1701529074225#UserName:#string#4#root#Version:#string#5#3%2E1%2E0
1010
FantasyDevice3000 *UNKNOWN* *UNKNOWN*)""";
11-
std::string nameserver = "tcp://cmwpro00a.acc.gsi.de:5021";
1211

1312
SECTION("ParseNameserverReply") {
1413
std::map<std::string, std::map<std::string, std::map<std::string, std::variant<std::string, int, long>>>> devices = parse(nameserverExample);
@@ -19,10 +18,17 @@ FantasyDevice3000 *UNKNOWN* *UNKNOWN*)""";
1918
}
2019

2120
SECTION("Query rda3 directory server/nameserver") {
22-
opencmw::zmq::Context ctx{};
23-
auto result = resolveDirectoryLight({ "GSCD025", "GSCD023", "FantasyDevice3000" }, nameserver, ctx, 100ms);
24-
REQUIRE(!result.empty());
25-
REQUIRE(result == nameserverExample);
21+
auto env_nameserver = std::getenv("CMW_NAMESERVER");
22+
if (env_nameserver == nullptr) {
23+
fmt::print("skipping BasicCmwLight example test as it relies on the availability of network infrastructure.");
24+
return; // skip test
25+
} else {
26+
std::string nameserver{env_nameserver};
27+
opencmw::zmq::Context ctx{};
28+
auto result = resolveDirectoryLight({ "GSCD025", "GSCD023", "FantasyDevice3000" }, nameserver, ctx, 100ms);
29+
REQUIRE(!result.empty());
30+
REQUIRE(result == nameserverExample);
31+
}
2632
};
2733
}
2834

@@ -54,6 +60,10 @@ static std::string hexview(const std::string_view value, std::size_t bytesPerLin
5460
};
5561

5662
TEST_CASE("BasicCmwLight example", "[Client]") {
63+
if (std::getenv("CMW_NAMESERVER") == nullptr) {
64+
fmt::print("skipping BasicCmwLight example test as it relies on the availability of network infrastructure.");
65+
return; // skip test
66+
}
5767
const std::string digitizerAddress{ "tcp://dal007:2620" };
5868
// filters2String = "acquisitionModeFilter=int:0&channelNameFilter=GS11MU2:Voltage_1@10Hz";
5969
// GS01QS1F:Current@1Hz

0 commit comments

Comments
 (0)