integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static boolean checkPodContains(String cmd, String matchStr, String k8sObjName)
      throws Exception {
    ExecResult result = ExecCommand.exec(cmd);
    if (result.exitValue() != 0 || (result.exitValue() == 0 && !result.stdout().contains(matchStr))) {
      return false;
    } else {
      LoggerHelper.getLocal().log(Level.INFO, "Pod " + k8sObjName + " match found for " + matchStr);
      return true;
    }
  }
/**
   * Check if the pod output contains the specified string.
   *
   * @param cmd        command to execute
   * @param matchStr   matching string
   * @param k8sObjName pod Name
   * @return true for match else false
   * @throws Exception exception
   */
Check if the pod output contains the specified string.
Check if the pod output contains the specified string .
public static boolean checkPodContains(String cmd, String matchStr, String k8sObjName)
      throws Exception {
    ExecResult result = ExecCommand.exec(cmd);
    if (result.exitValue() != 0 || (result.exitValue() == 0 && !result.stdout().contains(matchStr))) {
      return false;
    } else {
      LoggerHelper.getLocal().log(Level.INFO, "Pod " + k8sObjName + " match found for " + matchStr);
      return true;
    }
  }
public static boolean checkPodContains ( String cmd , String matchStr , String k8sObjName ) throws Exception { ExecResult result = ExecCommand . exec ( cmd ) ; if ( result . exitValue ( ) != 0 || ( result . exitValue ( ) == 0 && ! result . stdout ( ) . contains ( matchStr ) ) ) { return false ; } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Pod " + k8sObjName + " match found for " + matchStr ) ; return true ; } }
Check if the pod output contains the specified string.
Check if the pod output contains the specified string .