From 0f80df022b442be9d2a60055f8d11e363b298ef8 Mon Sep 17 00:00:00 2001
From: Gary Williams <gary.williams@forgerock.com>
Date: Wed, 07 Mar 2012 15:33:15 +0000
Subject: [PATCH] Fix functional tests due to fallout from issue OPENDJ-438, plus others ..

---
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup/backup_tests.xml        |    2 
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/setup/ports.xml                         |    2 
 opendj-sdk/opends/tests/staf-tests/shared/python/common.py                                            |    7 +++
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml |   23 -----------
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml  |   46 +---------------------
 opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/basic/snmp_basic.xml               |    3 +
 6 files changed, 14 insertions(+), 69 deletions(-)

diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup/backup_tests.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup/backup_tests.xml
index bebfc14..3454050 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup/backup_tests.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup/backup_tests.xml
@@ -499,7 +499,7 @@
           <call function="'checktestString'">
             {
              'returnString'     : returnString ,
-             'expectedString'   : 'A full backup will be executed'
+             'expectedString'   : 'The backup process completed successfully'
             }
           </call>
 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
index 12bfecc..f0ab5e2 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Portions Copyright 2008-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2012 ForgeRock AS
  ! -->
 <stax>
   
@@ -447,28 +448,6 @@
                   }
                 </call>
 
-                <script>
-                  msg1 = 'Statistics for records that have'
-                  msg2 = 'exceeded the entry limit:'
-                </script>
-                <call function="'checktestString'">
-                  {
-                  'returnString'   : returnString ,
-                  'expectedString' : '%s %s' % (msg1, msg2)
-                  }
-                </call>
-
-                <script>
-                  msg1 = 'File dc_com_st.equality has 51 such record\(s\)'
-                  msg2 = 'min=14 max=31 median=20'
-                </script>
-                <call function="'checktestString'">
-                  {
-                  'returnString'   : returnString ,
-                  'expectedString' : '%s %s' % (msg1, msg2)
-                  }
-                </call>
-
                 <message>
                   'rebuild-index: rebuild index st'
                 </message>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
index 87b22a8..d7b3620 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
@@ -24,6 +24,7 @@
  ! CDDL HEADER END
  !
  !      Portions Copyright 2008-2010 Sun Microsystems, Inc.
+ !      Portions Copyright 2012 ForgeRock AS
  ! -->
 <stax>
   
@@ -243,50 +244,9 @@
                 <call function="'checktestString'">
                   { 
                   'returnString'   : returnString ,
-                  'expectedString' : 'Checked 1000 records and found 0 error' ,
-                  'issue'          : '6926830'
+                  'expectedString' : 'Checked 1000 records and found 0 error'
                   }
-                </call>
-  
-                <script>
-                  msg = 'Number of records referencing more than one entry: 10' 
-                </script>
-                <call function="'checktestString'">
-                  { 
-                  'returnString'   : returnString ,
-                  'expectedString' : msg
-                  }
-                </call>
-  
-                <script>
-                  msg = 'Number of records that exceed the entry limit: 0' 
-                </script>              
-                <call function="'checktestString'">
-                  { 
-                  'returnString'   : returnString ,
-                  'expectedString' : msg
-                  }
-                </call>
-  
-                <script>
-                  msg = 'Average number of entries referenced is 1.04/record' 
-                </script>              
-                <call function="'checktestString'">
-                  { 
-                  'returnString'   : returnString ,
-                  'expectedString' : msg
-                  }
-                </call>
-  
-                <script>
-                  msg = 'Maximum number of entries referenced by any record is 5' 
-                </script>              
-                <call function="'checktestString'">
-                  { 
-                  'returnString'   : returnString ,
-                  'expectedString' : msg
-                  }
-                </call>          
+                </call>         
   
                 <call function="'testCase_Postamble'"/>
                 
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/setup/ports.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/setup/ports.xml
index 6c8a7ac..570faf3 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/setup/ports.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/setup/ports.xml
@@ -443,7 +443,7 @@
           <!-- This testcase is not relevant on Windows or as root user -->
           <script>
             from java.lang import System
-            if is_windows_platform(STAF_REMOTE_HOSTNAME) or System.getProperty("user.name") == "root":
+            if is_windows_platform(STAF_REMOTE_HOSTNAME) or get_system_uid() == "root":
               skip=1
             else:
               skip=0
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/basic/snmp_basic.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/basic/snmp_basic.xml
index 3c00346..c404036 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/basic/snmp_basic.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/basic/snmp_basic.xml
@@ -129,7 +129,8 @@
                   testsList.append('snmp_basic_014')
                   testsList.append('snmp_basic_015')
                   testsList.append('snmp_basic_016')
-                  testsList.append('snmp_basic_017')
+                  if get_system_uid() is not "root":
+                    testsList.append('snmp_basic_017')
                 </script>
 
                 <!-- Execute the Tests -->
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
index 2c3299d..4a54c8e 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
+++ b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
@@ -56,7 +56,8 @@
             "count_attr" ,
             "host_is_localhost" ,
             "md5_hash" ,
-            "value_not_string"
+            "value_not_string" ,
+            "get_system_uid"
             ]
 
 class format_testcase:
@@ -876,3 +877,7 @@
   else:
     return 0
 
+def get_system_uid():
+  from java.lang import System
+  return System.getProperty("user.name")
+

--
Gitblit v1.10.0