Improve shared and functional tests, as well as code coverage.
| | |
| | | if WC_TYPE == 'tomcat': |
| | | destWebXml = os.path.join(WC_DIRECTORY, 'apache-%s-%s' % (WC_TYPE, WC_VERSION), 'webapps', |
| | | 'dsml', 'WEB-INF', 'web.xml') |
| | | destEmmaProp = os.path.join(WC_DIRECTORY, 'apache-%s-%s' % (WC_TYPE, WC_VERSION), 'webapps', |
| | | 'dsml', 'WEB-INF', 'classes', 'emma.properties') |
| | | elif WC_TYPE == 'glassfish': |
| | | destWebXml = os.path.join(WC_DIRECTORY, 'glassfishv3', 'glassfish', |
| | | 'domains', 'domain1', 'applications', |
| | | 'dsml', 'WEB-INF', 'web.xml') |
| | | destEmmaProp = os.path.join(WC_DIRECTORY, 'glassfishv3', 'glassfish', |
| | | 'domains', 'domain1', 'applications', |
| | | 'dsml', 'WEB-INF', 'classes', 'emma.properties') |
| | | elif WC_TYPE == 'sunwebserver': |
| | | destWebXml = os.path.join(WC_DIRECTORY, '%s-%s' % (WC_TYPE, WC_VERSION), 'https-%s' % STAF_REMOTE_HOSTNAME, |
| | | 'generated', STAF_REMOTE_HOSTNAME, 'dsml', 'WEB-INF', 'web.xml') |
| | | destEmmaProp = os.path.join(WC_DIRECTORY, '%s-%s' % (WC_TYPE, WC_VERSION), 'https-%s' % STAF_REMOTE_HOSTNAME, |
| | | 'generated', STAF_REMOTE_HOSTNAME, 'dsml', 'WEB-INF', 'classes', 'emma.properties') |
| | | |
| | | nbLoop = 10 |
| | | loopSleep = 1000 # 1000 millisecondes |
| | |
| | | 'result' : STAXResult |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | ecPath = os.path.join(remote.temp,'coverage',CurrentTestPath['group'],'coverage_dsml.ec') |
| | | |
| | | coveragefh = open( '%s/emma_dsml.properties' % local.temp, 'w') |
| | | coveragefh.write( 'coverage.out.file=%s\n' % ecPath ) |
| | | coveragefh.write( 'verbosity.level=silent\n') |
| | | coveragefh.write( 'coverage.out.merge=true\n') |
| | | coveragefh.close() |
| | | </script> |
| | | |
| | | <message> |
| | | 'PATH ORIG %s/emma_dsml.properties' % local.temp |
| | | </message> |
| | | <message> |
| | | 'PATH DEST %s' % destEmmaProp |
| | | </message> |
| | | <call function="'copyFile'"> |
| | | { 'location' : STAXServiceMachine, |
| | | 'remotehost' : '%s' % STAF_REMOTE_HOSTNAME, |
| | | 'srcfile' : '%s/emma_dsml.properties' % local.temp, |
| | | 'destfile' : destEmmaProp |
| | | } |
| | | </call> |
| | | <call function="'checktestRC'"> |
| | | { |
| | | 'returncode' : RC , |
| | | 'result' : STAXResult |
| | | } |
| | | </call> |
| | | |
| | | <call function="'stopWebcontainerWithScript'"/> |
| | | <call function="'startWebcontainerWithScript'"/> |
| | | </sequence> |
| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2008-2009 Sun Microsystems, Inc. |
| | | ! Copyright 2008-2010 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | |
| | | </call> |
| | | |
| | | <script> |
| | | nb = len(STAFResult) |
| | | ct = (STAFResult[0] == 'lib') |
| | | res = STAFResult |
| | | if 'coverage.ec' in res: |
| | | res.remove('coverage.ec') |
| | | |
| | | nb = len(res) |
| | | ct = (res[0] == 'lib') |
| | | a = ' ' |
| | | </script> |
| | | |
| | |
| | | |
| | | <java classpath="${temp.dir}/coverage-instr/dsml/WEB-INF/lib/emma.jar" |
| | | classname="emma" fork="true"> |
| | | <jvmarg value="-Demma.metadata.out.file=${temp.dir}/coverage-instr/dsml/WEB-INF/lib/coverage.em" /> |
| | | <jvmarg value="-Demma.metadata.out.file=${temp.dir}/coverage-instr/opends/${opends.name}/coverage.em" /> |
| | | <arg value="instr" /> |
| | | <arg value="-merge" /> |
| | | <arg value="yes" /> |
| | | <arg value="-m" /> |
| | | <arg value="overwrite" /> |
| | | <arg value="-ix" /> |
| | |
| | | <matches string="${product.name}" pattern="^OpenDS ."/> |
| | | <then> |
| | | <!-- The war file is not in the opends archive, so we need to repackage the war file --> |
| | | <zip basedir="${temp.dir}/coverage-instr/dsml" destfile="${opends.dir}/${opends.name}-DSML.war"> |
| | | <zipfileset dir="${temp.dir}/coverage-instr/dsml" |
| | | includes="WEB-INF/**,META-INF/**"/> |
| | | </zip> |
| | | <zip basedir="${temp.dir}/coverage-instr/dsml" destfile="${opends.dir}/${opends.name}-DSML.war"/> |
| | | </then> |
| | | <else> |
| | | <!-- The war file is in the opends archive, so we need to replace the war file --> |
| | | <delete file="${temp.dir}/coverage-instr/opends/${opends.name}/addons/DSML.war"/> |
| | | <zip basedir="${temp.dir}/coverage-instr/dsml" destfile="${temp.dir}/coverage-instr/opends/${opends.name}/addons/DSML.war"> |
| | | <zipfileset dir="${temp.dir}/coverage-instr/dsml" |
| | | includes="WEB-INF/**,META-INF/**"/> |
| | | </zip> |
| | | <zip basedir="${temp.dir}/coverage-instr/dsml" destfile="${temp.dir}/coverage-instr/opends/${opends.name}/addons/DSML.war"/> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Repackage OpenDS the product with coverage enabled scripts --> |
| | | <zip basedir="${temp.dir}/coverage-instr/opends" destfile="${opends.dir}/${opends.name}.zip"> |
| | | <zip basedir="${temp.dir}/coverage-instr/opends" |
| | | destfile="${opends.dir}/${opends.name}.zip" |
| | | excludes="${opends.name}/setup,${opends.name}/uninstall,${opends.name}/upgrade,${opends.name}/bin/*,${opends.name}/lib/*.sh"> |
| | | <zipfileset dir="${temp.dir}/coverage-instr/opends" |
| | | includes="${opends.name}/setup,${opends.name}/uninstall,${opends.name}/upgrade,${opends.name}/bin/*,${opends.name}/lib/*.sh" |
| | | filemode="755" dirmode="755" /> |
| | |
| | | </script> |
| | | |
| | | <call function="'createFolder'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | { 'location' : STAXServiceMachine, |
| | | 'foldername' : resultsCoveragePath |
| | | } |
| | | </call> |
| | | <call function="'createFolder'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'foldername' : resultsPath |
| | | } |
| | | </call> |
| | | <call function="'createFolder'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'foldername' : remoteCoveragePath |
| | | } |
| | | </call> |
| | |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | | <!-- Check if 'emma.jar' exists --> |
| | | <call function="'GetEntry'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'entry' : '%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) , |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | <if expr="RC != 48"> |
| | | <!-- 'emma.jar' exists --> |
| | | <script> |
| | | emma_jarfile='%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) |
| | | </script> |
| | | <else> |
| | | <script> |
| | | emma_jarfile=None |
| | | </script> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Build the command --> |
| | | <script> |
| | | STAFCmdParamsList=[] |
| | |
| | | snmpPath='%s/snmp' % remote.java |
| | | jdmk_jarfile='%s/jdmkrt.jar' % snmpPath |
| | | |
| | | emma_jarfile='%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) |
| | | if os.path.exists(emma_jarfile): |
| | | if emma_jarfile: |
| | | cp = 'CLASSPATH=%s%s%s%s%s%s.' \ |
| | | % (opends_jarfile,separator,jdmk_jarfile,separator,emma_jarfile,separator) |
| | | else: |
| | |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | | <!-- Check if 'emma.jar' exists --> |
| | | <call function="'GetEntry'"> |
| | | { |
| | | 'location' : STAF_REMOTE_HOSTNAME , |
| | | 'entry' : '%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) , |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | <if expr="RC != 48"> |
| | | <!-- 'emma.jar' exists --> |
| | | <script> |
| | | emma_jarfile='%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) |
| | | </script> |
| | | <else> |
| | | <script> |
| | | emma_jarfile=None |
| | | </script> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Build the command --> |
| | | <script> |
| | | STAFCmdParamsList=[] |
| | |
| | | snmpPath='%s/snmp' % remote.java |
| | | jdmk_jarfile='%s/jdmkrt.jar' % snmpPath |
| | | |
| | | emma_jarfile='%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) |
| | | if os.path.exists(emma_jarfile): |
| | | if emma_jarfile: |
| | | cp = 'CLASSPATH=%s%s%s%s%s%s.' \ |
| | | % (opends_jarfile,separator,jdmk_jarfile,separator,emma_jarfile,separator) |
| | | else: |
| | |
| | | } |
| | | </call> |
| | | |
| | | <!--- Install DS Copy zip file --> |
| | | <!-- Check if DS Copy zip exists --> |
| | | <call function="'GetEntry'"> |
| | | { |
| | | 'location' : dsHost, |
| | | 'entry' : '%s/%s' % (dsDir,ZIPNAME), |
| | | 'attribute' : 'TYPE' |
| | | } |
| | | </call> |
| | | <if expr="RC == 48"> |
| | | <sequence> |
| | | <!--- Copy DS Copy zip file --> |
| | | <message> |
| | | 'Copy DS zip archive %s/%s to %s' % (local.temp,ZIPNAME,dsHost) |
| | | 'Copy DS zip archive %s/%s to %s' % (ZIPPATH,ZIPNAME,dsHost) |
| | | </message> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME), |
| | |
| | | 'remotehost' : dsHost |
| | | } |
| | | </call> |
| | | </sequence> |
| | | <else> |
| | | <message> |
| | | 'DS zip archive %s/%s already exists, nothing to do' % (dsDir,ZIPNAME) |
| | | </message> |
| | | </else> |
| | | </if> |
| | | |
| | | <!--- Install DS Extract zip file --> |
| | | <message> |
| | |
| | | 'filename' : '%s/testdata.zip' % dsDir |
| | | } |
| | | </call> |
| | | |
| | | <!--- Delete OPENDS zip file on remote host--> |
| | | <message> |
| | | 'Delete OPENDS zip file %s/%s' % (dsDir,ZIPNAME) |
| | | </message> |
| | | <call function="'deleteFile'"> |
| | | { 'location' : dsHost, |
| | | 'filename' : '%s/%s' % (dsDir,ZIPNAME) } |
| | | </call> |
| | | |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult |
| | | } |
| | | </call> |
| | | <if expr="returncode == 0"> |
| | | <message> |
| | | 'Instance removed.' |
| | | </message> |
| | | <else> |
| | | <message> |
| | | 'Failed to remove instance.' |
| | | </message> |
| | | </else> |
| | | </if> |
| | | </sequence> |
| | | </function> |
| | | |