-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: test banlist database recreation #26794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: test banlist database recreation #26794
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
utACK, would we also want to test that the recreated db can properly add and read a record to the db? |
3d6f2ee to
869ab3f
Compare
|
Force-pushed addressing @MarcoFalke's review. Replaced |
vasild
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test looks correct, but maybe p2p_disconnect_ban.py - "Test node disconnect and ban behavior" is not the best place to add it. To me it seems that this is more appropriate for a unit test by extending src/test/banman_tests.cpp.
869ab3f to
7087241
Compare
7087241 to
4bdcf57
Compare
@kevkevinpal Sounds good, I just force-pushed reordering the code to leave the great part of the ban test after the recreation.
@vasild I'm thinking about it, make sense. I put it in a functional test because here we can test the behavior of the whole process of starting/stopping the node and check how it deals recreating the db as well as see additions to the db after the recreation. |
|
lgtm ACK 4bdcf57 |
4bdcf57 test: test banlist database recreation (brunoerg) Pull request description: This PR adds test coverage for 'banlist database recreation'. If it wasn't able to read ban db (in `LoadBanlist`), so it should create a new (an empty, ofc) one. https://github.com/bitcoin/bitcoin/blob/d8bdee0fc889def7c5f5076da13db4fce0a3728a/src/banman.cpp#L28-L45 ACKs for top commit: MarcoFalke: lgtm ACK 4bdcf57 Tree-SHA512: d9d0cd0c4b3797189dff00d3a634878188e7cf51e78346601fc97e2bf78c495561705214062bb42ab8e491e0d111f8bfcf74dbc801768bc02cf2b45f162aad85
This PR adds test coverage for 'banlist database recreation'. If it wasn't able to read ban db (in
LoadBanlist), so it should create a new (an empty, ofc) one.bitcoin/src/banman.cpp
Lines 28 to 45 in d8bdee0