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

gary_williams
08.27.2007 85cc36d8643b45d68314e6194313b1bb3b4c1cb9
quality Issue 1074 generate an email containing test report
2 files modified
45 ■■■■■ changed files
opends/tests/functional-tests/config/config.py 2 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/runTestJob.xml 43 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/config/config.py
@@ -26,3 +26,5 @@
DIRECTORY_INSTANCE_SFX  = 'dc=com'
STAGED_DATA_DIR         = '%s/functional-tests/shared/data' % DIRECTORY_INSTANCE_DIR
JAVA_HOME               = '/usr/jdk/jdk1.5.0_01'
SEND_MAIL_AFTER_TEST_RUN= 'FALSE'
SEND_MAIL_TO            = ' '
opends/tests/functional-tests/testcases/runTestJob.xml
@@ -300,6 +300,49 @@
        transformer.transform(source, result)      
      </script>
      <if expr="SEND_MAIL_AFTER_TEST_RUN == 'TRUE'">
        <sequence>
          <message>
            'Sending Email Test Report to %s.' % SEND_MAIL_TO
          </message>
          <script>
            MailToList= SEND_MAIL_TO.split(",")
            MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
            MailSendTo= ' '
          </script>
          <iterate var="Recipient" in="MailToList">
            <script>
             MailSendTo='to %s %s' % (Recipient,MailSendTo)
            </script>
          </iterate>
          <stafcmd name="'STAF Command: Send test report %s' % MailSendTo">
            <location>'%s' % STAF_LOCAL_HOSTNAME </location>
            <service>'email'</service>
            <request>
              'send %s contenttype "text/html" file %s subject "%s" noheader' % (MailSendTo,htmlfile,MailSubject)
            </request>
          </stafcmd>
          <if expr="RC != 0">
            <message log="1" level="'Error'">
              'Send test report failed. RC: %s STAFResult: %s' % (RC,STAFResult)
            </message>
          <else>
            <message>
              'Send test report successful. RC: %s' % (RC)
            </message>
          </else>
          </if>
        </sequence>
      </if>
    </sequence>
  </function>