code: def run_test(test, cmd):
      it = (
          test.get("iterations")
          if test.get("iterations") is not None
          else 1
      )
      for i in range(it):
          try:
              subprocess.check_call(cmd, shell=True)
          except subprocess.CalledProcessError as exc:
              if test.get("expect-error") is not True:
                  assert 0, "{}".format(exc.output)
              else:
                  return 0
      return 1
  
file_path: serve/workflow-archiver/workflow_archiver/tests/integ_tests/test_integration_workflow_archiver.py
imports: from datetime import datetime
  import errno
  import json
  import os
  import shutil
  import subprocess
  import workflow_archiver
label_desc: Use image node_id 3 for calling a global function with example usage: run_test(test, cmd) and returns: int, int