瀏覽代碼

Ticket 48984 - Add lib389 paths module

Bug Description:  Lib389 needs a way to determine paths for DS when on other
platforms, or prefixed installs. This consumes the new defaults.inf that was
added in #48983

Fix Description:  Use the new ds_paths apis from the instances. This fixes a
large number of tests that would fail on prefixed installs (ie /opt/dirsrv).
This means new tests should be more flexible and able to run on various
platforms. Additionally, we remove the installation prefix option, as it now
conflicts with the new paths module.

https://fedorahosted.org/389/ticket/48984

Author: wibrown

Review by: tbordaz, mreynolds (Thanks!)
William Brown 9 年之前
父節點
當前提交
da91421157
共有 49 個文件被更改,包括 55 次插入349 次删除
  1. 4 12
      dirsrvtests/tests/suites/basic/basic_test.py
  2. 1 7
      dirsrvtests/tests/suites/clu/clu_test.py
  3. 0 8
      dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py
  4. 7 5
      dirsrvtests/tests/suites/memory_leaks/range_search_test.py
  5. 0 8
      dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py
  6. 0 6
      dirsrvtests/tests/suites/schema/test_schema.py
  7. 0 12
      dirsrvtests/tests/tickets/finalizer.py
  8. 0 7
      dirsrvtests/tests/tickets/ticket47313_test.py
  9. 3 4
      dirsrvtests/tests/tickets/ticket47384_test.py
  10. 0 7
      dirsrvtests/tests/tickets/ticket47490_test.py
  11. 0 7
      dirsrvtests/tests/tickets/ticket47560_test.py
  12. 0 7
      dirsrvtests/tests/tickets/ticket47573_test.py
  13. 0 7
      dirsrvtests/tests/tickets/ticket47619_test.py
  14. 0 7
      dirsrvtests/tests/tickets/ticket47653_test.py
  15. 0 7
      dirsrvtests/tests/tickets/ticket47669_test.py
  16. 0 7
      dirsrvtests/tests/tickets/ticket47714_test.py
  17. 0 7
      dirsrvtests/tests/tickets/ticket47781_test.py
  18. 0 7
      dirsrvtests/tests/tickets/ticket47808_test.py
  19. 0 7
      dirsrvtests/tests/tickets/ticket47815_test.py
  20. 0 7
      dirsrvtests/tests/tickets/ticket47819_test.py
  21. 0 6
      dirsrvtests/tests/tickets/ticket47823_test.py
  22. 0 7
      dirsrvtests/tests/tickets/ticket47828_test.py
  23. 0 7
      dirsrvtests/tests/tickets/ticket47829_test.py
  24. 0 7
      dirsrvtests/tests/tickets/ticket47838_test.py
  25. 0 7
      dirsrvtests/tests/tickets/ticket47871_test.py
  26. 0 7
      dirsrvtests/tests/tickets/ticket47900_test.py
  27. 6 6
      dirsrvtests/tests/tickets/ticket47910_test.py
  28. 0 8
      dirsrvtests/tests/tickets/ticket47920_test.py
  29. 0 7
      dirsrvtests/tests/tickets/ticket47937_test.py
  30. 0 7
      dirsrvtests/tests/tickets/ticket47950_test.py
  31. 0 8
      dirsrvtests/tests/tickets/ticket47953_test.py
  32. 0 7
      dirsrvtests/tests/tickets/ticket47970_test.py
  33. 0 7
      dirsrvtests/tests/tickets/ticket47973_test.py
  34. 0 7
      dirsrvtests/tests/tickets/ticket47980_test.py
  35. 0 7
      dirsrvtests/tests/tickets/ticket47981_test.py
  36. 1 1
      dirsrvtests/tests/tickets/ticket48005_test.py
  37. 0 7
      dirsrvtests/tests/tickets/ticket48214_test.py
  38. 28 24
      dirsrvtests/tests/tickets/ticket48226_test.py
  39. 0 7
      dirsrvtests/tests/tickets/ticket48228_test.py
  40. 0 7
      dirsrvtests/tests/tickets/ticket48252_test.py
  41. 0 7
      dirsrvtests/tests/tickets/ticket48294_test.py
  42. 0 7
      dirsrvtests/tests/tickets/ticket48295_test.py
  43. 0 7
      dirsrvtests/tests/tickets/ticket48366_test.py
  44. 0 7
      dirsrvtests/tests/tickets/ticket48759_test.py
  45. 1 1
      dirsrvtests/tests/tickets/ticket48784_test.py
  46. 0 7
      dirsrvtests/tests/tickets/ticket48891_test.py
  47. 0 10
      dirsrvtests/tests/tickets/ticket48906_test.py
  48. 0 6
      dirsrvtests/tests/tickets/ticket548_test.py
  49. 4 0
      rpm/389-ds-base.spec.in

+ 4 - 12
dirsrvtests/tests/suites/basic/basic_test.py

@@ -24,8 +24,6 @@ from lib389.utils import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 # Globals
 USER1_DN = 'uid=user1,' + DEFAULT_SUFFIX
 USER2_DN = 'uid=user2,' + DEFAULT_SUFFIX
@@ -49,11 +47,6 @@ class TopologyStandalone(object):
 def topology(request):
     """This fixture is used to standalone topology for the 'module'."""
 
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance
@@ -688,10 +681,9 @@ def test_basic_ldapagent(topology, import_example_ldif):
 
     log.info('Running test_basic_ldapagent...')
 
-    var_dir = topology.standalone.prefix + '/var'
-    config_file = topology.standalone.prefix + '/etc/dirsrv/config/agent.conf'
-    cmd = 'sudo %s/ldap-agent %s' % (get_sbin_dir(prefix=topology.standalone.prefix),
-                                                  config_file)
+    var_dir = topology.standalone.get_local_state_dir()
+    config_file = os.path.join(topology.standalone.get_sysconf_dir(), 'dirsrv/config/agent.conf')
+    cmd = 'sudo %s %s' % (os.path.join(topology.standalone.get_sbin_dir(), 'ldap-agent'), config_file)
 
     agent_config_file = open(config_file, 'w')
     agent_config_file.write('agentx-master ' + var_dir + '/agentx/master\n')
@@ -701,7 +693,7 @@ def test_basic_ldapagent(topology, import_example_ldif):
 
     rc = os.system(cmd)
     if rc != 0:
-        log.fatal('test_basic_ldapagent: Failed to start snmp ldap agent: error %d' % rc)
+        log.fatal('test_basic_ldapagent: Failed to start snmp ldap agent %s: error %d' % (cmd, rc))
         assert False
 
     log.info('snmp ldap agent started')

+ 1 - 7
dirsrvtests/tests/suites/clu/clu_test.py

@@ -21,8 +21,6 @@ from lib389.utils import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation1_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -32,10 +30,6 @@ class TopologyStandalone(object):
 
 @pytest.fixture(scope="module")
 def topology(request):
-    global installation1_prefix
-    if installation1_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation1_prefix
-
     # Creating standalone instance ...
     standalone = DirSrv(verbose=False)
     args_instance[SER_HOST] = HOST_STANDALONE
@@ -72,7 +66,7 @@ def test_clu_pwdhash(topology):
 
     log.info('Running test_clu_pwdhash...')
 
-    cmd = 'pwdhash -s ssha testpassword'
+    cmd = '%s -s ssha testpassword' % os.path.join(topology.standalone.get_bin_dir(), 'pwdhash')
 
     p = os.popen(cmd)
     result = p.readline()

+ 0 - 8
dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py

@@ -28,9 +28,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
-
 class TopologyStandalone(object):
     def __init__(self, standalone):
         standalone.open()
@@ -48,11 +45,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 7 - 5
dirsrvtests/tests/suites/memory_leaks/range_search_test.py

@@ -56,8 +56,9 @@ def topology(request):
 
     def fin():
         standalone.delete()
-        sbin_dir = get_sbin_dir(prefix=standalone.prefix)
-        valgrind_disable(sbin_dir)
+        sbin_dir = standalone.get_sbin_dir()
+        if not standalone.has_asan():
+            valgrind_disable(sbin_dir)
     request.addfinalizer(fin)
 
     return TopologyStandalone(standalone)
@@ -81,7 +82,8 @@ def test_range_search_init(topology):
     sbin_dir = get_sbin_dir(prefix=topology.standalone.prefix)
 
     # Enable valgrind
-    valgrind_enable(sbin_dir)
+    if not topology.standalone.has_asan():
+        valgrind_enable(sbin_dir)
 
     # Now start the server with a longer timeout
     topology.standalone.start()
@@ -119,7 +121,7 @@ def test_range_search(topology):
                       (RETROCL_SUFFIX, e.message('desc')))
             success = False
 
-    if success:
+    if success and not topology.standalone.has_asan():
         # Get the results file, stop the server, and check for the leak
         results_file = valgrind_get_results_file(topology.standalone)
         topology.standalone.stop(timeout=30)
@@ -127,7 +129,7 @@ def test_range_search(topology):
             log.fatal('test_range_search: Memory leak is still present!')
             assert False
 
-        log.info('test_range_search: PASSED')
+    log.info('test_range_search: PASSED')
 
 
 if __name__ == '__main__':

+ 0 - 8
dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py

@@ -22,8 +22,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CONFIG_DN = 'cn=config'
 OU_PEOPLE = 'ou=People,' + DEFAULT_SUFFIX
 PWP_CONTAINER = 'nsPwPolicyContainer'
@@ -49,12 +47,6 @@ class TopologyStandalone(object):
 @pytest.fixture(scope="module")
 def topology(request):
     """This fixture is used to standalone topology for the 'module'."""
-
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 6
dirsrvtests/tests/suites/schema/test_schema.py

@@ -29,8 +29,6 @@ from lib389.properties import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 attrclass = ldap.schema.models.AttributeType
 occlass = ldap.schema.models.ObjectClass
 syntax_len_supported = False
@@ -47,10 +45,6 @@ def topology(request):
     '''
         This fixture is used to create a DirSrv instance for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
     schemainst = DirSrv(verbose=False)
 
     # Args for the master instance

+ 0 - 12
dirsrvtests/tests/tickets/finalizer.py

@@ -27,18 +27,9 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-global installation_prefix
-installation_prefix=os.getenv('PREFIX')
-
 def test_finalizer():
-    global installation_prefix
-
     # for each defined instance, remove it
     for args_instance in ALL_INSTANCES:
-        if installation_prefix:
-            # overwrite the environment setting
-            args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
         instance = DirSrv(verbose=True)
         instance.allocate(args_instance)
         if instance.exists():
@@ -54,9 +45,6 @@ def run_isolated():
             - set the installation prefix
             - run this program
     '''
-    global installation_prefix
-    installation_prefix =  None
-
     test_finalizer()
 
 if __name__ == '__main__':

+ 0 - 7
dirsrvtests/tests/tickets/ticket47313_test.py

@@ -20,8 +20,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 ENTRY_NAME = 'test_entry'
 
 
@@ -36,11 +34,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 3 - 4
dirsrvtests/tests/tickets/ticket47384_test.py

@@ -76,15 +76,14 @@ def test_ticket47384(topology):
     os.system('setenforce 0')
 
     PLUGIN_DN = 'cn=%s,cn=plugins,cn=config' % PLUGIN_WHOAMI
-    tmp_dir = '/tmp'
-    plugin_dir = get_plugin_dir(topology.standalone.prefix)
+    tmp_dir = topology.standalone.get_tmp_dir()
+    plugin_dir = topology.standalone.get_plugin_dir()
 
     # Copy the library to our tmp directory
     try:
         shutil.copy('%s/libwhoami-plugin.so' % plugin_dir, tmp_dir)
     except IOError as e:
-        log.fatal('Failed to copy libwhoami-plugin.so to the tmp directory, error: '
-                  + e.strerror)
+        log.fatal('Failed to copy %s/libwhoami-plugin.so to the tmp directory %s, error: %s' % (plugin_dir, tmp_dir, e.strerror))
         assert False
     try:
         shutil.copy('%s/libwhoami-plugin.la' % plugin_dir, tmp_dir)

+ 0 - 7
dirsrvtests/tests/tickets/ticket47490_test.py

@@ -25,8 +25,6 @@ from lib389.properties import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX
 ENTRY_DN = "cn=test_entry, %s" % SUFFIX
 MUST_OLD = "(postalAddress $ preferredLocale)"
@@ -184,11 +182,6 @@ def topology(request):
         This fixture is used to create a replicated topology for the 'module'.
         The replicated topology is MASTER -> Consumer.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     master   = DirSrv(verbose=False)
     consumer = DirSrv(verbose=False)
 

+ 0 - 7
dirsrvtests/tests/tickets/ticket47560_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -33,11 +31,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47573_test.py

@@ -26,8 +26,6 @@ from lib389.properties import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX
 ENTRY_DN = "cn=test_entry, %s" % SUFFIX
 
@@ -131,11 +129,6 @@ def topology(request):
         This fixture is used to create a replicated topology for the 'module'.
         The replicated topology is MASTER -> Consumer.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     master   = DirSrv(verbose=False)
     consumer = DirSrv(verbose=False)
 

+ 0 - 7
dirsrvtests/tests/tickets/ticket47619_test.py

@@ -25,8 +25,6 @@ from lib389.properties import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX
 ENTRY_DN = "cn=test_entry, %s" % SUFFIX
 
@@ -54,11 +52,6 @@ def topology(request):
         This fixture is used to create a replicated topology for the 'module'.
         The replicated topology is MASTER -> Consumer.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     master   = DirSrv(verbose=False)
     consumer = DirSrv(verbose=False)
 

+ 0 - 7
dirsrvtests/tests/tickets/ticket47653_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 OC_NAME = 'OCticket47653'
 MUST = "(postalAddress $ postalCode)"
 MAY  = "(member $ street)"
@@ -58,11 +56,6 @@ class TopologyStandalone(object):
 
 @pytest.fixture(scope="module")
 def topology(request):
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47669_test.py

@@ -22,8 +22,6 @@ from ldap.controls.simple import GetEffectiveRightsControl
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CHANGELOG = 'cn=changelog5,cn=config'
 RETROCHANGELOG = 'cn=Retro Changelog Plugin,cn=plugins,cn=config'
 
@@ -45,11 +43,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47714_test.py

@@ -20,8 +20,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 ACCT_POLICY_CONFIG_DN = ('cn=config,cn=%s,cn=plugins,cn=config' %
                          PLUGIN_ACCT_POLICY)
 ACCT_POLICY_DN = 'cn=Account Inactivation Policy,%s' % SUFFIX
@@ -44,11 +42,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47781_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -34,11 +32,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47808_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 ATTRIBUTE_UNIQUENESS_PLUGIN = 'cn=attribute uniqueness,cn=plugins,cn=config'
 ENTRY_NAME = 'test_entry'
 
@@ -36,11 +34,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47815_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -33,11 +31,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47819_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -34,11 +32,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 6
dirsrvtests/tests/tickets/ticket47823_test.py

@@ -22,8 +22,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 PROVISIONING_CN = "provisioning"
 PROVISIONING_DN = "cn=%s,%s" % (PROVISIONING_CN, SUFFIX)
 
@@ -65,11 +63,7 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
     standalone = DirSrv(verbose=False)
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
     # Args for the standalone instance
     args_instance[SER_HOST] = HOST_STANDALONE
     args_instance[SER_PORT] = PORT_STANDALONE

+ 0 - 7
dirsrvtests/tests/tickets/ticket47828_test.py

@@ -21,8 +21,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 ACCT_POLICY_CONFIG_DN = 'cn=config,cn=%s,cn=plugins,cn=config' % PLUGIN_ACCT_POLICY
 ACCT_POLICY_DN = 'cn=Account Inactivation Policy,%s' % SUFFIX
 INACTIVITY_LIMIT = '9'
@@ -53,11 +51,6 @@ def topology(request):
         At the beginning, It may exists a standalone instance.
         It may also exists a backup for the standalone instance.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47829_test.py

@@ -56,8 +56,6 @@ INDIRECT_ACTIVE_GROUP_DN = "cn=%s,%s" % (INDIRECT_ACTIVE_GROUP_CN, ACTIVE_DN)
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -70,11 +68,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47838_test.py

@@ -21,8 +21,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CONFIG_DN = 'cn=config'
 ENCRYPTION_DN = 'cn=encryption,%s' % CONFIG_DN
 MY_SECURE_PORT = '36363'
@@ -53,11 +51,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47871_test.py

@@ -25,8 +25,6 @@ from lib389.properties import *
 logging.getLogger(__name__).setLevel(logging.DEBUG)
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX
 ENTRY_DN = "cn=test_entry, %s" % SUFFIX
 
@@ -54,11 +52,6 @@ def topology(request):
         This fixture is used to create a replicated topology for the 'module'.
         The replicated topology is MASTER -> Consumer.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     master   = DirSrv(verbose=False)
     consumer = DirSrv(verbose=False)
 

+ 0 - 7
dirsrvtests/tests/tickets/ticket47900_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CONFIG_DN  = 'cn=config'
 ADMIN_NAME = 'passwd_admin'
 ADMIN_DN   = 'cn=%s,%s' % (ADMIN_NAME, SUFFIX)
@@ -41,11 +39,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 6 - 6
dirsrvtests/tests/tickets/ticket47910_test.py

@@ -88,7 +88,7 @@ def format_time(local_datetime):
     return formatted_time
 
 
-def execute_logconv(start_time_stamp, end_time_stamp, access_log):
+def execute_logconv(inst, start_time_stamp, end_time_stamp, access_log):
     '''
     This function will take start time and end time
     as input parameter and
@@ -97,7 +97,7 @@ def execute_logconv(start_time_stamp, end_time_stamp, access_log):
     '''
 
     log.info("Executing logconv.pl with -S current time and -E end time")
-    cmd = ['logconv.pl', '-S', start_time_stamp, '-E', end_time_stamp, access_log]
+    cmd = [os.path.join(inst.get_bin_dir(), 'logconv.pl'), '-S', start_time_stamp, '-E', end_time_stamp, access_log]
     log.info(" ".join(cmd))
     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     stdout, stderr = proc.communicate()
@@ -125,7 +125,7 @@ def test_ticket47910_logconv_start_end_positive(topology, log_dir):
     formatted_end_time_stamp = format_time(end_time_stamp)
 
     log.info("Executing logconv.pl with -S and -E")
-    result = execute_logconv(formatted_start_time_stamp, formatted_end_time_stamp, log_dir)
+    result = execute_logconv(topology.standalone, formatted_start_time_stamp, formatted_end_time_stamp, log_dir)
     assert result == 0
 
 
@@ -151,7 +151,7 @@ def test_ticket47910_logconv_start_end_negative(topology, log_dir):
     formatted_end_time_stamp = format_time(end_time_stamp)
 
     log.info("Executing logconv.pl with -S and -E")
-    result = execute_logconv(formatted_start_time_stamp, formatted_end_time_stamp, log_dir)
+    result = execute_logconv(topology.standalone, formatted_start_time_stamp, formatted_end_time_stamp, log_dir)
     assert result == 1
 
 
@@ -169,7 +169,7 @@ def test_ticket47910_logconv_start_end_invalid(topology, log_dir):
     end_time_stamp = "invalid"
 
     log.info("Executing logconv.pl with -S and -E")
-    result = execute_logconv(start_time_stamp, end_time_stamp, log_dir)
+    result = execute_logconv(topology.standalone, start_time_stamp, end_time_stamp, log_dir)
     assert result == 1
 
 
@@ -189,7 +189,7 @@ def test_ticket47910_logconv_noaccesslogs(topology, log_dir):
     time_stamp = (datetime.now() - timedelta(minutes=2))
     formatted_time_stamp = format_time(time_stamp)
     log.info("Executing logconv.pl with -S current time")
-    cmd = ['logconv.pl', '-S', formatted_time_stamp]
+    cmd = [os.path.join(topology.standalone.get_bin_dir(), 'logconv.pl'), '-S', formatted_time_stamp]
     log.info(" ".join(cmd))
     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     stdout, stderr = proc.communicate()

+ 0 - 8
dirsrvtests/tests/tickets/ticket47920_test.py

@@ -60,9 +60,6 @@ FINAL_DESC = "final description"
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
-
 class TopologyStandalone(object):
     def __init__(self, standalone):
         standalone.open()
@@ -74,11 +71,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47937_test.py

@@ -19,8 +19,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -33,11 +31,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47950_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 USER1_DN = "uid=user1,%s" % DEFAULT_SUFFIX
 USER2_DN = "uid=user2,%s" % DEFAULT_SUFFIX
 
@@ -37,11 +35,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 8
dirsrvtests/tests/tickets/ticket47953_test.py

@@ -21,9 +21,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
-
 class TopologyStandalone(object):
     def __init__(self, standalone):
         standalone.open()
@@ -35,11 +32,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47970_test.py

@@ -21,8 +21,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 USER1_DN = "uid=user1,%s" % DEFAULT_SUFFIX
 USER2_DN = "uid=user2,%s" % DEFAULT_SUFFIX
 
@@ -38,11 +36,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47973_test.py

@@ -18,8 +18,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 USER_DN = 'uid=user1,%s' % (DEFAULT_SUFFIX)
 SCHEMA_RELOAD_COUNT = 10
 
@@ -35,11 +33,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47980_test.py

@@ -21,8 +21,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 BRANCH1 = 'ou=level1,' + DEFAULT_SUFFIX
 BRANCH2 = 'ou=level2,ou=level1,' + DEFAULT_SUFFIX
 BRANCH3 = 'ou=level3,ou=level2,ou=level1,' + DEFAULT_SUFFIX
@@ -90,11 +88,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket47981_test.py

@@ -21,8 +21,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 BRANCH = 'ou=people,' + DEFAULT_SUFFIX
 USER_DN = 'uid=user1,%s' % (BRANCH)
 BRANCH_CONTAINER = 'cn=nsPwPolicyContainer,ou=people,dc=example,dc=com'
@@ -46,11 +44,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 1 - 1
dirsrvtests/tests/tickets/ticket48005_test.py

@@ -67,7 +67,7 @@ def test_ticket48005_setup(topology):
         prefix = topology.standalone.prefix
     else:
         prefix = None
-    sysconfig_dirsrv = prefix + ENV_SYSCONFIG_DIR + "/dirsrv"
+    sysconfig_dirsrv = os.path.join(topology.standalone.get_initconfig_dir(), 'dirsrv')
     cmdline = 'egrep "ulimit -c unlimited" %s' % sysconfig_dirsrv
     p = os.popen(cmdline, "r")
     ulimitc = p.readline()

+ 0 - 7
dirsrvtests/tests/tickets/ticket48214_test.py

@@ -13,8 +13,6 @@ from ldap.controls import SimplePagedResultsControl
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 MYSUFFIX = 'dc=example,dc=com'
 MYSUFFIXBE = 'userRoot'
 
@@ -30,11 +28,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 28 - 24
dirsrvtests/tests/tickets/ticket48226_test.py

@@ -113,8 +113,9 @@ def topology(request):
     def fin():
         master1.delete()
         master2.delete()
-        sbin_dir = get_sbin_dir(prefix=master2.prefix)
-        valgrind_disable(sbin_dir)
+        sbin_dir = master2.get_sbin_dir()
+        if not master2.has_asan():
+            valgrind_disable(sbin_dir)
     request.addfinalizer(fin)
 
     # Check replication is working...
@@ -181,10 +182,11 @@ def test_ticket48226_1(topology):
     topology.master1.stop(10)
 
     # Get the sbin directory so we know where to replace 'ns-slapd'
-    sbin_dir = get_sbin_dir(prefix=topology.master2.prefix)
+    sbin_dir = topology.master2.get_sbin_dir()
 
     # Enable valgrind
-    valgrind_enable(sbin_dir)
+    if not topology.master2.has_asan():
+        valgrind_enable(sbin_dir)
 
     # start M2 to do the next updates
     topology.master2.start()
@@ -207,31 +209,33 @@ def test_ticket48226_1(topology):
     # Restart master1
     #topology.master1.start(30)
 
-    results_file = valgrind_get_results_file(topology.master2)
+    if not topology.master2.has_asan():
+        results_file = valgrind_get_results_file(topology.master2)
 
     # Stop master2
     topology.master2.stop(30)
 
     # Check for leak
-    if valgrind_check_file(results_file, VALGRIND_LEAK_STR, 'csnset_dup'):
-        log.info('Valgrind reported leak in csnset_dup!')
-        assert False
-    else:
-        log.info('Valgrind is happy!')
-
-    # Check for invalid read/write
-    if valgrind_check_file(results_file, VALGRIND_INVALID_STR, 'csnset_dup'):
-        log.info('Valgrind reported invalid!')
-        assert False
-    else:
-        log.info('Valgrind is happy!')
-
-    # Check for invalid read/write
-    if valgrind_check_file(results_file, VALGRIND_INVALID_STR, 'csnset_free'):
-        log.info('Valgrind reported invalid!')
-        assert False
-    else:
-        log.info('Valgrind is happy!')
+    if not topology.master2.has_asan():
+        if valgrind_check_file(results_file, VALGRIND_LEAK_STR, 'csnset_dup'):
+            log.info('Valgrind reported leak in csnset_dup!')
+            assert False
+        else:
+            log.info('Valgrind is happy!')
+
+        # Check for invalid read/write
+        if valgrind_check_file(results_file, VALGRIND_INVALID_STR, 'csnset_dup'):
+            log.info('Valgrind reported invalid!')
+            assert False
+        else:
+            log.info('Valgrind is happy!')
+
+        # Check for invalid read/write
+        if valgrind_check_file(results_file, VALGRIND_INVALID_STR, 'csnset_free'):
+            log.info('Valgrind reported invalid!')
+            assert False
+        else:
+            log.info('Valgrind is happy!')
 
     log.info('Testcase PASSED')
 

+ 0 - 7
dirsrvtests/tests/tickets/ticket48228_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 # Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(
 SUBTREE_CONTAINER = 'cn=nsPwPolicyContainer,' + DEFAULT_SUFFIX
 SUBTREE_PWPDN = 'cn=nsPwPolicyEntry,' + DEFAULT_SUFFIX
@@ -45,11 +43,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket48252_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 # Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(
 USER_NUM = 10
 TEST_USER = "test_user"
@@ -38,11 +36,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket48294_test.py

@@ -21,8 +21,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 LINKEDATTR_PLUGIN = 'cn=Linked Attributes,cn=plugins,cn=config'
 MANAGER_LINK = 'cn=Manager Link,' + LINKEDATTR_PLUGIN
 OU_PEOPLE = 'ou=People,' + DEFAULT_SUFFIX
@@ -41,11 +39,6 @@ def topology(request):
     '''
     This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket48295_test.py

@@ -21,8 +21,6 @@ from lib389.properties import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 LINKEDATTR_PLUGIN = 'cn=Linked Attributes,cn=plugins,cn=config'
 MANAGER_LINK = 'cn=Manager Link,' + LINKEDATTR_PLUGIN
 OU_PEOPLE = 'ou=People,' + DEFAULT_SUFFIX
@@ -41,11 +39,6 @@ def topology(request):
     '''
     This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket48366_test.py

@@ -20,8 +20,6 @@ from ldap.controls.simple import ProxyAuthzControl
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 PROXY_USER_DN    = 'cn=proxy,ou=people,%s' % SUFFIX
 TEST_USER_DN    = 'cn=test,ou=people,%s' % SUFFIX
 USER_PW    = 'password'
@@ -41,11 +39,6 @@ class TopologyStandalone(object):
 
 @pytest.fixture(scope="module")
 def topology(request):
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 7
dirsrvtests/tests/tickets/ticket48759_test.py

@@ -20,8 +20,6 @@ from lib389.tasks import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 MEMBEROF_PLUGIN_DN = ('cn=' + PLUGIN_MEMBER_OF + ',cn=plugins,cn=config')
 GROUP_DN = ("cn=group," + DEFAULT_SUFFIX)
 MEMBER_DN_COMP = "uid=member"
@@ -38,11 +36,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 1 - 1
dirsrvtests/tests/tickets/ticket48784_test.py

@@ -426,7 +426,7 @@ def test_ticket48784(topology):
 
     log.info('##### Searching for entries on master1...')
     entries = topology.master1.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, '(uid=*)')
-    assert 11 == len(entries)
+    assert 12 == len(entries)
 
     log.info('##### Searching for entries on master2...')
     entries = topology.master2.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, '(uid=*)')

+ 0 - 7
dirsrvtests/tests/tickets/ticket48891_test.py

@@ -19,8 +19,6 @@ import fnmatch
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CONFIG_DN = 'cn=config'
 RDN_VAL_SUFFIX = 'ticket48891.org'
 MYSUFFIX = 'dc=%s' % RDN_VAL_SUFFIX
@@ -43,11 +41,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=False)
 
     # Args for the standalone instance

+ 0 - 10
dirsrvtests/tests/tickets/ticket48906_test.py

@@ -24,8 +24,6 @@ import fnmatch
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 CONFIG_DN = 'cn=config'
 RDN_VAL_SUFFIX = 'ticket48906.org'
 MYSUFFIX = 'dc=%s' % RDN_VAL_SUFFIX
@@ -63,11 +61,6 @@ def topology(request):
     '''
         This fixture is used to standalone topology for the 'module'.
     '''
-    global installation_prefix
-
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     standalone = DirSrv(verbose=True)
 
     # Args for the standalone instance
@@ -349,9 +342,6 @@ def run_isolated():
             - set the installation prefix
             - run this program
     '''
-    global installation_prefix
-    installation_prefix = None
-
     topo = topology(True)
     test_ticket48906_setup(topo)
     test_ticket48906_dblock_default(topo)

+ 0 - 6
dirsrvtests/tests/tickets/ticket548_test.py

@@ -21,8 +21,6 @@ from lib389.utils import *
 
 log = logging.getLogger(__name__)
 
-installation_prefix = None
-
 # Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(
 SUBTREE_CONTAINER = 'cn=nsPwPolicyContainer,' + DEFAULT_SUFFIX
 SUBTREE_PWPDN = 'cn=nsPwPolicyEntry,' + DEFAULT_SUFFIX
@@ -44,10 +42,6 @@ class TopologyStandalone(object):
 
 @pytest.fixture(scope="module")
 def topology(request):
-    global installation_prefix
-    if installation_prefix:
-        args_instance[SER_DEPLOYED_DIR] = installation_prefix
-
     # Creating standalone instance ...
     standalone = DirSrv(verbose=False)
     args_instance[SER_HOST] = HOST_STANDALONE

+ 4 - 0
rpm/389-ds-base.spec.in

@@ -121,6 +121,10 @@ Requires:         libdb-utils
 # This picks up libperl.so as a Requires, so we add this versioned one
 Requires:         perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 
+# Needed by logconv.pl
+Requires:         perl-DB_File
+Requires:         perl-Archive-Tar
+
 # for the init script
 Requires(post):   systemd-units
 Requires(preun):  systemd-units