def run_cmd()

in helix-core/src/main/scripts/integration-test/script/dds_driver.py [0:0]


def run_cmd():
    if (options.component=="bootstrap_dbreset"): setup_rmi("stop")
    if (not options.operation): options.operation="default"
    if (not options.testname):
      options.testname = "TEST_NAME" in os.environ and os.environ["TEST_NAME"] or "default"
    if (options.operation not in cmd_dict[options.component]):
      my_error("%s is not one of the command for %s. Valid values are %s " % (options.operation, options.component, cmd_dict[options.component].keys()))
    # handle the different connetion string for hudson
    if (options.component=="db_relay" and options.db_config_file):
       options.db_config_file = db_config_change(options.db_config_file)
    if (options.component=="test_bootstrap_producer" and options.operation=="lock_tab"):
      producer_lock_tab("save_file")
    cmd = cmd_dict[options.component][options.operation]
    # cmd can be a funciton call
    if isinstance(cmd, list):
      if not callable(cmd[0]): my_error("First element should be function")
      cmd[0](*tuple(cmd[1:]))        # call the function
      return
    if options.enable_direct_java_call: cmd = run_cmd_direct_java_call(cmd, options.component)
    if remote_run: run_cmd_remote_setup()
    if options.ant_debug: cmd = run_cmd_add_ant_debug(cmd) # need ant debug call or not
    cmd = run_cmd_add_config(cmd) # handle config file
    if remote_run: cmd = run_cmd_remote(cmd)
    ret_pattern = run_cmd_get_return_pattern()
    if options.restart: cmd = run_cmd_restart(cmd)
    cmd = run_cmd_add_log_file(cmd)
    if is_starting_component(): run_cmd_save_cmd(cmd)
    ret = cmd_call(cmd, options.timeout, ret_pattern, get_outf())
    if options.operation == "stop": time.sleep(0.1)
    return ret