@@ -196,15 +196,15 @@ def step_impl(context: MinifiTestContext, content: str, directory: str, duration
196196
197197
198198@then ('after a wait of {duration}, at least {lower_bound:d} and at most {upper_bound:d} files are produced and placed in the "{directory}" directory' )
199- def step_impl (context , lower_bound , upper_bound , duration , directory ):
199+ def step_impl (context : MinifiTestContext , lower_bound : int , upper_bound : int , duration : str , directory : str ):
200200 duration_seconds = humanfriendly .parse_timespan (duration )
201201 assert check_condition_after_wait (condition = lambda : context .get_default_minifi_container ().get_number_of_files (directory ) >= lower_bound
202202 and context .get_default_minifi_container ().get_number_of_files (directory ) <= upper_bound ,
203203 context = context , wait_time = duration_seconds )
204204
205205
206206@then ('exactly these files are in the "{directory}" directory in less than {duration}: "{contents}"' )
207- def step_impl (context , directory , duration , contents ):
207+ def step_impl (context : MinifiTestContext , directory : str , duration : str , contents : str ):
208208 if not contents :
209209 context .execute_steps (f'then no files are placed in the "{ directory } " directory in { duration } of running time' )
210210 return
@@ -221,15 +221,15 @@ def step_impl(context, directory, duration):
221221
222222
223223@then ("at least one empty file is placed in the \" {directory}\" directory in less than {duration}" )
224- def step_impl (context , directory , duration ):
224+ def step_impl (context : MinifiTestContext , directory : str , duration : str ):
225225 timeout_in_seconds = humanfriendly .parse_timespan (duration )
226226 assert wait_for_condition (
227227 condition = lambda : context .get_default_minifi_container ().directory_contains_empty_file (directory ),
228228 timeout_seconds = timeout_in_seconds , bail_condition = lambda : context .get_default_minifi_container ().exited , context = context )
229229
230230
231231@then ("in the \" {container_name}\" container at least one empty file is placed in the \" {directory}\" directory in less than {duration}" )
232- def step_impl (context , container_name , directory , duration ):
232+ def step_impl (context : MinifiTestContext , container_name : str , directory : str , duration : str ):
233233 timeout_in_seconds = humanfriendly .parse_timespan (duration )
234234 if container_name == "nifi" :
235235 assert wait_for_condition (
@@ -242,7 +242,7 @@ def step_impl(context, container_name, directory, duration):
242242
243243
244244@then ("in the \" {container_name}\" container at least one file with minimum size of \" {size}\" is placed in the \" {directory}\" directory in less than {duration}" )
245- def step_impl (context , container_name : str , directory : str , size : str , duration : str ):
245+ def step_impl (context : MinifiTestContext , container_name : str , directory : str , size : str , duration : str ):
246246 timeout_in_seconds = humanfriendly .parse_timespan (duration )
247247 size_in_bytes = humanfriendly .parse_size (size )
248248 assert wait_for_condition (
@@ -251,6 +251,14 @@ def step_impl(context, container_name: str, directory: str, size: str, duration:
251251
252252
253253@then ("at least one file with minimum size of \" {size}\" is placed in the \" {directory}\" directory in less than {duration}" )
254- def step_impl (context , directory : str , size : str , duration : str ):
254+ def step_impl (context : MinifiTestContext , directory : str , size : str , duration : str ):
255255 context .execute_steps (
256256 f'Then in the "{ DEFAULT_MINIFI_CONTAINER_NAME } " container at least one file with minimum size of "{ size } " is placed in the "{ directory } " directory in less than { duration } ' )
257+
258+
259+ @then ("the MiNiFi C2 server logs contain the following message: \" {log_message}\" in less than {duration}" )
260+ def step_impl (context : MinifiTestContext , log_message : str , duration : str ):
261+ duration_seconds = humanfriendly .parse_timespan (duration )
262+ assert wait_for_condition (condition = lambda : log_message in context .get_minifi_container ("minifi-c2-server" ).get_logs (),
263+ timeout_seconds = duration_seconds , bail_condition = lambda : context .get_minifi_container ("minifi-c2-server" ).exited ,
264+ context = context )
0 commit comments