code: def run_test(test, config, mocker):
      mocker.patch(
          "model_archiver.model_packaging.ArgParser.export_model_args_parser",
          return_value=config,
      )
      from model_archiver.model_packaging import generate_model_archive
  
      it = test.get("iterations", 1)
      for i in range(it):
          try:
              generate_model_archive()
          except Exception as exc:
              if test.get("expect-error") is not True:
                  assert 0, str(exc)
              else:
                  return 0
      # In case we expect an error we should not be here
      if test.get("expect-error") is True:
          assert 0, f"Error expected in test: {test['name']}"
      return 1
  
imports: import errno
  import json
  import os
  import platform
  import shutil
  import tempfile
  import time
  from argparse import Namespace
  from datetime import datetime
  from pathlib import Path
  import model_archiver
label_desc: Use image node_id 3 for calling a global function with example usage: run_test(test, config, mocker) and returns: int, int