integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java
public static void tearDown(String itClassName, String namespaceList) throws Exception {
    LoggerHelper.getLocal().info("+++++++++++++++++++++++++++++++++---------------------------------+");
    LoggerHelper.getLocal().info("BEGIN");
    LoggerHelper.getLocal().info("Run once");

    if (!namespaceList.trim().equals("")) {
      LoggerHelper.getLocal().log(
          Level.INFO,
          "TEARDOWN: Starting Test Run TearDown (state-dump)."
              + " Note that if the test failed previous to tearDown, "
              + " the error that caused the test failure may be reported "
              + "after the tearDown completes. Note that tearDown itself may report errors,"
              + " but this won't affect the outcome of the test results.");
      StringBuffer cmd = new StringBuffer("export RESULT_ROOT=");
      cmd.append(resultRootCommon).append(" && export PV_ROOT=")
          .append(pvRootCommon).append(" && export IT_CLASS=");
      cmd.append(itClassName)
          .append(" && export NAMESPACE_LIST=\"")
          .append(namespaceList)
          .append("\" && export JENKINS_RESULTS_DIR=${WORKSPACE}/logdir/${BUILD_TAG} && ")
          .append(getProjectRoot())
          .append("/integration-tests/src/test/resources/statedump.sh");
      LoggerHelper.getLocal().log(Level.INFO, "Running " + cmd);

      // renew lease before callin statedump.sh
      TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());

      ExecResult result = ExecCommand.exec(cmd.toString());
      if (result.exitValue() == 0) {
        LoggerHelper.getLocal().log(Level.INFO, "Executed statedump.sh "
            + result.stdout() + "\n" + result.stderr());
      } else {
        LoggerHelper.getLocal().log(Level.INFO, "Execution of statedump.sh failed, "
            + result.stderr() + "\n" + result.stdout());
      }
    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          "namespaceList is empty, skipping statedump");
    }
  }
/**
   * Calls statedump.sh which places k8s logs, descriptions, etc in directory
   * $RESULT_DIR/state-dump-logs and calls archive.sh on RESULT_DIR locally, and on PV_ROOT via a
   * job or pod. Also calls cleanup.sh which does a best-effort delete of acceptance test k8s
   * artifacts, the local test tmp directory, and the potentially remote domain pv directories.
   *
   * @param itClassName - IT class name to be used in the archive file name
   * @throws Exception when errors while running statedump.sh or cleanup.sh scripts or while
   *                   renewing the lease for shared cluster run
   */
Calls statedump.sh which places k8s logs, descriptions, etc in directory
$RESULT_DIR/state-dump-logs and calls archive.sh on RESULT_DIR locally, and on PV_ROOT via a
job or pod. Also calls cleanup.sh which does a best-effort delete of acceptance test k8s
artifacts, the local test tmp directory, and the potentially remote domain pv directories.

@param itClassName - IT class name to be used in the archive file name
@throws Exception when errors while running statedump.sh or cleanup.sh scripts or while
renewing the lease for shared cluster run
Calls statedump . sh which places k8s logs descriptions etc in directory $RESULT_DIR / state - dump - logs and calls archive . sh on RESULT_DIR locally and on PV_ROOT via a job or pod . Also calls cleanup . sh which does a best - effort delete of acceptance test k8s artifacts the local test tmp directory and the potentially remote domain pv directories . @param itClassName - IT class name to be used in the archive file name @throws Exception when errors while running statedump . sh or cleanup . sh scripts or while renewing the lease for shared cluster run
public static void tearDown(String itClassName, String namespaceList) throws Exception {
    LoggerHelper.getLocal().info("+++++++++++++++++++++++++++++++++---------------------------------+");
    LoggerHelper.getLocal().info("BEGIN");
    LoggerHelper.getLocal().info("Run once");
    if (!namespaceList.trim().equals("")) {
      LoggerHelper.getLocal().log(
          Level.INFO,
          "TEARDOWN: Starting Test Run TearDown (state-dump)."
              + " Note that if the test failed previous to tearDown, "
              + " the error that caused the test failure may be reported "
              + "after the tearDown completes. Note that tearDown itself may report errors,"
              + " but this won't affect the outcome of the test results.");
      StringBuffer cmd = new StringBuffer("export RESULT_ROOT=");
      cmd.append(resultRootCommon).append(" && export PV_ROOT=")
          .append(pvRootCommon).append(" && export IT_CLASS=");
      cmd.append(itClassName)
          .append(" && export NAMESPACE_LIST=\"")
          .append(namespaceList)
          .append("\" && export JENKINS_RESULTS_DIR=${WORKSPACE}/logdir/${BUILD_TAG} && ")
          .append(getProjectRoot())
          .append("/integration-tests/src/test/resources/statedump.sh");
      LoggerHelper.getLocal().log(Level.INFO, "Running " + cmd);
      TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
      ExecResult result = ExecCommand.exec(cmd.toString());
      if (result.exitValue() == 0) {
        LoggerHelper.getLocal().log(Level.INFO, "Executed statedump.sh "
            + result.stdout() + "\n" + result.stderr());
      } else {
        LoggerHelper.getLocal().log(Level.INFO, "Execution of statedump.sh failed, "
            + result.stderr() + "\n" + result.stdout());
      }
    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          "namespaceList is empty, skipping statedump");
    }
  }
public static void tearDown ( String itClassName , String namespaceList ) throws Exception { LoggerHelper . getLocal ( ) . info ( "+++++++++++++++++++++++++++++++++---------------------------------+" ) ; LoggerHelper . getLocal ( ) . info ( "BEGIN" ) ; LoggerHelper . getLocal ( ) . info ( "Run once" ) ; if ( ! namespaceList . trim ( ) . equals ( "" ) ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "TEARDOWN: Starting Test Run TearDown (state-dump)." + " Note that if the test failed previous to tearDown, " + " the error that caused the test failure may be reported " + "after the tearDown completes. Note that tearDown itself may report errors," + " but this won't affect the outcome of the test results." ) ; StringBuffer cmd = new StringBuffer ( "export RESULT_ROOT=" ) ; cmd . append ( resultRootCommon ) . append ( " && export PV_ROOT=" ) . append ( pvRootCommon ) . append ( " && export IT_CLASS=" ) ; cmd . append ( itClassName ) . append ( " && export NAMESPACE_LIST=\"" ) . append ( namespaceList ) . append ( "\" && export JENKINS_RESULTS_DIR=${WORKSPACE}/logdir/${BUILD_TAG} && " ) . append ( getProjectRoot ( ) ) . append ( "/integration-tests/src/test/resources/statedump.sh" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Running " + cmd ) ; TestUtils . renewK8sClusterLease ( getProjectRoot ( ) , getLeaseId ( ) ) ; ExecResult result = ExecCommand . exec ( cmd . toString ( ) ) ; if ( result . exitValue ( ) == 0 ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Executed statedump.sh " + result . stdout ( ) + "\n" + result . stderr ( ) ) ; } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Execution of statedump.sh failed, " + result . stderr ( ) + "\n" + result . stdout ( ) ) ; } } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "namespaceList is empty, skipping statedump" ) ; } }
Calls statedump.sh which places k8s logs, descriptions, etc in directory
 $RESULT_DIR/state-dump-logs and calls archive.sh on RESULT_DIR locally, and on PV_ROOT via a
 job or pod.
Calls statedump . sh which places k8s logs descriptions etc in directory $RESULT_DIR / state - dump - logs and calls archive . sh on RESULT_DIR locally and on PV_ROOT via a job or pod .
// renew lease before callin statedump.sh