diff --git a/src/config.cpp b/src/config.cpp index cd7c77f..0fcc4bf 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -433,15 +433,25 @@ Config& Config::applyEnv() return *this; } -Config Config::isolated() +Config Config::isolated(int family) { Config ret; ret.udp_port = 0u; ret.tcp_port = 0u; - ret.interfaces.emplace_back("127.0.0.1"); ret.auto_beacon = false; - ret.beaconDestinations.emplace_back("127.0.0.1"); + switch(family) { + case AF_INET: + ret.interfaces.emplace_back("127.0.0.1"); + ret.beaconDestinations.emplace_back("127.0.0.1"); + break; + case AF_INET6: + ret.interfaces.emplace_back("::1"); + ret.beaconDestinations.emplace_back("::1"); + break; + default: + throw std::logic_error(SB()<<"Unsupported address family "<buf[cmd_origin_tag_size]); // clear unicast flag in forwarded message *save_flags &= ~pva_search_flags::Unicast; diff --git a/test/testget.cpp b/test/testget.cpp index 2ee0e4d..8f43a8d 100644 --- a/test/testget.cpp +++ b/test/testget.cpp @@ -20,6 +20,7 @@ #include #include #include +#include "evhelper.h" namespace { using namespace pvxs; @@ -30,10 +31,10 @@ struct Tester { server::Server serv; client::Context cli; - Tester() + Tester(int family=AF_INET) :initial(nt::NTScalar{TypeCode::Int32}.create()) ,mbox(server::SharedPV::buildReadonly()) - ,serv(server::Config::isolated() + ,serv(server::Config::isolated(family) .build() .addPV("mailbox", mbox)) ,cli(serv.clientConfig().build()) @@ -498,12 +499,18 @@ void testError(bool phase) MAIN(testget) { - testPlan(57); + testPlan(59); testSetup(); logger_config_env(); + bool canIPv6 = pvxs::impl::evsocket::canIPv6(); Tester().testConnector(); Tester().testWaiter(); - Tester().loopback(); + Tester(AF_INET).loopback(); + if(canIPv6) { + Tester(AF_INET6).loopback(); + } else { + testSkip(2, "No IPv6 Support"); + } Tester().lazy(); Tester().timeout(); Tester().cancel();