diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2024-04-04 22:33:16 +0100 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2024-04-06 14:50:40 +0100 |
commit | 95a435a9c9d5d0ebec91e7bec5d7d2762ae124ae (patch) | |
tree | 268dc536d48c901f159d19449e33acaea81ce60f /tests | |
parent | net: define IPv4 object explicitly (diff) | |
download | monero-95a435a9c9d5d0ebec91e7bec5d7d2762ae124ae.tar.xz |
net: bring consistency between IPv4 port and IPv6 port
* --p2p-bind-port-ipv4 is replaced with --p2p-bind-ipv4-port
* --p2p-bind-port-ipv6 is replaced with --p2p-bind-ipv6-port
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/functional_tests/functional_tests_rpc.py | 2 | ||||
-rw-r--r-- | tests/trezor/daemon.cpp | 6 | ||||
-rw-r--r-- | tests/unit_tests/node_server.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/functional_tests/functional_tests_rpc.py b/tests/functional_tests/functional_tests_rpc.py index 8c8a8cfd0..287c1009a 100755 --- a/tests/functional_tests/functional_tests_rpc.py +++ b/tests/functional_tests/functional_tests_rpc.py @@ -52,7 +52,7 @@ WALLET_DIRECTORY = builddir + "/functional-tests-directory" FUNCTIONAL_TESTS_DIRECTORY = builddir + "/tests/functional_tests" DIFFICULTY = 10 -monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-port-ipv4", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] +monerod_base = [builddir + "/bin/monerod", "--regtest", "--fixed-difficulty", str(DIFFICULTY), "--no-igd", "--p2p-bind-ipv4-port", "monerod_p2p_port", "--rpc-bind-port", "monerod_rpc_port", "--zmq-rpc-bind-port", "monerod_zmq_port", "--zmq-pub", "monerod_zmq_pub", "--non-interactive", "--disable-dns-checkpoints", "--check-updates", "disabled", "--rpc-ssl", "disabled", "--data-dir", "monerod_data_dir", "--log-level", "1"] monerod_extra = [ ["--offline"], ["--rpc-payment-address", "44SKxxLQw929wRF6BA9paQ1EWFshNnKhXM3qz6Mo3JGDE2YG3xyzVutMStEicxbQGRfrYvAAYxH6Fe8rnD56EaNwUiqhcwR", "--rpc-payment-difficulty", str(DIFFICULTY), "--rpc-payment-credits", "5000", "--offline"], diff --git a/tests/trezor/daemon.cpp b/tests/trezor/daemon.cpp index 308fa6fc0..f35dc3d8e 100644 --- a/tests/trezor/daemon.cpp +++ b/tests/trezor/daemon.cpp @@ -69,7 +69,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) // By default pick non-standard ports to avoid confusion with possibly locally running daemons (mainnet/testnet) const char *test_p2p_port = getenv("TEST_P2P_PORT"); auto p2p_port = std::string(test_p2p_port && strlen(test_p2p_port) > 0 ? test_p2p_port : "61340"); - tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(p2p_port, false)); + tools::options::set_option(vm, nodetool::arg_p2p_bind_ipv4_port, po::variable_value(p2p_port, false)); const char *test_rpc_port = getenv("TEST_RPC_PORT"); auto rpc_port = std::string(test_rpc_port && strlen(test_rpc_port) > 0 ? test_rpc_port : "61341"); @@ -85,7 +85,7 @@ void mock_daemon::default_options(boost::program_options::variables_map & vm) void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned initial_port) { CHECK_AND_ASSERT_THROW_MES(initial_port < 65535-2, "Invalid port number"); - tools::options::set_option(vm, nodetool::arg_p2p_bind_port_ipv4, po::variable_value(std::to_string(initial_port), false)); + tools::options::set_option(vm, nodetool::arg_p2p_bind_ipv4_port, po::variable_value(std::to_string(initial_port), false)); tools::options::set_option(vm, cryptonote::core_rpc_server::arg_rpc_bind_port, po::variable_value(std::to_string(initial_port + 1), false)); tools::options::set_option(vm, daemon_args::arg_zmq_rpc_bind_port, po::variable_value(std::to_string(initial_port + 2), false)); po::notify(vm); @@ -93,7 +93,7 @@ void mock_daemon::set_ports(boost::program_options::variables_map & vm, unsigned void mock_daemon::load_params(boost::program_options::variables_map const & vm) { - m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_port_ipv4); + m_p2p_bind_port = command_line::get_arg(vm, nodetool::arg_p2p_bind_ipv4_port); m_rpc_bind_port = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_rpc_bind_port); m_zmq_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_port); m_network_type = command_line::get_arg(vm, cryptonote::arg_testnet_on) ? cryptonote::TESTNET : cryptonote::MAINNET; diff --git a/tests/unit_tests/node_server.cpp b/tests/unit_tests/node_server.cpp index 584ca3d63..c06a4e672 100644 --- a/tests/unit_tests/node_server.cpp +++ b/tests/unit_tests/node_server.cpp @@ -310,7 +310,7 @@ TEST(node_server, bind_same_p2p_port) ifconfig lo0 alias 127.0.0.2 */ vm.find(nodetool::arg_p2p_bind_ipv4_address.name)->second = boost::program_options::variable_value(std::string("127.0.0.2"), false); - vm.find(nodetool::arg_p2p_bind_port_ipv4.name)->second = boost::program_options::variable_value(std::string(port), false); + vm.find(nodetool::arg_p2p_bind_ipv4_port.name)->second = boost::program_options::variable_value(std::string(port), false); boost::program_options::notify(vm); @@ -1141,7 +1141,7 @@ TEST(node_server, race_condition) boost::program_options::store( boost::program_options::command_line_parser({ "--p2p-bind-ipv4-address=127.0.0.1", - "--p2p-bind-port-ipv4=48080", + "--p2p-bind-ipv4-port=48080", "--out-peers=0", "--data-dir", dir.string(), |