private void sortFiles(String in, String out) throws Exception {
    int result =
        executeCmd(new String[] { "sort", getQuotedString(in), }, out, null).getReturnCode();
    if (result != 0) {
      throw new IllegalStateException("Unexpected error while sorting " + in);
    }
  }
Operations present in a given file/test.
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestResultProcessor.java