From dcda86427b11f51ee3d850a32dd873259af4650c Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Sat, 10 Mar 2007 16:17:19 +0000
Subject: [PATCH] 1. fix problem in stop target 2. fix problem in uninstall in case STAF has been installed from tar 3. changed wait time for wipeout target to allow a minute between stop and uninsatll 4. made changes to allow to install more than one service 5. added event, eventmanager and email services 6. added more comments in the configuration 7. each service runs in its own jvm 8. fall back to STAF 3.2.0.1 on solaris x86 because of issue 1677664 (STAF installer looks for windows dll on solaris x86) 9. fixed config issue with root DN (should not be quoted in the config) 10. added properties file to avoid installer stating that solaris is not a supported platform 11. changed root DN to cn=myself
---
opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS.properties | 0
opendj-sdk/opends/tests/functional-tests/staf-installer.xml | 98 ++++++++++++++++++++++++++------
opendj-sdk/opends/tests/functional-tests/staf-installer/functional-tests.cfg | 47 ++++++++++++---
opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS-x86.properties | 3
opendj-sdk/opends/tests/functional-tests/staf-installer/staf-installer.properties | 5 +
5 files changed, 124 insertions(+), 29 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
index 13038a4..d1f1279 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
@@ -144,15 +144,21 @@
<property name="bits.staf.downloaded" value="true"/>
</target>
- <target name="download-do-get-stax" unless="bits.stax.downloaded.before">
+ <target name="download-do-get-services" unless="bits.services.downloaded.before">
+ <get src="${bits.download.url}/${bits.email.archive}"
+ dest="${bits.download.dir}/${bits.email.archive}" />
+ <get src="${bits.download.url}/${bits.event.archive}"
+ dest="${bits.download.dir}/${bits.event.archive}" />
+ <get src="${bits.download.url}/${bits.eventmanager.archive}"
+ dest="${bits.download.dir}/${bits.eventmanager.archive}" />
<get src="${bits.download.url}/${bits.stax.archive}"
dest="${bits.download.dir}/${bits.stax.archive}" />
- <property name="bits.stax.downloaded" value="true" />
+ <property name="bits.services.downloaded" value="true" />
</target>
<target name="download-do"
if="platform.supported"
- depends="status-do,download-do-prepare,download-do-get-staf,download-do-get-stax">
+ depends="status-do,download-do-prepare,download-do-get-staf,download-do-get-services">
<condition property="bits.all.downloaded" >
<and>
<or>
@@ -160,8 +166,8 @@
<isset property="bits.staf.downloaded.before" />
</or>
<or>
- <isset property="bits.stax.downloaded"/>
- <isset property="bits.stax.downloaded.before" />
+ <isset property="bits.services.downloaded"/>
+ <isset property="bits.services.downloaded.before" />
</or>
</and>
</condition>
@@ -182,8 +188,7 @@
<get src="${daily.package.url}"
dest="${daily.package}"/>
</target>
-
- <!-- Downloader section - bottom -->
+<!-- Downloader section - bottom -->
<!-- Installation section - top -->
<target name="install-config" if="staf.install.successful">
@@ -194,7 +199,16 @@
</copy>
</target>
- <target name="install-stax" if="staf.install.successful">
+ <target name="install-services" if="staf.install.successful">
+ <unzip
+ src="${bits.download.dir}/${bits.email.archive}"
+ dest="${staf.install.dir}/services"/>
+ <unzip
+ src="${bits.download.dir}/${bits.event.archive}"
+ dest="${staf.install.dir}/services"/>
+ <unzip
+ src="${bits.download.dir}/${bits.eventmanager.archive}"
+ dest="${staf.install.dir}/services"/>
<unzip
src="${bits.download.dir}/${bits.stax.archive}"
dest="${staf.install.dir}/services"/>
@@ -250,7 +264,7 @@
<target name="install"
description="Perform framework installation"
- depends="status-do,install-prepare,install-staf,install-stax,install-config"
+ depends="status-do,install-prepare,install-staf,install-services,install-config"
if="bits.all.downloaded"/>
<!-- Installation section - bottom -->
@@ -274,9 +288,31 @@
</exec>
</target>
<!-- Gui section - bottom -->
+<!-- Jvmlog section - top -->
+ <target name="jvm-log"
+ depends="status-do"
+ description="brings up the jvmlog gui" >
+
+ <exec
+ dir="${staf.install.dir}"
+ executable="${java.home}/bin/java"
+ ><!--
+ spawn="true">
+ -->
+ <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
+ <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
+ <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
+ <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+ <env key="STAFCODEPAGE" value="LATIN_1"/>
+ <arg value="-classpath"/>
+ <arg value="${staf.lib.dir}${path.separator}${staf.lib.dir}/JSTAF.jar"/>
+ <arg value="com.ibm.staf.STAFJVMLogViewer"/>
+ </exec>
+ </target>
+<!-- Jvmlog section - bottom -->
+
<!-- Run tests section - top -->
-
<target name="get-pkg">
<condition property="product.package.dir"
value="${daily.package.dir}"
@@ -411,7 +447,9 @@
<copy todir="${tests.run.dir}/${tests.run.time}/staf-logs">
<fileset dir="${staf.home}/logs"/>
</copy>
+ <!--
<delete dir="${staf.home}/logs" />
+ -->
<echo>Saving report</echo>
<copy todir="${tests.run.dir}/${tests.run.time}/report">
<fileset dir="${staf.tmp.dir}">
@@ -461,9 +499,9 @@
<!-- Run tests section - bottom -->
<!-- Uninstallation section - top -->
- <target name="uninstall-do"
+ <target name="uninstall-do-jar"
description="Uninstall the staf"
- if="staf.installed" >
+ if="staf.install.is.jar">
<echo message="Uninstalling staf, please wait..." />
<java jar="${staf.install.dir}/_uninst/uninstall.jar" fork="true">
<arg value="-silent" />
@@ -471,8 +509,26 @@
<sleep seconds="5" />
<delete dir="${staf.install.dir}" />
</target>
+ <target name="uninstall-do-tar"
+ description="Uninstall the staf"
+ if="staf.install.is.tar">
+ <echo message="Uninstalling staf, please wait..." />
+ <exec executable="${staf.install.dir}/STAFUninst"/>
+ <sleep seconds="5" />
+ <delete dir="${staf.install.dir}" />
+ </target>
-
+ <target name="uninstall-do" if="staf.installed">
+ <condition property="staf.install.is.jar">
+ <available file="${staf.install.dir}/_uninst/uninstall.jar"/>
+ </condition>
+ <condition property="staf.install.is.tar">
+ <available file="${staf.install.dir}/STAFUninst"/>
+ <!-- TODO - check on windows if there is a .exe extension -->
+ </condition>
+ <antcall target="uninstall-do-jar"/>
+ <antcall target="uninstall-do-tar"/>
+ </target>
<target name="uninstall-dont-not-installed" unless="staf.installed">
<echo>Staf is not installed.</echo>
</target>
@@ -520,8 +576,13 @@
<target name="stop-do" if="staf.running">
<echo>Stopping staf...</echo>
<exec
- executable="${staf.executable}"
- spawn="true" >
+ executable="${staf.executable}"
+ >
+ <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
+ <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
+ <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
+ <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+ <env key="STAFCODEPAGE" value="LATIN_1"/>
<arg line="local shutdown shutdown"/>
</exec>
<echo>staf has been instructed to close the shop.</echo>
@@ -577,13 +638,13 @@
<condition property="bits.staf.downloaded.before">
<available file="${bits.download.dir}/${bits.staf.archive}"/>
</condition>
- <condition property="bits.stax.downloaded.before" >
+ <condition property="bits.services.downloaded.before" >
<available file="${bits.download.dir}/${bits.stax.archive}" />
</condition>
<condition property="bits.all.downloaded.before">
<and>
<isset property="bits.staf.downloaded.before"/>
- <isset property="bits.stax.downloaded.before"/>
+ <isset property="bits.services.downloaded.before"/>
</and>
</condition>
<available file="${daily.package}" property="daily.package.downloaded"/>
@@ -667,7 +728,8 @@
<target name="wipeout">
<antcall target="stop"/>
- <sleep seconds="10"/>
+ <echo>Allow a minute for STAF to bring all the JVMs down</echo>
+ <sleep seconds="60"/>
<antcall target="uninstall"/>
</target>
<!-- Macros section - bottom -->
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS-x86.properties b/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS-x86.properties
index c490b91..0b9476c 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS-x86.properties
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS-x86.properties
@@ -1 +1,2 @@
-bits.staf.archive=STAF321-setup-solaris-x86.jar
+#bits.staf.archive=STAF321-setup-solaris-x86.jar
+bits.staf.archive=STAF3201-solaris-x86.tar.gz
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS.properties b/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer/SunOS.properties
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer/functional-tests.cfg b/opendj-sdk/opends/tests/functional-tests/staf-installer/functional-tests.cfg
index b945a34..e2d9805 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer/functional-tests.cfg
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer/functional-tests.cfg
@@ -6,17 +6,46 @@
# Set default local trust
trust machine local://local level 5
+trust level 5 machine tcp://localhost
+# this is required for the Zip Service to be able to expand archives
+trust level 5 user anonymous
# Default Service Loader Service
serviceloader library STAFDSLS
-SERVICE STAX LIBRARY JSTAF EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar \
- OPTION JVMName=JVMSTAX \
- OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension} \
- OPTION J2=-Xmx384m
-SERVICE EVENT LIBRARY JSTAF EXECUTE {STAF/Config/STAFRoot}/services/stax/STAFEvent.jar \
- OPTION JVMName=JVMSTAXEVENT \
+
+# LOG SERVICE CONFIGURATION
+SERVICE Log LIBRARY STAFLog \
+ PARMS "Directory {STAF/Config/STAFRoot}/../logs ResolveMessage"
+
+# ZIP SERVICE CONFIGURATION
+SERVICE Zip LIBRARY STAFZip
+
+# EVENT SERVICE CONFIGURATION
+# PARMS "MAXATTEMPTS 5 ACKNOWLEDGETIMEOUT 30000" \
+SERVICE Event LIBRARY JSTAF \
+ EXECUTE {STAF/Config/STAFRoot}/services/event/STAFEvent.jar \
+ OPTION JVMName=EventJVM \
OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
+
+# EVENTMANAGER SERVICE CONFIGURATION
+# PARMS "EVENTSERVICENAME=EVENT" \
+SERVICE EventManager LIBRARY JSTAF \
+ EXECUTE {STAF/Config/STAFRoot}/services/eventmanager/STAFEventManager.jar \
+ OPTION JVMName=EventManagerJVM \
+ OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
+
+# STAX SERVICE CONFIGURATION
+SERVICE Stax LIBRARY JSTAF \
+ EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar \
+ OPTION JVMName=StaxJVM \
+ OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension} \
+ OPTION J2=-Xmx384m
+
+#EMAIL SERVICE CONFIGURATION
+#SERVICE Email LIBRARY JSTAF \
+# EXECUTE {STAF/Config/STAFRoot}/services/email/STAFEmail.jar \
+# OPTION JVMName=EmailJVM \
+# OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
+
SET MAXQUEUESIZE 10000
-trust level 5 machine tcp://localhost
-trust level 5 user anonymous
-service log library STAFLog parms "Directory {STAF/Config/STAFRoot}/../logs ResolveMessage"
+
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer/staf-installer.properties b/opendj-sdk/opends/tests/functional-tests/staf-installer/staf-installer.properties
index 3f29087..ae599f9 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer/staf-installer.properties
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer/staf-installer.properties
@@ -29,13 +29,16 @@
opends.port.ldap=1389
opends.port.ldaps=1636
opends.port.jmx=1689
-opends.admin.dn="cn=Directory Manager"
+opends.admin.dn=cn=myself
opends.admin.pwd=password
# Downloader section - top
## where to download the staf bits before install
bits.download.dir=${staf.home}${file.separator}staf-bits
bits.download.url=http://superb-west.dl.sourceforge.net/sourceforge/staf
+bits.email.archive=EmailV320.zip
+bits.event.archive=EventV310.zip
+bits.eventmanager.archive=EventManagerV321.zip
bits.stax.archive=STAXV315.zip
# Downloader section - bottom
--
Gitblit v1.10.0