private void testOutput(
      String cmd, String suffix, ProcessBuilder builder, String output, String os)
      throws IOException {
    builder.redirectErrorStream(true);
    Process startProcess = builder.start();
    BufferedReader startReader =
        new BufferedReader(new InputStreamReader(startProcess.getInputStream()));
    List<String> runtimeOuput = new ArrayList<>();
    String line;
    try {
      while (true) {
        line = startReader.readLine();
        if (line == null) {
          break;
        }
        runtimeOuput.add(line);
      }
      assertEquals(output, runtimeOuput.get(runtimeOuput.size() - 1));
    } finally {
      startReader.close();
      startProcess.destroy();
      runtimeOuput.clear();
    }
  }
This test case is strange that it relies on the maven output files
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java