6#include <chainparams.h>
14#include <boost/test/unit_test.hpp>
21 const fs::path banlist_path{m_args.GetDataDirBase() /
"banlist_test"};
23 const std::string entries_write{
24 "{ \"banned_nets\": ["
25 " { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"aaaaaaaaa\" },"
26 " { \"version\": 2, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"bbbbbbbbb\" },"
27 " { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"1.0.0.0/8\" }"
33 ASSERT_DEBUG_LOG(
"Dropping entry with unparseable address or subnet (aaaaaaaaa) from ban list");
35 BanMan banman{banlist_path,
nullptr, 0};
BOOST_AUTO_TEST_CASE(file)
void GetBanned(banmap_t &banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(headers.FindFirst("key"), "value")
std::map< CSubNet, CBanEntry > banmap_t
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
#define ASSERT_DEBUG_LOG(message)