Mac: UT node server fix IP localhost by aliasing

This commit is contained in:
mj-xmr 2021-08-20 16:17:25 +02:00
parent a39b1d56c8
commit 1b7a708fa3
No known key found for this signature in database
GPG Key ID: C101BF94093451E0
1 changed files with 3 additions and 0 deletions

View File

@ -303,6 +303,9 @@ TEST(node_server, bind_same_p2p_port)
Relevant part about REUSEADDR from man: Relevant part about REUSEADDR from man:
https://www.man7.org/linux/man-pages/man7/ip.7.html 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_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); vm.find(nodetool::arg_p2p_bind_port.name)->second = boost::program_options::variable_value(std::string(port), false);