aboutsummaryrefslogtreecommitdiff
path: root/src/test/rpc_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rpc_tests.cpp')
-rw-r--r--src/test/rpc_tests.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp
index 08f988fdbf..3cec4b76dd 100644
--- a/src/test/rpc_tests.cpp
+++ b/src/test/rpc_tests.cpp
@@ -177,4 +177,13 @@ BOOST_AUTO_TEST_CASE(rpc_boostasiotocnetaddr)
BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("::ffff:127.0.0.1")).ToString(), "127.0.0.1");
}
+BOOST_AUTO_TEST_CASE(rpc_ban)
+{
+ BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.1 add")));
+ BOOST_CHECK_THROW(CallRPC(string("setban 127.0.0.1:8334")), runtime_error); //portnumber for setban not allowed
+ BOOST_CHECK_NO_THROW(CallRPC(string("listbanned")));
+ BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.1 remove")));
+ BOOST_CHECK_NO_THROW(CallRPC(string("clearbanned")));
+}
+
BOOST_AUTO_TEST_SUITE_END()