integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static ExecResult execOrAbortProcess(String cmd, boolean debug) throws Exception {
    ExecResult result = ExecCommand.exec(cmd);
    if (result.exitValue() != 0 || debug) {
      LoggerHelper.getLocal().log(Level.INFO,
          "\nCommand "
              + cmd
              + "\nreturn value: "
              + result.exitValue()
              + "\nstderr = "
              + result.stderr()
              + "\nstdout = "
              + result.stdout());
    }
    if (result.exitValue() != 0) {
      throw new RuntimeException(
          "FAILURE: Command "
              + cmd
              + " failed with stderr = "
              + result.stderr()
              + " \n stdout = "
              + result.stdout());
    }

    return result;
  }
/**
   * exec command.
   * @param cmd command
   * @param debug debug flag
   * @return executor
   * @throws Exception on failure
   */
exec command.
@param cmd command
@param debug debug flag
@return executor
@throws Exception on failure
exec command . @param cmd command @param debug debug flag @return executor @throws Exception on failure
public static ExecResult execOrAbortProcess(String cmd, boolean debug) throws Exception {
    ExecResult result = ExecCommand.exec(cmd);
    if (result.exitValue() != 0 || debug) {
      LoggerHelper.getLocal().log(Level.INFO,
          "\nCommand "
              + cmd
              + "\nreturn value: "
              + result.exitValue()
              + "\nstderr = "
              + result.stderr()
              + "\nstdout = "
              + result.stdout());
    }
    if (result.exitValue() != 0) {
      throw new RuntimeException(
          "FAILURE: Command "
              + cmd
              + " failed with stderr = "
              + result.stderr()
              + " \n stdout = "
              + result.stdout());
    }
    return result;
  }
public static ExecResult execOrAbortProcess ( String cmd , boolean debug ) throws Exception { ExecResult result = ExecCommand . exec ( cmd ) ; if ( result . exitValue ( ) != 0 || debug ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "\nCommand " + cmd + "\nreturn value: " + result . exitValue ( ) + "\nstderr = " + result . stderr ( ) + "\nstdout = " + result . stdout ( ) ) ; } if ( result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: Command " + cmd + " failed with stderr = " + result . stderr ( ) + " \n stdout = " + result . stdout ( ) ) ; } return result ; }
exec command.
exec command .