code: def test_command(args):
      user_box_dir = THIS_DIR
      base_box_dir = user_box_dir / "base-box"
      boards_file = (
          THIS_DIR
          / ".."
          / args.platform
          / "template_project"
          / "boards.json"
      )
      with open(boards_file) as f:
          test_config = json.load(f)
  
          # select microTVM test config
          microtvm_test_config = test_config[args.microtvm_board]
  
          for key, expected_type in REQUIRED_TEST_CONFIG_KEYS.items():
              assert key in microtvm_test_config and isinstance(
                  microtvm_test_config[key], expected_type
              ), f"Expected key {key} of type {expected_type} in {boards_file}: {test_config!r}"
  
          microtvm_test_config["vid_hex"] = microtvm_test_config[
              "vid_hex"
          ].lower()
          microtvm_test_config["pid_hex"] = microtvm_test_config[
              "pid_hex"
          ].lower()
          microtvm_test_config["microtvm_board"] = args.microtvm_board
  
      providers = args.provider
  
      release_test_dir = THIS_DIR / f"release-test"
  
      if args.skip_build or args.skip_destroy:
          assert (
              len(providers) == 1
          ), "--skip-build and/or --skip-destroy was given, but >1 provider specified"
  
      test_failed = False
      for provider_name in providers:
          try:
              if not args.skip_build:
                  do_build_release_test_vm(
                      release_test_dir,
                      user_box_dir,
                      base_box_dir,
                      provider_name,
                  )
              do_run_release_test(
                  release_test_dir,
                  provider_name,
                  microtvm_test_config,
                  args.test_device_serial,
              )
  
          except subprocess.CalledProcessError:
              test_failed = True
              sys.exit(
                  f"\n\nERROR: Provider '{provider_name}' failed the release test. "
                  "You can re-run it to reproduce the issue without building everything "
                  "again by passing the --skip-build and specifying only the provider that failed. "
                  "The VM is still running in case you want to connect it via SSH to "
                  "investigate further the issue, thus it's necessary to destroy it manually "
                  "to release the resources back to the host, like a USB device attached to the VM."
              )
  
          finally:
              # if we reached out here do_run_release_test() succeeded, hence we can
              # destroy the VM and release the resources back to the host if user haven't
              # requested to not destroy it.
              if not (args.skip_destroy or test_failed):
                  subprocess.check_call(
                      ["vagrant", "destroy", "-f"], cwd=release_test_dir
                  )
                  shutil.rmtree(release_test_dir)
  
      print(
          f'\n\nThe release tests passed on all specified providers: {", ".join(providers)}.'
      )
  
imports: import argparse
  import copy
  import json
  import logging
  import pathlib
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import pathlib
label_desc: Use image node_id 10 for calling a global function with example usage: test_command(args) without return types