aboutsummaryrefslogtreecommitdiff
path: root/src/test/rpc_tests.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-05-19 10:20:31 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-06-17 21:40:55 +0200
commit1086ffba2639098558422935eba1cae9983dd913 (patch)
treee9a5391a9af07fb896602ff0a48b99df12cfbaba /src/test/rpc_tests.cpp
parentd930b26a264ed7eae6ce239f3bfb4ff023df8195 (diff)
[QA] add setban/listbanned/clearbanned tests
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()