From 1b7a708fa3e1350ed402c3dc9a4bc563761c8ac7 Mon Sep 17 00:00:00 2001 From: mj-xmr Date: Fri, 20 Aug 2021 16:17:25 +0200 Subject: [PATCH] Mac: UT node server fix IP localhost by aliasing --- tests/unit_tests/node_server.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit_tests/node_server.cpp b/tests/unit_tests/node_server.cpp index cab600b3d..cc7790c1a 100644 --- a/tests/unit_tests/node_server.cpp +++ b/tests/unit_tests/node_server.cpp @@ -303,6 +303,9 @@ TEST(node_server, bind_same_p2p_port) Relevant part about REUSEADDR from man: https://www.man7.org/linux/man-pages/man7/ip.7.html + + For Mac OSX, set the following alias, before running the test, or else it will fail: + sudo ifconfig lo0 alias 127.0.0.2 */ vm.find(nodetool::arg_p2p_bind_ip.name)->second = boost::program_options::variable_value(std::string("127.0.0.2"), false); vm.find(nodetool::arg_p2p_bind_port.name)->second = boost::program_options::variable_value(std::string(port), false);