code: def test_log_location_var_snapshot_disabled_custom_path_read_only():
      """
      Validates that we should not be able to create non metrics related logs if the directory configured
      via 'LOG_LOCATION' is a read only directory.
      """
      # Torchserve cleanup is required here as we are going to set 'LOG_LOCATION' environment variable
      test_utils.stop_torchserve()
      test_utils.delete_all_snapshots()
      # First remove existing logs otherwise it may be a false positive case
      for f in glob.glob("logs/*.log"):
          os.remove(f)
      RDONLY_DIR = path.join(test_utils.ROOT_DIR, "rdonly_dir")
      os.environ["LOG_LOCATION"] = RDONLY_DIR
      try:
          run_log_location_var(
              custom_path=RDONLY_DIR, no_config_snapshots=True
          )
          assert (
              len(glob.glob(RDONLY_DIR + "/logs/access_log.log")) == 0
          )
          assert len(glob.glob(RDONLY_DIR + "/logs/model_log.log")) == 0
          assert len(glob.glob(RDONLY_DIR + "/logs/ts_log.log")) == 0
          assert len(glob.glob("logs/model_metrics.log")) == 1
          assert len(glob.glob("logs/ts_metrics.log")) == 1
      finally:
          del os.environ["LOG_LOCATION"]
  
imports: import glob
  import os
  import platform
  import re
  import shutil
  import subprocess
  import time
  from os import path
  import requests
  import test_utils
label_desc: Use image node_id 21 for calling a global function with example usage: test_log_location_var_snapshot_disabled_custom_path_read_only() without return types