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

Christophe Sovant
13.46.2013 ffb90539ab2527ab4063edcff0a69ef1bbde41d5
Add capability for debugging tests
14 files modified
109 ■■■■ changed files
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_common_ecl_tests.xml 5 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_consistency_tests.xml 5 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog_consistency/externalchangelog_consistency_tests.xml 5 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover_tests.xml 23 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml 2 ●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/totalupdate/totalupdate_tests.xml 12 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/ant/build.properties 3 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/dsadm.xml 17 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/tools.xml 10 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/functions/topology.xml 8 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/python/replication.py 11 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/tests/config.py.stubs 1 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/topology/3server_topology.txt 4 ●●●● patch | view | raw | blame | history
opends/tests/staf-tests/shared/topology/basic_topology.txt 3 ●●●●● patch | view | raw | blame | history
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_common_ecl_tests.xml
@@ -106,8 +106,9 @@
    
          <!-- Start the Directory Server -->
          <call function="'StartDsWithScript'">
            { 'location'  : masterHost,
              'dsPath'    : masterPath
            { 'location'    : masterHost,
              'dsPath'      : masterPath,
              'dsDebugPort' : master.getDebugPort()
            }
          </call>
    
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog/externalchangelog_consistency_tests.xml
@@ -93,8 +93,9 @@
      
            <!-- Start the Directory Server -->
            <call function="'StartDsWithScript'">
              { 'location'  : masterHost,
                'dsPath'    : masterPath
              { 'location'    : masterHost,
                'dsPath'      : masterPath,
                'dsDebugPort' : master.getDebugPort()
              }
            </call>
      
opends/tests/staf-tests/functional-tests/testcases/replication/externalchangelog_consistency/externalchangelog_consistency_tests.xml
@@ -93,8 +93,9 @@
      
            <!-- Start the Directory Server -->
            <call function="'StartDsWithScript'">
              { 'location'  : masterHost,
                'dsPath'    : masterPath
              { 'location'    : masterHost,
                'dsPath'      : masterPath,
                'dsDebugPort' : master.getDebugPort()
              }
            </call>
      
opends/tests/staf-tests/functional-tests/testcases/replication/failover/failover_tests.xml
@@ -23,7 +23,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2007-2010 Sun Microsystems, Inc.
 !      Portions Copyright 2011-2012 ForgeRock AS.
 !      Portions Copyright 2011-2013 ForgeRock AS.
 ! -->
<stax>
@@ -82,8 +82,9 @@
    
            <!-- Start the Directory Server -->
            <call function="'StartDsWithScript'">
              { 'location'  : masterHost,
                'dsPath'    : masterPath
              { 'location'    : masterHost,
                'dsPath'      : masterPath,
                'dsDebugPort' : master.getDebugPort()
              }
            </call>
                
@@ -226,14 +227,16 @@
                                                                              
                <!-- Start the server again -->
                <call function="'StartDsWithScript'">
                  { 'location'  :  server.getHostname(),
                    'dsPath'    :  serverPath
                  { 'location'    :  server.getHostname(),
                    'dsPath'      :  serverPath,
                    'dsDebugPort' :  server.getDebugPort()
                  }
                </call>
                <if expr="globalSplitServers">
                  <call function="'StartDsWithScript'">
                    { 'location'    :  replServer.getHostname(),
                      'dsPath'      :  replServerPath
                      'dsPath'      :  replServerPath,
                      'dsDebugPort' :  replServer.getDebugPort()
                    }
                  </call>
                </if>
@@ -451,14 +454,16 @@
                                                                              
                <!-- Start the server again -->
                <call function="'StartDsWithScript'">
                  { 'location'  :  server.getHostname(),
                    'dsPath'    :  serverPath
                  { 'location'    :  server.getHostname(),
                    'dsPath'      :  serverPath,
                    'dsDebugPort' :  server.getDebugPort()
                  }
                </call>
                <if expr="globalSplitServers">
                  <call function="'StartDsWithScript'">
                    { 'location'    :  replServer.getHostname(),
                      'dsPath'      :  replServerPath
                      'dsPath'      :  replServerPath,
                      'dsDebugPort' :  replServer.getDebugPort()
                    }
                  </call>
                </if>
opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml
@@ -61,9 +61,9 @@
              suiteList.append('encryption')
              suiteList.append('changelog')
              suiteList.append('conflict')
              suiteList.append('aci')
              suiteList.append('externalchangelog')
              suiteList.append('externalchangelog_consistency')
              suiteList.append('aci')
              
              globalAssuredReplication = None
              
opends/tests/staf-tests/functional-tests/testcases/replication/totalupdate/totalupdate_tests.xml
@@ -23,7 +23,7 @@
 ! CDDL HEADER END
 !
 !      Copyright 2007-2010 Sun Microsystems, Inc.
 !      Portions Copyright 2012 ForgeRock AS.
 !      Portions Copyright 2012-2013 ForgeRock AS.
 ! -->
<stax>
          
@@ -86,8 +86,9 @@
            
            <!-- Start the Directory Server -->
            <call function="'StartDsWithScript'">
              { 'location'  : masterHost,
                'dsPath'    : masterPath
              { 'location'    : masterHost,
                'dsPath'      : masterPath,
                'dsDebugPort' : master.getDebugPort()
              }
            </call>
            
@@ -447,8 +448,9 @@
            <!-- Start the Directory Server -->
            <call function="'StartDsWithScript'">
              { 'location'  : masterHost,
                'dsPath'    : masterPath
              { 'location'    : masterHost,
                'dsPath'      : masterPath,
                'dsDebugPort' : master.getDebugPort()
              }
            </call>
            
opends/tests/staf-tests/shared/ant/build.properties
@@ -112,9 +112,10 @@
sdk.dir=
temp.dir=/tmp
test.plan.custom=
test.plan.functional.default=aci,backends,clu,clu_secure,core,dsconfig,dsml,fractional-replication,groups,i18n,indexes,logging,monitoring,password_policy,plugins,privileges,pta,replication,schema,security,setup,snmp,tasks,virtualAttributes,replication-safe-data,replication-safe-read
test.plan.functional.default=aci,backends,clu,clu_secure,connection_handlers,core,dsconfig,dsml,fractional-replication,groups,i18n,indexes,logging,monitoring,password_policy,plugins,privileges,pta,replication,schema,security,setup,snmp,tasks,virtualAttributes,replication-safe-data,replication-safe-read
test.plan.stress.default=import_ldif,operations,replication
verbose.mode=false
debug.port=
product.name=OpenDJ
logs.uri=file://
opends/tests/staf-tests/shared/functions/dsadm.xml
@@ -589,6 +589,12 @@
        </function-arg-description>
        <function-arg-property name="type" value="option"/>
      </function-arg-def>
      <function-arg-def name="dsDebugPort" type="optional" default="DEBUG_PORT">
        <function-arg-description>
          Directory Server debug port
        </function-arg-description>
        <function-arg-property name="type" value="Port number"/>
      </function-arg-def>
      <function-arg-def name="expectedRC" type="optional" default="0">
        <function-arg-description>
          Expected return code value. Default value is 0.
@@ -710,6 +716,14 @@
        </sequence>
      </if>
      <message>'DEBUG PORT: %s' % dsDebugPort</message>
      <script>
        if dsDebugPort != '' and STAFCmdParams == '':
          envCmd = [ 'OPENDJ_JAVA_ARGS=-agentlib:jdwp=transport=dt_socket,address=%s,server=y,suspend=y' % dsDebugPort ]
        else:
          envCmd = []
      </script>
      <call function="'runCommand'">
        { 'location'  : location,
@@ -717,7 +731,8 @@
          'arguments' : STAFCmdParams,
          'location'  : location,
          'expectedRC': expectedRC,
          'knownIssue': knownIssue
          'knownIssue': knownIssue,
          'envCmd'    : envCmd
        }
      </call>
      <return>STAXResult</return>
opends/tests/staf-tests/shared/functions/tools.xml
@@ -1079,8 +1079,9 @@
              
              <!--- Start DS -->                 
              <call function="'StartDsWithScript'">
                { 'location' : server.getHostname(),
                  'dsPath'   : '%s/%s' % (server.getDir(),OPENDSNAME)
                { 'location'    : server.getHostname(),
                  'dsPath'      : '%s/%s' % (server.getDir(),OPENDSNAME),
                  'dsDebugPort' : server.getDebugPort()
                }
              </call>
              
@@ -1110,8 +1111,9 @@
                
                <!--- Start DS -->                 
                <call function="'StartDsWithScript'">
                  { 'location' : server.getHostname(),
                    'dsPath'   : '%s/%s' % (server.getDir(),OPENDSNAME)
                  { 'location'    : server.getHostname(),
                    'dsPath'      : '%s/%s' % (server.getDir(),OPENDSNAME),
                    'dsDebugPort' : server.getDebugPort()
                  }
                </call>
                
opends/tests/staf-tests/shared/functions/topology.xml
@@ -1492,6 +1492,7 @@
        rootPwd = None
        baseDn = None
        changelogport = None
        debugPort = None
        suffixList = []
        changelogList = []
        serverId = 1
@@ -1521,13 +1522,15 @@
            baseDn = line[line.find('BaseDn') + 7:].strip()
          elif line.find('Changelogport') != -1:
            changelogport = line[line.find('Changelogport') + 14:].strip()
          elif line.find('Debugport') != -1:
            debugPort = line[line.find('Debugport') + 10:].strip()
          elif line.find('SynchronizedSuffix') != -1:
            suffixList.append( line[line.find('SynchronizedSuffix') + 19:].strip() )
          elif line.find('ChangelogServer') != -1:
            changelogList.append( line[line.find('ChangelogServer') + 16:].strip() )
          elif (line.isspace()) or (len(line) == 0):
            server = Server(hostname, dir, port, adminport, sslport, jmxport,
                            rootDn, rootPwd, baseDn, remote.data)
                            rootDn, rootPwd, baseDn, debugPort, remote.data)
            
            if changelogport != None:
              changelogServer = ChangelogServer(changelogport, serverId)
@@ -1557,13 +1560,14 @@
            rootPwd = None
            baseDn = None
            changelogport = None
            debugPort = None
            suffixList = []
            changelogList = []
            serverId += 1
        
        if hostname != None:
          server = Server(hostname, dir, port, adminport, sslport, jmxport,
                          rootDn, rootPwd, baseDn, remote.data)
                          rootDn, rootPwd, baseDn, debugPort, remote.data)
          
          if changelogport != None:
            changelogServer = ChangelogServer(changelogport, serverId)
opends/tests/staf-tests/shared/python/replication.py
@@ -76,7 +76,7 @@
        
# Define Server class
class Server:
  def __init__(self, hostname, dir, port, adminPort, sslPort, jmxPort, rootDn, rootPwd, baseDn, datadir):
  def __init__(self, hostname, dir, port, adminPort, sslPort, jmxPort, rootDn, rootPwd, baseDn, debugPort, datadir):
    self.hostname = hostname
    self.dir = dir
    self.temp = '%s/temp' % dir
@@ -92,6 +92,7 @@
    self.rootPwd = rootPwd
    self.baseDn = baseDn
    self.changelogServer = None
    self.debugPort = debugPort
    self.synchronizedSuffixList = []
  def __repr__(self):
@@ -139,6 +140,9 @@
  def getChangelogServer(self):
    return self.changelogServer
  def getDebugPort(self):
    return self.debugPort
  def getSynchronizedSuffixList(self):
    return self.synchronizedSuffixList
    
@@ -161,11 +165,12 @@
    new_rootDn = self.rootDn
    new_rootPwd = self.rootPwd
    new_baseDn = self.baseDn
    new_changelogServer = self.changelogServer
    new_changelogServer = self.changelogServer
    new_debugPort = self.debugPort
    self.changelogServer = None
    
    replServer = Server(new_hostname, new_dir, new_port, new_adminPort, new_sslPort,
                        new_jmxPort, new_rootDn, new_rootPwd, new_baseDn, self.data)
                        new_jmxPort, new_rootDn, new_rootPwd, new_baseDn, self.debugPort, self.data)
    replServer.addChangelogServer(new_changelogServer)
    return replServer
opends/tests/staf-tests/shared/tests/config.py.stubs
@@ -82,6 +82,7 @@
SNMP_OPENDMK_JARFILE          = '${snmp.opendmk.lib.dir}/jdmkrt.jar'
SNMP_PORT                     = '8085'
SNMP_TRAP_PORT                = '8086'
DEBUG_PORT                    = '${debug.port}'
LDCLT_DIR                     = '${ldclt.dir}'
VERBOSE_MODE                  = '${verbose.mode}'
TEST_PLAN_CUSTOM              = '${test.plan.custom}'
opends/tests/staf-tests/shared/topology/3server_topology.txt
@@ -21,6 +21,7 @@
#
#
#      Copyright 2007-2009 Sun Microsystems, Inc.
#      Portions Copyright 2013 Forgerock AS
#
Hostname: ${remote.hostname}
Directory: ${tests.tmp.dir}/opends-synchro-tests/server1
@@ -32,6 +33,7 @@
RootPwd: secret12
BaseDn: o=example
Changelogport: 11112
#Debugport: 8081
SynchronizedSuffix: o=example
ChangelogServer: ${remote.hostname}:11112
ChangelogServer: ${remote.hostname}:22222
@@ -47,6 +49,7 @@
RootPwd: secret12
BaseDn: o=example
Changelogport: 22222
#Debugport: 8082
SynchronizedSuffix: o=example
ChangelogServer: ${remote.hostname}:11112
ChangelogServer: ${remote.hostname}:22222
@@ -62,6 +65,7 @@
RootPwd: secret12
BaseDn: o=example
Changelogport: 33333
#Debugport: 8083
SynchronizedSuffix: o=example
ChangelogServer: ${remote.hostname}:11112
ChangelogServer: ${remote.hostname}:22222
opends/tests/staf-tests/shared/topology/basic_topology.txt
@@ -21,6 +21,7 @@
#
#
#      Copyright 2007-2009 Sun Microsystems, Inc.
#      Portions Copyright 2013 Forgerock AS
#
Hostname: ${remote.hostname}
Directory: ${tests.tmp.dir}/opends-synchro-tests/server1
@@ -32,6 +33,7 @@
RootPwd: secret12
BaseDn: o=example
Changelogport: 11112
#Debugport: 8081
SynchronizedSuffix: o=example
ChangelogServer: ${remote.hostname}:11112
ChangelogServer: ${remote.hostname}:22222
@@ -46,6 +48,7 @@
RootPwd: secret12
BaseDn: o=example
Changelogport: 22222
#Debugport: 8082
SynchronizedSuffix: o=example
ChangelogServer: ${remote.hostname}:11112
ChangelogServer: ${remote.hostname}:22222