def METHOD_NAME(black_panda, other_panda, direction, test_array, sleep_duration):
  global nonzero_bus_errors, zero_bus_errors, content_errors
  if direction:
    print("***************** TESTING (BLACK --> OTHER) *****************")
  else:
    print("***************** TESTING (OTHER --> BLACK) *****************")
  for send_bus, obd, recv_buses in test_array:
    black_panda.send_heartbeat()
    other_panda.send_heartbeat()
    print("\ntest can: ", send_bus, " OBD: ", obd)
    # set OBD on black panda
    black_panda.set_gmlan(True if obd else None)
    # clear and flush
    if direction:
      black_panda.can_clear(send_bus)
    else:
      other_panda.can_clear(send_bus)
    for recv_bus in recv_buses:
      if direction:
        other_panda.can_clear(recv_bus)
      else:
        black_panda.can_clear(recv_bus)
    black_panda.can_recv()
    other_panda.can_recv()
    # send the characters
    at = random.randint(1, 2000)
    st = get_test_string()[0:8]
    if direction:
      black_panda.can_send(at, st, send_bus)
    else:
      other_panda.can_send(at, st, send_bus)
    time.sleep(0.1)
    # check for receive
    if direction:
      _ = black_panda.can_recv()  # can echo
      cans_loop = other_panda.can_recv()
    else:
      _ = other_panda.can_recv()  # can echo
      cans_loop = black_panda.can_recv()
    loop_buses = []
    for loop in cans_loop:
      if (loop[0] != at) or (loop[2] != st):
        content_errors += 1
      print("  Loop on bus", str(loop[3]))
      loop_buses.append(loop[3])
    if len(cans_loop) == 0:
      print("  No loop")
      assert not os.getenv("NOASSERT")
    # test loop buses
    recv_buses.sort()
    loop_buses.sort()
    if(recv_buses != loop_buses):
      if len(loop_buses) == 0:
        zero_bus_errors += 1
      else:
        nonzero_bus_errors += 1
      assert not os.getenv("NOASSERT")
    else:
      print("  TEST PASSED")
    time.sleep(sleep_duration)
  print("\n")