code: def test_replace_mar_file_with_dummy():
      """Validates that torchserve will fail to start in the following scenario:
      1) We use a snapshot file to start torchserve. The snapshot contains reference to "A" model file
      2) "A" model file gets corrupted or is replaced by some dummy mar file with same name
      """
  
      snapshot_created_on_management_api_invoke()
  
      # Start Torchserve using last snapshot state
      snapshot_cfg = glob.glob("logs/config/*snap*.cfg")[0]
      test_utils.start_torchserve(snapshot_file=snapshot_cfg)
      response = requests.get("http://127.0.0.1:8081/models/")
      assert (
          json.loads(response.content)["models"][0]["modelName"]
          == "densenet161"
      )
      test_utils.stop_torchserve()
  
      # Now replace the registered model mar with dummy file
      replace_mar_file_with_dummy_mar_in_model_store(
          model_store=os.path.join(test_utils.ROOT_DIR, "model_store"),
          model_mar="densenet161.mar",
      )
      snapshot_cfg = glob.glob("logs/config/*snap*.cfg")[0]
      test_utils.start_torchserve(
          snapshot_file=snapshot_cfg, gen_mar=False
      )
      try:
          response = requests.get("http://127.0.0.1:8081/models/")
          assert (
              json.loads(response.content)["models"][0]["modelName"]
              == "densenet161"
          )
      except:
          assert False, "Default manifest does not work"
      else:
          assert (
              True
          ), "Successfully started Torchserve with a dummy mar file (ie. default manifest)"
      finally:
          test_utils.unregister_model("densenet161")
          test_utils.delete_all_snapshots()
          test_utils.delete_model_store()
          test_utils.stop_torchserve()
  
imports: import platform
  import time
  import os
  import glob
  import requests
  import json
  import test_utils
label_desc: Use image node_id 15 for calling a global function with example usage: test_replace_mar_file_with_dummy() without return types