diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-05-19 10:20:31 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-06-17 21:40:55 +0200 |
commit | 1086ffba2639098558422935eba1cae9983dd913 (patch) | |
tree | e9a5391a9af07fb896602ff0a48b99df12cfbaba /src | |
parent | d930b26a264ed7eae6ce239f3bfb4ff023df8195 (diff) |
[QA] add setban/listbanned/clearbanned tests
Diffstat (limited to 'src')
-rw-r--r-- | src/test/rpc_tests.cpp | 9 |
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() |