@@ -181,7 +181,7 @@ def prepare_parallel_run(request, parallel_run_context):
181181
182182
183183@pytest .fixture (scope = "module" )
184- def sanity_check_full (prepare_parallel_run , localhost , duthosts , request , fanouthosts , nbrhosts , tbinfo ):
184+ def sanity_check_full (ptfhost , prepare_parallel_run , localhost , duthosts , request , fanouthosts , nbrhosts , tbinfo ):
185185 logger .info ("Prepare sanity check" )
186186 should_skip_sanity = prepare_parallel_run
187187 if should_skip_sanity :
@@ -299,7 +299,7 @@ def sanity_check_full(prepare_parallel_run, localhost, duthosts, request, fanout
299299 pt_assert (False , "!!!!!!!!!!!!!!!!Pre-test sanity check failed: !!!!!!!!!!!!!!!!\n {}"
300300 .format (json .dumps (failed_results , indent = 4 , default = fallback_serializer )))
301301 else :
302- recover_on_sanity_check_failure (duthosts , failed_results , fanouthosts , localhost , nbrhosts ,
302+ recover_on_sanity_check_failure (ptfhost , duthosts , failed_results , fanouthosts , localhost , nbrhosts ,
303303 pre_check_items , recover_method , request , tbinfo , STAGE_PRE_TEST )
304304
305305 logger .info ("Done pre-test sanity check" )
@@ -325,15 +325,16 @@ def sanity_check_full(prepare_parallel_run, localhost, duthosts, request, fanout
325325 pt_assert (False , "!!!!!!!!!!!!!!!! Post-test sanity check failed: !!!!!!!!!!!!!!!!\n {}"
326326 .format (json .dumps (post_failed_results , indent = 4 , default = fallback_serializer )))
327327 else :
328- recover_on_sanity_check_failure (duthosts , post_failed_results , fanouthosts , localhost , nbrhosts ,
329- post_check_items , recover_method , request , tbinfo , STAGE_POST_TEST )
328+ recover_on_sanity_check_failure (ptfhost , duthosts , post_failed_results , fanouthosts , localhost ,
329+ nbrhosts , post_check_items , recover_method , request , tbinfo ,
330+ STAGE_POST_TEST )
330331
331332 logger .info ("Done post-test sanity check" )
332333 else :
333334 logger .info ('No post-test sanity check item, skip post-test sanity check.' )
334335
335336
336- def recover_on_sanity_check_failure (duthosts , failed_results , fanouthosts , localhost , nbrhosts , check_items ,
337+ def recover_on_sanity_check_failure (ptfhost , duthosts , failed_results , fanouthosts , localhost , nbrhosts , check_items ,
337338 recover_method , request , tbinfo , sanity_check_stage : str ):
338339 cache_key = "pre_sanity_check_failed"
339340 recovery_cache_key = "pre_sanity_recovered"
@@ -363,7 +364,7 @@ def recover_on_sanity_check_failure(duthosts, failed_results, fanouthosts, local
363364 else :
364365 for dut_name , dut_results in list (dut_failed_results .items ()):
365366 # Attempt to restore DUT state
366- recover (duthosts [dut_name ], localhost , fanouthosts , nbrhosts , tbinfo , dut_results ,
367+ recover (ptfhost , duthosts [dut_name ], localhost , fanouthosts , nbrhosts , tbinfo , dut_results ,
367368 recover_method )
368369
369370 except BaseException as e :
0 commit comments