private ProcessResults runCmd(String[] cmd, long secondsToWait)
            throws IOException, InterruptedException {
        LOG.info("Going to run: " + String.join(" ", cmd));
        Process proc = Runtime.getRuntime().exec(cmd);
        if (!proc.waitFor(Math.abs(secondsToWait), TimeUnit.SECONDS)) {
          throw new RuntimeException("Process " + cmd[0] + " failed to run in " + secondsToWait + " seconds");
        }
        BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        final StringBuilder lines = new StringBuilder();
        reader.lines().forEach(s -> lines.append(s).append('\n'));

        reader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
        final StringBuilder errLines = new StringBuilder();
        reader.lines().forEach(s -> errLines.append(s).append('\n'));
        LOG.info("Result lines#: {}(stdout);{}(stderr)",lines.length(), errLines.length());
        return new ProcessResults(lines.toString(), errLines.toString(), proc.exitValue());
    }
The class is in charge of connecting and populating dockerized databases for qtest.

The database should have at least one root user (admin/superuser) able to modify every aspect of the system. The user
either exists by default when the database starts or must created right after startup.
itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java