Skip to content

Commit e2ff385

Browse files
committed
test: check for invalid -prune parameters
1 parent 77e23ca commit e2ff385

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/functional/feature_pruning.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ def create_big_chain(self):
127127

128128
self.sync_blocks(self.nodes[0:5])
129129

130+
def test_invalid_command_line_options(self):
131+
self.nodes[0].assert_start_raises_init_error(
132+
expected_msg='Error: Prune cannot be configured with a negative value.',
133+
extra_args=['-prune=-1'],
134+
)
135+
self.nodes[0].assert_start_raises_init_error(
136+
expected_msg='Error: Prune configured below the minimum of 550 MiB. Please use a higher number.',
137+
extra_args=['-prune=549'],
138+
)
139+
self.nodes[0].assert_start_raises_init_error(
140+
expected_msg='Error: Prune mode is incompatible with -txindex.',
141+
extra_args=['-prune=550', '-txindex'],
142+
)
143+
self.nodes[0].assert_start_raises_init_error(
144+
expected_msg='Error: Prune mode is incompatible with -coinstatsindex.',
145+
extra_args=['-prune=550', '-coinstatsindex'],
146+
)
147+
130148
def test_height_min(self):
131149
assert os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), "blk00000.dat is missing, pruning too early"
132150
self.log.info("Success")
@@ -453,6 +471,9 @@ def run_test(self):
453471
self.log.info("Test wallet re-scan")
454472
self.wallet_test()
455473

474+
self.log.info("Test invalid pruning command line options")
475+
self.test_invalid_command_line_options()
476+
456477
self.log.info("Done")
457478

458479
if __name__ == '__main__':

0 commit comments

Comments
 (0)