@@ -127,6 +127,24 @@ def create_big_chain(self):
127
127
128
128
self .sync_blocks (self .nodes [0 :5 ])
129
129
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
+
130
148
def test_height_min (self ):
131
149
assert os .path .isfile (os .path .join (self .prunedir , "blk00000.dat" )), "blk00000.dat is missing, pruning too early"
132
150
self .log .info ("Success" )
@@ -453,6 +471,9 @@ def run_test(self):
453
471
self .log .info ("Test wallet re-scan" )
454
472
self .wallet_test ()
455
473
474
+ self .log .info ("Test invalid pruning command line options" )
475
+ self .test_invalid_command_line_options ()
476
+
456
477
self .log .info ("Done" )
457
478
458
479
if __name__ == '__main__' :
0 commit comments