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

Christophe Sovant
27.06.2013 f9118f488ab38c05b4a3738a10e00720d96f7600
Added retries on manage-tasks tool to avoid random test failure
4 files modified
443 ■■■■ changed files
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml 177 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml 105 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml 97 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml 64 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml
@@ -103,6 +103,11 @@
                'backEnd'             : DIRECTORY_INSTANCE_BE}
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -117,22 +122,42 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-backup-1',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'recurring-backup-1',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <call function="'Sleep'">
                { 'sleepForMilliSeconds'  :  120000 }
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -147,24 +172,43 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-backup-1',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'recurring-backup-1',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Completed successfully',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Completed successfully',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <!-- cancel the recurring task recurring-backup-1 with manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -180,10 +224,9 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Task recurring-backup-1 canceled',
                'expectedResult'       : '1' }
              <call function="'searchString'">
                { 'expectedString' : 'Task recurring-backup-1 canceled',
                  'returnString'   : returnString }
              </call>
  
              <call function="'testCase_Postamble'"/>
@@ -224,7 +267,8 @@
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'LOOP %s' % loop</message>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
                  <!-- manage-tasks -->
                  <call function="'manage-tasks'">
                    { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -308,7 +352,8 @@
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'LOOP %s' % loop</message>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
                  <!-- manage-tasks -->
                  <call function="'manage-tasks'">
                    { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -456,10 +501,10 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-backup-1',
                'expectedResult'       : '0' }
              <call function="'searchString'">
                { 'expectedString' : 'recurring-backup-1',
                  'returnString'   : returnString ,
                  'expectedRC'     : 1 }
              </call>
  
              <call function="'backup'">
@@ -474,6 +519,11 @@
                'backEnd'             : DIRECTORY_INSTANCE_BE}
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -488,22 +538,42 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-backup-1',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'recurring-backup-1',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <call function="'Sleep'">
                { 'sleepForMilliSeconds'  :  120000 }
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -518,18 +588,33 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-backup-1',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'recurring-backup-1',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Completed successfully',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Completed successfully',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <call function="'StopDsWithScript'">
                { 'location'  : STAF_REMOTE_HOSTNAME,
                'dsHost'      : DIRECTORY_INSTANCE_HOST,
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml
@@ -24,7 +24,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2007-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2011 ForgeRock AS.
 !      Portions Copyright 2011-2013 ForgeRock AS.
! -->
<stax>
  <defaultcall function="export-ldif"/>
@@ -86,7 +86,8 @@
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'LOOP %s' % loop</message>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
                  <!-- manage-tasks -->
                  <call function="'manage-tasks'">
                    {'location'      : STAF_REMOTE_HOSTNAME,
@@ -171,7 +172,8 @@
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'LOOP %s' % loop</message>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
                  <!-- manage-tasks -->
                  <call function="'manage-tasks'">
                    { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -317,6 +319,11 @@
                'backEnd'             : DIRECTORY_INSTANCE_BE}
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -331,22 +338,42 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'ExportTask-',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'ExportTask-',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <call function="'Sleep'">
                { 'sleepForMilliSeconds'  :  120000 }
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -361,24 +388,43 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'ExportTask-*',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'ExportTask-*',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Completed successfully',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Completed successfully',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <!-- cancel the recurring task ExportTask-* with manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -394,16 +440,9 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Task ExportTask-',
                'expectedResult'       : '1' }
              </call>
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'canceled',
                'expectedResult'       : '1' }
              <call function="'searchString'">
                { 'expectedString' : 'Task ExportTask-\* canceled',
                  'returnString'   : returnString }
              </call>
  
              <call function="'testCase_Postamble'"/>
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml
@@ -264,6 +264,11 @@
                'backEnd'             : DIRECTORY_INSTANCE_BE}
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -278,22 +283,42 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'ImportTask-',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'ImportTask-',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <call function="'Sleep'">
                { 'sleepForMilliSeconds'  :  120000 }
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -308,24 +333,43 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'ImportTask-*',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'ImportTask-*',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Completed successfully',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Completed successfully',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <!-- cancel the recurring task ExportTask-* with manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -341,16 +385,9 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Task ImportTask-',
                'expectedResult'       : '1' }
              </call>
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'canceled',
                'expectedResult'       : '1' }
              <call function="'searchString'">
                { 'expectedString' : 'Task ImportTask-\* canceled',
                  'returnString'   : returnString }
              </call>
  
              <call function="'testCase_Postamble'"/>
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
@@ -147,7 +147,7 @@
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'LOOP %s' % loop</message>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
                  <!-- manage-tasks -->
                  <call function="'manage-tasks'">
                    { 'location'       : STAF_REMOTE_HOSTNAME ,
@@ -297,16 +297,20 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-restore-1',
                'expectedResult'       : '1' }
              <call function="'searchString'">
                { 'expectedString' : 'recurring-restore-1',
                  'returnString'   : returnString }
              </call>
  
              <call function="'Sleep'">
                { 'sleepForMilliSeconds'  :  120000 }
              </call>
  
              <script>checkRC=9999</script>
              <loop from="1" to="10" var="loop" while="checkRC != 0">
                <sequence>
                  <message>'MANAGE-TASKS LOOP %s' % loop</message>
              <!-- manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -321,24 +325,43 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'recurring-restore-1',
                'expectedResult'       : '1' }
                  <call function="'searchString'">
                    { 'expectedString' : 'recurring-restore-1',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Completed successfully',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Completed successfully',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Waiting on start time',
                'expectedResult'       : '1' }
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'searchString'">
                    { 'expectedString' : 'Waiting on start time',
                      'returnString'   : returnString ,
                      'expectedRC'     : 'noCheck' }
              </call>
  
                  <script>
                    checkRC = checkRC + STAXResult[0]
                  </script>
                  <call function="'Sleep'">
                    { 'sleepForMilliSeconds'  : 2000 }
                  </call>
                </sequence>
              </loop>
              <!-- cancel the recurring task recurring-restore-1 with manage-tasks -->
              <call function="'manage-tasks'">
                { 'location'     : STAF_REMOTE_HOSTNAME ,
@@ -354,10 +377,9 @@
                returnString = STAXResult[0][1]
              </script>
  
              <call function="'searchStringForSubstring'">
                { 'returnString'       : returnString,
                'testString'       : 'Task recurring-restore-1 canceled',
                'expectedResult'       : '1' }
              <call function="'searchString'">
                { 'expectedString' : 'Task recurring-restore-1 canceled',
                  'returnString'   : returnString }
              </call>
  
              <call function="'testCase_Postamble'"/>