[QA] add setban/listbanned/clearbanned tests

This commit is contained in:
Jonas Schnelli
2017-03-02 13:23:03 -08:00
committed by Jack Grigg
parent ed3f13a057
commit 962ec4b5e4
2 changed files with 34 additions and 14 deletions
+9
View File
@@ -227,4 +227,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()