integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void verifyServersReady(int maxIterations) throws Exception {
    // check admin pod
    LoggerHelper.getLocal().log(Level.INFO, "Checking if admin server is Running and Ready");
    TestUtils.checkPodReady(domainUid + "-" + adminServerName, domainNS, maxIterations);

    if (!serverStartPolicy.equals("ADMIN_ONLY")) {
      // check managed server pods
      for (int i = 1; i <= initialManagedServerReplicas; i++) {
        LoggerHelper.getLocal().log(Level.INFO,
            "Checking if managed server (" + managedServerNameBase + i + ") is Running and Ready");
        TestUtils.checkPodReady(domainUid + "-" + managedServerNameBase + i, domainNS, maxIterations);
      }
    } else {
      // check no additional servers are started
      initialManagedServerReplicas = 0;
    }
    String additionalManagedServer =
        domainUid + "-" + managedServerNameBase + (initialManagedServerReplicas + 1);
    LoggerHelper.getLocal().log(Level.INFO,
        "Checking if managed server " + additionalManagedServer + " is started, it should not be");
    StringBuffer cmd = new StringBuffer();
    cmd.append("kubectl get pod ").append(additionalManagedServer).append(" -n ").append(domainNS);
    ExecResult result = ExecCommand.exec(cmd.toString());

    if (result.exitValue() == 0 && result.stdout().contains("1/1")) {
      throw new RuntimeException(
          "FAILURE: Managed Server "
              + additionalManagedServer
              + " is started, but its not expected.");
    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          additionalManagedServer + " is not running, which is expected behaviour");
    }

    // check logs are written on PV if logHomeOnPV is true for domain-home-in-image case
    if ((domainMap.containsKey("domainHomeImageBase")
        && domainMap.containsKey("logHomeOnPV")
        && (new Boolean(domainMap.get("logHomeOnPV").toString())).booleanValue())) {
      LoggerHelper.getLocal().log(Level.INFO,
          "logHomeOnPV is true, checking if logs are written on PV");
      cmd = new StringBuffer();
      cmd.append("kubectl -n ")
          .append(domainNS)
          .append(" exec -it ")
          .append(domainUid)
          .append("-")
          .append(adminServerName)
          .append(" -- ls /shared/logs/")
          .append(domainUid)
          .append("/")
          .append(adminServerName)
          .append(".log");

      result = ExecCommand.exec(cmd.toString());

      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: logHomeOnPV is true, but logs are not written at /shared/logs/"
                + domainUid
                + " inside the pod");
      } else {
        LoggerHelper.getLocal().log(Level.INFO,
            "Logs are written at /shared/logs/" + domainUid + " inside the pod");
      }
    }
  }
/**
   * Verify servers are ready.
   * 
   * @param maxIterations max iterations count
   *
   * @throws RuntimeException if WLS pod is not ready and pod output doesn't contain 1/1
   */
Verify servers are ready.

@param maxIterations max iterations count

@throws RuntimeException if WLS pod is not ready and pod output doesn't contain 1/1
Verify servers are ready . @param maxIterations max iterations count @throws RuntimeException if WLS pod is not ready and pod output doesn ' t contain 1 / 1
public void verifyServersReady(int maxIterations) throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Checking if admin server is Running and Ready");
    TestUtils.checkPodReady(domainUid + "-" + adminServerName, domainNS, maxIterations);
    if (!serverStartPolicy.equals("ADMIN_ONLY")) {
      for (int i = 1; i <= initialManagedServerReplicas; i++) {
        LoggerHelper.getLocal().log(Level.INFO,
            "Checking if managed server (" + managedServerNameBase + i + ") is Running and Ready");
        TestUtils.checkPodReady(domainUid + "-" + managedServerNameBase + i, domainNS, maxIterations);
      }
    } else {
      initialManagedServerReplicas = 0;
    }
    String additionalManagedServer =
        domainUid + "-" + managedServerNameBase + (initialManagedServerReplicas + 1);
    LoggerHelper.getLocal().log(Level.INFO,
        "Checking if managed server " + additionalManagedServer + " is started, it should not be");
    StringBuffer cmd = new StringBuffer();
    cmd.append("kubectl get pod ").append(additionalManagedServer).append(" -n ").append(domainNS);
    ExecResult result = ExecCommand.exec(cmd.toString());
    if (result.exitValue() == 0 && result.stdout().contains("1/1")) {
      throw new RuntimeException(
          "FAILURE: Managed Server "
              + additionalManagedServer
              + " is started, but its not expected.");
    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          additionalManagedServer + " is not running, which is expected behaviour");
    }
    if ((domainMap.containsKey("domainHomeImageBase")
        && domainMap.containsKey("logHomeOnPV")
        && (new Boolean(domainMap.get("logHomeOnPV").toString())).booleanValue())) {
      LoggerHelper.getLocal().log(Level.INFO,
          "logHomeOnPV is true, checking if logs are written on PV");
      cmd = new StringBuffer();
      cmd.append("kubectl -n ")
          .append(domainNS)
          .append(" exec -it ")
          .append(domainUid)
          .append("-")
          .append(adminServerName)
          .append(" -- ls /shared/logs/")
          .append(domainUid)
          .append("/")
          .append(adminServerName)
          .append(".log");
      result = ExecCommand.exec(cmd.toString());
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: logHomeOnPV is true, but logs are not written at /shared/logs/"
                + domainUid
                + " inside the pod");
      } else {
        LoggerHelper.getLocal().log(Level.INFO,
            "Logs are written at /shared/logs/" + domainUid + " inside the pod");
      }
    }
  }
public void verifyServersReady ( int maxIterations ) throws Exception { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking if admin server is Running and Ready" ) ; TestUtils . checkPodReady ( domainUid + "-" + adminServerName , domainNS , maxIterations ) ; if ( ! serverStartPolicy . equals ( "ADMIN_ONLY" ) ) { for ( int i = 1 ; i <= initialManagedServerReplicas ; i ++ ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking if managed server (" + managedServerNameBase + i + ") is Running and Ready" ) ; TestUtils . checkPodReady ( domainUid + "-" + managedServerNameBase + i , domainNS , maxIterations ) ; } } else { initialManagedServerReplicas = 0 ; } String additionalManagedServer = domainUid + "-" + managedServerNameBase + ( initialManagedServerReplicas + 1 ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking if managed server " + additionalManagedServer + " is started, it should not be" ) ; StringBuffer cmd = new StringBuffer ( ) ; cmd . append ( "kubectl get pod " ) . append ( additionalManagedServer ) . append ( " -n " ) . append ( domainNS ) ; ExecResult result = ExecCommand . exec ( cmd . toString ( ) ) ; if ( result . exitValue ( ) == 0 && result . stdout ( ) . contains ( "1/1" ) ) { throw new RuntimeException ( "FAILURE: Managed Server " + additionalManagedServer + " is started, but its not expected." ) ; } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , additionalManagedServer + " is not running, which is expected behaviour" ) ; } if ( ( domainMap . containsKey ( "domainHomeImageBase" ) && domainMap . containsKey ( "logHomeOnPV" ) && ( new Boolean ( domainMap . get ( "logHomeOnPV" ) . toString ( ) ) ) . booleanValue ( ) ) ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "logHomeOnPV is true, checking if logs are written on PV" ) ; cmd = new StringBuffer ( ) ; cmd . append ( "kubectl -n " ) . append ( domainNS ) . append ( " exec -it " ) . append ( domainUid ) . append ( "-" ) . append ( adminServerName ) . append ( " -- ls /shared/logs/" ) . append ( domainUid ) . append ( "/" ) . append ( adminServerName ) . append ( ".log" ) ; result = ExecCommand . exec ( cmd . toString ( ) ) ; if ( result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: logHomeOnPV is true, but logs are not written at /shared/logs/" + domainUid + " inside the pod" ) ; } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Logs are written at /shared/logs/" + domainUid + " inside the pod" ) ; } } }
Verify servers are ready.
Verify servers are ready .
// check admin pod // check managed server pods // check no additional servers are started // check logs are written on PV if logHomeOnPV is true for domain-home-in-image case