From 40463de64286e6643e6ddffe9b1a65fa04be0e8d Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Mon, 17 Jul 2006 19:34:52 +0000
Subject: [PATCH] Added the ability for the integration test suite to make the directory that is specified for the log files. That directory is specified in the testng.xml file and can be modified by the user.
---
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java | 2 +-
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java | 21 ++++++++++++++++++---
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh | 10 ++++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java
index 399046b..5e1fbcd 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java
+++ b/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("*********************************************");
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
index f09ef0f..c3de9a8 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
+++ b/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;
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh
new file mode 100755
index 0000000..4ad9827
--- /dev/null
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+LOGDIR=$1
+if [ -d "${LOGDIR}" ]
+then
+ echo "${LOGDIR} currently exists"
+else
+ mkdir -p ${LOGDIR}
+ echo "${LOGDIR} created"
+fi
+
--
Gitblit v1.10.0