mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

el_kaboing
17.34.2006 40463de64286e6643e6ddffe9b1a65fa04be0e8d
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java
@@ -45,7 +45,7 @@
 *  Setup for bob tests
*/
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd1" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd2" })
  public void testBobStartup1(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
@@ -43,17 +43,32 @@
/**
 *  Setup for quickstartadd tests
*/
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Parameters({ "integration_test_home", "logDir" })
  @Test
  public void testQuickstartAdd1(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  public void testQuickstartAdd1(String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
    System.out.println("QuickstartAdd test 1");
    String exec_cmd = integration_test_home + "/quickstart/checklogdir.sh " + logDir;
    Runtime rtime = Runtime.getRuntime();
    Process child = rtime.exec(exec_cmd);
    child.waitFor();
    compareExitCode(0, 0);
  }
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd1" })
  public void testQuickstartAdd2(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
    System.out.println("QuickstartAdd test 2");
    String datafile = integration_test_home + "/quickstart/data/quickstart.ldif";
    String quickstartadd_args[] = {"-a", "-h", hostname, "-p", port, "-D", bindDN, "-w", bindPW, "-f", datafile};
    ds_output.redirectOutput(logDir, "QuickstartAdd1.txt");
    ds_output.redirectOutput(logDir, "QuickstartAdd2.txt");
    int retCode = LDAPModify.mainModify(quickstartadd_args);
    ds_output.resetOutput();
    int expCode = 0;
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh
New file
@@ -0,0 +1,10 @@
#!/bin/sh
LOGDIR=$1
if [ -d "${LOGDIR}" ]
then
    echo "${LOGDIR} currently exists"
else
    mkdir -p ${LOGDIR}
    echo "${LOGDIR} created"
fi