From 52b368135ed5498e047731c030debf3cb5ae7099 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Tue, 28 Jan 2014 10:27:42 +0000
Subject: [PATCH] Fixed python exception in fractional-replication testsuite

---
 opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml |  101 ++++++++++++++++++++++++++++++--------------------
 opends/tests/staf-tests/functional-tests/testcases/pta/basic/pta_basic_tests.xml    |    2 
 2 files changed, 62 insertions(+), 41 deletions(-)

diff --git a/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml b/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
index e09ef64..891eb1c 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/fractional-replication/basic.xml
@@ -194,8 +194,15 @@
               "replicationDomainSuffix" : replDomainSuffix,
             }
           </call>
-          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
-            <call function="'testPassed'"/>
+          <if expr="STAXResult[1] != None">
+            <sequence>
+              <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
+                <call function="'testPassed'"/>
+                <else>
+                  <call function="'testFailed'"/>
+                </else>
+              </if>
+            </sequence>
             <else>
               <call function="'testFailed'"/>
             </else>
@@ -277,8 +284,15 @@
               "replicationDomainSuffix" : replDomainSuffix,
             }
           </call>
-          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
-            <call function="'testPassed'"/>
+          <if expr="STAXResult[1] != None">
+            <sequence>
+              <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
+                <call function="'testPassed'"/>
+                <else>
+                  <call function="'testFailed'"/>
+                </else>
+              </if>
+            </sequence>
             <else>
               <call function="'testFailed'"/>
             </else>
@@ -488,45 +502,52 @@
               "replicationDomainSuffix" : replDomainSuffix,
             }
           </call>
-          <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
+          <if expr="STAXResult[1] != None">
             <sequence>
-              <call function="'testFailed'"/>
-              <break/>
+              <if expr="len(STAXResult) == 3 and STAXResult[1].find('Bad generation id') != -1">
+                <sequence>
+                  <call function="'testFailed'"/>
+                  <break/>
+                </sequence>
+                <else>
+                  <sequence>
+                  <!-- Check some data was imported into Directory Server -->
+                    <call function="'checkImport'">
+                      { 'location'            : Pservers[0].getHostname(),
+                        'dsPath'              : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
+                        'dsHost'              : Pservers[0].getHostname(),
+                        'dsAdminPort'         : Pservers[0].getAdminPort(),
+                        'dsPort'              : Pservers[0].getPort(),
+                        'dsDn'                : Pservers[0].getRootDn(),
+                        'dsPswd'              : Pservers[0].getRootPwd(),
+                        'startDS'             : 'no',
+                        'expectedEntries'     : ['uid=user.0,ou=masterOnlineImport,o=example',
+                                                 'uid=user.2,ou=masterOnlineImport,o=example',
+                                                 'uid=user.4,ou=masterOnlineImport,o=example'
+                                                ],
+                      }
+                    </call>
+                    <call function="'checkImport'">
+                      { 'location'            : Pservers[1].getHostname(),
+                        'dsPath'              : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
+                        'dsHost'              : Pservers[1].getHostname(),
+                        'dsAdminPort'         : Pservers[1].getAdminPort(),
+                        'dsPort'              : Pservers[1].getPort(),
+                        'dsDn'                : Pservers[1].getRootDn(),
+                        'dsPswd'              : Pservers[1].getRootPwd(),
+                        'startDS'             : 'no',
+                        'expectedEntries'     : ['uid=user.0,ou=masterOnlineImport,o=example',
+                                                 'uid=user.2,ou=masterOnlineImport,o=example',
+                                                 'uid=user.4,ou=masterOnlineImport,o=example'
+                                                ],
+                      }
+                    </call>
+                   </sequence>
+                </else>
+              </if>
             </sequence>
             <else>
-              <sequence>
-              <!-- Check some data was imported into Directory Server -->
-                <call function="'checkImport'">
-                  { 'location'            : Pservers[0].getHostname(),
-                    'dsPath'              : '%s/%s' % (Pservers[0].getDir(),OPENDSNAME),
-                    'dsHost'              : Pservers[0].getHostname(),
-                    'dsAdminPort'         : Pservers[0].getAdminPort(),
-                    'dsPort'              : Pservers[0].getPort(),
-                    'dsDn'                : Pservers[0].getRootDn(),
-                    'dsPswd'              : Pservers[0].getRootPwd(),
-                    'startDS'             : 'no',
-                    'expectedEntries'     : ['uid=user.0,ou=masterOnlineImport,o=example',
-                                             'uid=user.2,ou=masterOnlineImport,o=example',
-                                             'uid=user.4,ou=masterOnlineImport,o=example'
-                                            ],
-                  }
-                </call>
-                <call function="'checkImport'">
-                  { 'location'            : Pservers[1].getHostname(),
-                    'dsPath'              : '%s/%s' % (Pservers[1].getDir(),OPENDSNAME),
-                    'dsHost'              : Pservers[1].getHostname(),
-                    'dsAdminPort'         : Pservers[1].getAdminPort(),
-                    'dsPort'              : Pservers[1].getPort(),
-                    'dsDn'                : Pservers[1].getRootDn(),
-                    'dsPswd'              : Pservers[1].getRootPwd(),
-                    'startDS'             : 'no',
-                    'expectedEntries'     : ['uid=user.0,ou=masterOnlineImport,o=example',
-                                             'uid=user.2,ou=masterOnlineImport,o=example',
-                                             'uid=user.4,ou=masterOnlineImport,o=example'
-                                            ],
-                  }
-                </call>
-               </sequence>
+              <call function="'testFailed'"/>
             </else>
           </if>
           <call function="'ldapsearchVerifyFrac'">
diff --git a/opends/tests/staf-tests/functional-tests/testcases/pta/basic/pta_basic_tests.xml b/opends/tests/staf-tests/functional-tests/testcases/pta/basic/pta_basic_tests.xml
index fd13c94..f0777a7 100755
--- a/opends/tests/staf-tests/functional-tests/testcases/pta/basic/pta_basic_tests.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/pta/basic/pta_basic_tests.xml
@@ -1141,7 +1141,7 @@
             <if expr="not is_windows_platform(STAF_REMOTE_HOSTNAME)">
               <!-- Unix -->
               <script>
-                ttl = 10
+                ttl = 30
               </script>
               <else>
                 <!-- Windows -->

--
Gitblit v1.10.0