From ad23dc80745b28c0159fa3ee9c4ee2b47cb7afa7 Mon Sep 17 00:00:00 2001 From: Viktor Ashirov Date: Feb 06 2017 18:38:18 +0000 Subject: Ticket 49057 - Fix tests failures on older versions of DS Bug Description: On older versions of DS some tests are failing because features are not implemented. Fix Description: Skip tests if they're using missing features. Fix usage of instance specific scripts in 1.2.11. https://fedorahosted.org/389/ticket/49057 Reviewed by: wibrown, nhosoi (Thanks!) --- diff --git a/dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py b/dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py index 32a7327..904d1fc 100644 --- a/dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py +++ b/dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py @@ -25,7 +25,7 @@ def test_attr_uniqueness_init(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False topology_st.standalone.plugins.enable(name=PLUGIN_ATTR_UNIQUENESS) diff --git a/dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py b/dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py index dec6e87..9badcc3 100644 --- a/dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py +++ b/dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py @@ -67,14 +67,14 @@ def test_dynamic_plugins(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False # Test that critical plugins can be updated even though the change might not be applied try: topology_st.standalone.modify_s(DN_LDBM, [(ldap.MOD_REPLACE, 'description', 'test')]) except ldap.LDAPError as e: - ldap.fatal('Failed to apply change to critical plugin' + e.message['desc']) + log.fatal('Failed to apply change to critical plugin' + e.message['desc']) assert False while 1: diff --git a/dirsrvtests/tests/tickets/ticket1347760_test.py b/dirsrvtests/tests/tickets/ticket1347760_test.py index 9019764..70ad9c4 100644 --- a/dirsrvtests/tests/tickets/ticket1347760_test.py +++ b/dirsrvtests/tests/tickets/ticket1347760_test.py @@ -176,10 +176,11 @@ def test_ticket1347760(topology_st): log.info('Deleting aci in %s.' % DEFAULT_SUFFIX) topology_st.standalone.modify_s(DEFAULT_SUFFIX, [(ldap.MOD_DELETE, 'aci', None)]) - log.info('While binding as DM, acquire an access log path') + log.info('While binding as DM, acquire an access log path and instance dir') ds_paths = Paths(serverid=topology_st.standalone.serverid, instance=topology_st.standalone) file_path = ds_paths.access_log + inst_dir = ds_paths.inst_dir log.info('Bind case 1. the bind user has no rights to read the entry itself, bind should be successful.') log.info('Bind as {%s,%s} who has no access rights.' % (BINDDN, BINDPW)) @@ -420,8 +421,14 @@ def test_ticket1347760(topology_st): check_op_result(topology_st.standalone, 'delete', BOGUSDN, None, exists, rc) log.info('Inactivate %s' % BINDDN) - nsinactivate = os.path.join(topology_st.standalone.get_sbin_dir(), 'ns-inactivate.pl') - p = Popen([nsinactivate, '-Z', topology_st.standalone.serverid, '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN]) + if ds_paths.version < '1.3': + nsinactivate = '%s/ns-inactivate.pl' % inst_dir + nsinactivate_cmd = [nsinactivate, '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN] + else: + nsinactivate = '%s/ns-inactivate.pl' % ds_paths.sbin_dir + nsinactivate_cmd = [nsinactivate, '-Z', SERVERID_STANDALONE, '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN] + log.info(nsinactivate_cmd) + p = Popen(nsinactivate_cmd) assert (p.wait() == 0) log.info('Bind as {%s,%s} which should fail with %s.' % (BINDDN, BUID, ldap.UNWILLING_TO_PERFORM.__name__)) diff --git a/dirsrvtests/tests/tickets/ticket397_test.py b/dirsrvtests/tests/tickets/ticket397_test.py index 424c91b..91a9790 100644 --- a/dirsrvtests/tests/tickets/ticket397_test.py +++ b/dirsrvtests/tests/tickets/ticket397_test.py @@ -11,6 +11,9 @@ if DEBUGGING: else: logging.getLogger(__name__).setLevel(logging.INFO) +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.6'), reason="Not implemented") + log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket47431_test.py b/dirsrvtests/tests/tickets/ticket47431_test.py index 573dc77..7c726ac 100644 --- a/dirsrvtests/tests/tickets/ticket47431_test.py +++ b/dirsrvtests/tests/tickets/ticket47431_test.py @@ -11,6 +11,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket47490_test.py b/dirsrvtests/tests/tickets/ticket47490_test.py index ea6c2bd..df57aab 100644 --- a/dirsrvtests/tests/tickets/ticket47490_test.py +++ b/dirsrvtests/tests/tickets/ticket47490_test.py @@ -21,6 +21,10 @@ from lib389 import Entry from lib389._constants import * from lib389.topologies import topology_m1c1 +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3'), reason="Not implemented") logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket47536_test.py b/dirsrvtests/tests/tickets/ticket47536_test.py index e287e2e..7850ea5 100644 --- a/dirsrvtests/tests/tickets/ticket47536_test.py +++ b/dirsrvtests/tests/tickets/ticket47536_test.py @@ -13,6 +13,8 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_m2 +pytestmark = pytest.mark.skipif(ds_is_older('1.3.5'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket47640_test.py b/dirsrvtests/tests/tickets/ticket47640_test.py index aa11684..23e7c03 100644 --- a/dirsrvtests/tests/tickets/ticket47640_test.py +++ b/dirsrvtests/tests/tickets/ticket47640_test.py @@ -11,6 +11,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) @@ -25,13 +28,13 @@ def test_ticket47640(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False try: topology_st.standalone.plugins.enable(name=PLUGIN_LINKED_ATTRS) except ValueError as e: - ldap.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) + log.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) assert False # Add the plugin config entry diff --git a/dirsrvtests/tests/tickets/ticket47653MMR_test.py b/dirsrvtests/tests/tickets/ticket47653MMR_test.py index 7fe07f5..53e921f 100644 --- a/dirsrvtests/tests/tickets/ticket47653MMR_test.py +++ b/dirsrvtests/tests/tickets/ticket47653MMR_test.py @@ -21,6 +21,10 @@ from lib389._constants import * from lib389.topologies import topology_m2 logging.getLogger(__name__).setLevel(logging.DEBUG) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.2'), reason="Not implemented") log = logging.getLogger(__name__) TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX diff --git a/dirsrvtests/tests/tickets/ticket47653_test.py b/dirsrvtests/tests/tickets/ticket47653_test.py index 7ff1b87..241b4d0 100644 --- a/dirsrvtests/tests/tickets/ticket47653_test.py +++ b/dirsrvtests/tests/tickets/ticket47653_test.py @@ -16,6 +16,10 @@ from lib389.topologies import topology_st log = logging.getLogger(__name__) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.2'), reason="Not implemented") OC_NAME = 'OCticket47653' MUST = "(postalAddress $ postalCode)" MAY = "(member $ street)" diff --git a/dirsrvtests/tests/tickets/ticket47676_test.py b/dirsrvtests/tests/tickets/ticket47676_test.py index a7a12f6..3468b90 100644 --- a/dirsrvtests/tests/tickets/ticket47676_test.py +++ b/dirsrvtests/tests/tickets/ticket47676_test.py @@ -21,6 +21,10 @@ from lib389._constants import * from lib389.topologies import topology_m2 logging.getLogger(__name__).setLevel(logging.DEBUG) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.2'), reason="Not implemented") log = logging.getLogger(__name__) SCHEMA_DN = "cn=schema" diff --git a/dirsrvtests/tests/tickets/ticket47714_test.py b/dirsrvtests/tests/tickets/ticket47714_test.py index 49d671f..146b49d 100644 --- a/dirsrvtests/tests/tickets/ticket47714_test.py +++ b/dirsrvtests/tests/tickets/ticket47714_test.py @@ -17,6 +17,10 @@ from lib389.topologies import topology_st log = logging.getLogger(__name__) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") ACCT_POLICY_CONFIG_DN = ('cn=config,cn=%s,cn=plugins,cn=config' % PLUGIN_ACCT_POLICY) ACCT_POLICY_DN = 'cn=Account Inactivation Policy,%s' % SUFFIX diff --git a/dirsrvtests/tests/tickets/ticket47815_test.py b/dirsrvtests/tests/tickets/ticket47815_test.py index 0b68ca4..939a9bc 100644 --- a/dirsrvtests/tests/tickets/ticket47815_test.py +++ b/dirsrvtests/tests/tickets/ticket47815_test.py @@ -16,6 +16,10 @@ from lib389._constants import * from lib389.topologies import topology_st log = logging.getLogger(__name__) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") def test_ticket47815(topology_st): diff --git a/dirsrvtests/tests/tickets/ticket47819_test.py b/dirsrvtests/tests/tickets/ticket47819_test.py index 555ce67..cc00921 100644 --- a/dirsrvtests/tests/tickets/ticket47819_test.py +++ b/dirsrvtests/tests/tickets/ticket47819_test.py @@ -17,6 +17,10 @@ log = logging.getLogger(__name__) def test_ticket47819(topology_st): """ +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") Testing precise tombstone purging: [1] Make sure "nsTombstoneCSN" is added to new tombstones [2] Make sure an import of a replication ldif adds "nsTombstoneCSN" diff --git a/dirsrvtests/tests/tickets/ticket47823_test.py b/dirsrvtests/tests/tickets/ticket47823_test.py index 92e189b..2beeb25 100644 --- a/dirsrvtests/tests/tickets/ticket47823_test.py +++ b/dirsrvtests/tests/tickets/ticket47823_test.py @@ -19,7 +19,10 @@ from lib389._constants import * from lib389.topologies import topology_st log = logging.getLogger(__name__) +from lib389.utils import * +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") PROVISIONING_CN = "provisioning" PROVISIONING_DN = "cn=%s,%s" % (PROVISIONING_CN, SUFFIX) diff --git a/dirsrvtests/tests/tickets/ticket47828_test.py b/dirsrvtests/tests/tickets/ticket47828_test.py index 8626344..55d65ed 100644 --- a/dirsrvtests/tests/tickets/ticket47828_test.py +++ b/dirsrvtests/tests/tickets/ticket47828_test.py @@ -18,6 +18,10 @@ log = logging.getLogger(__name__) ACCT_POLICY_CONFIG_DN = 'cn=config,cn=%s,cn=plugins,cn=config' % PLUGIN_ACCT_POLICY ACCT_POLICY_DN = 'cn=Account Inactivation Policy,%s' % SUFFIX +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") INACTIVITY_LIMIT = '9' SEARCHFILTER = '(objectclass=*)' diff --git a/dirsrvtests/tests/tickets/ticket47829_test.py b/dirsrvtests/tests/tickets/ticket47829_test.py index e585c57..72a42d7 100644 --- a/dirsrvtests/tests/tickets/ticket47829_test.py +++ b/dirsrvtests/tests/tickets/ticket47829_test.py @@ -14,7 +14,10 @@ import pytest from lib389 import Entry from lib389._constants import * from lib389.topologies import topology_st +from lib389.utils import * +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") SCOPE_IN_CN = 'in' SCOPE_OUT_CN = 'out' SCOPE_IN_DN = 'cn=%s,%s' % (SCOPE_IN_CN, SUFFIX) diff --git a/dirsrvtests/tests/tickets/ticket47833_test.py b/dirsrvtests/tests/tickets/ticket47833_test.py index e2b38cd..d95c7be 100644 --- a/dirsrvtests/tests/tickets/ticket47833_test.py +++ b/dirsrvtests/tests/tickets/ticket47833_test.py @@ -19,6 +19,9 @@ SCOPE_OUT_DN = 'cn=%s,%s' % (SCOPE_OUT_CN, SUFFIX) PROVISIONING_CN = "provisioning" PROVISIONING_DN = "cn=%s,%s" % (PROVISIONING_CN, SCOPE_IN_DN) +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") + ACTIVE_CN = "accounts" STAGE_CN = "staged users" DELETE_CN = "deleted users" diff --git a/dirsrvtests/tests/tickets/ticket47838_test.py b/dirsrvtests/tests/tickets/ticket47838_test.py index 1f6f8ce..50924b7 100644 --- a/dirsrvtests/tests/tickets/ticket47838_test.py +++ b/dirsrvtests/tests/tickets/ticket47838_test.py @@ -18,6 +18,10 @@ from lib389.topologies import topology_st log = logging.getLogger(__name__) CONFIG_DN = 'cn=config' +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") ENCRYPTION_DN = 'cn=encryption,%s' % CONFIG_DN MY_SECURE_PORT = '36363' RSA = 'RSA' diff --git a/dirsrvtests/tests/tickets/ticket47871_test.py b/dirsrvtests/tests/tickets/ticket47871_test.py index 826ca44..8d2a49e 100644 --- a/dirsrvtests/tests/tickets/ticket47871_test.py +++ b/dirsrvtests/tests/tickets/ticket47871_test.py @@ -21,6 +21,10 @@ from lib389._constants import * from lib389.topologies import topology_m1c1 logging.getLogger(__name__).setLevel(logging.DEBUG) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.2'), reason="Not implemented") log = logging.getLogger(__name__) TEST_REPL_DN = "cn=test_repl, %s" % SUFFIX diff --git a/dirsrvtests/tests/tickets/ticket47910_test.py b/dirsrvtests/tests/tickets/ticket47910_test.py index b51118c..f636950 100644 --- a/dirsrvtests/tests/tickets/ticket47910_test.py +++ b/dirsrvtests/tests/tickets/ticket47910_test.py @@ -16,7 +16,10 @@ from lib389.topologies import topology_st logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) +from lib389.utils import * +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") @pytest.fixture(scope="module") def log_dir(topology_st): ''' diff --git a/dirsrvtests/tests/tickets/ticket47920_test.py b/dirsrvtests/tests/tickets/ticket47920_test.py index cd4b7f4..3db5d8d 100644 --- a/dirsrvtests/tests/tickets/ticket47920_test.py +++ b/dirsrvtests/tests/tickets/ticket47920_test.py @@ -19,7 +19,10 @@ SCOPE_IN_CN = 'in' SCOPE_OUT_CN = 'out' SCOPE_IN_DN = 'cn=%s,%s' % (SCOPE_IN_CN, SUFFIX) SCOPE_OUT_DN = 'cn=%s,%s' % (SCOPE_OUT_CN, SUFFIX) +from lib389.utils import * +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.2'), reason="Not implemented") PROVISIONING_CN = "provisioning" PROVISIONING_DN = "cn=%s,%s" % (PROVISIONING_CN, SCOPE_IN_DN) diff --git a/dirsrvtests/tests/tickets/ticket47927_test.py b/dirsrvtests/tests/tickets/ticket47927_test.py index 1cb20d2..08b10ad 100644 --- a/dirsrvtests/tests/tickets/ticket47927_test.py +++ b/dirsrvtests/tests/tickets/ticket47927_test.py @@ -11,6 +11,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket47931_test.py b/dirsrvtests/tests/tickets/ticket47931_test.py index 7e4964a..9e4d03e 100644 --- a/dirsrvtests/tests/tickets/ticket47931_test.py +++ b/dirsrvtests/tests/tickets/ticket47931_test.py @@ -5,6 +5,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.3'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) @@ -66,7 +69,7 @@ def test_ticket47931(topology_st): 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.error('Failed to enable dynamic plugins! ' + e.message['desc']) + log.error('Failed to enable dynamic plugins! ' + e.message['desc']) assert False # Enable the plugins @@ -93,7 +96,7 @@ def test_ticket47931(topology_st): 'nsslapd-include-suffix', DEFAULT_SUFFIX)]) except ldap.LDAPError as e: - ldap.error('Failed to configure retrocl plugin: ' + e.message['desc']) + log.error('Failed to configure retrocl plugin: ' + e.message['desc']) assert False # Configure memberOf group attribute diff --git a/dirsrvtests/tests/tickets/ticket48013_test.py b/dirsrvtests/tests/tickets/ticket48013_test.py index e178a0c..78c6226 100644 --- a/dirsrvtests/tests/tickets/ticket48013_test.py +++ b/dirsrvtests/tests/tickets/ticket48013_test.py @@ -13,6 +13,9 @@ from ldap.syncrepl import SyncreplConsumer from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket48026_test.py b/dirsrvtests/tests/tickets/ticket48026_test.py index 5af3d90..c0c31dd 100644 --- a/dirsrvtests/tests/tickets/ticket48026_test.py +++ b/dirsrvtests/tests/tickets/ticket48026_test.py @@ -11,6 +11,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket48194_test.py b/dirsrvtests/tests/tickets/ticket48194_test.py index 773dc95..fb50251 100644 --- a/dirsrvtests/tests/tickets/ticket48194_test.py +++ b/dirsrvtests/tests/tickets/ticket48194_test.py @@ -19,6 +19,10 @@ from lib389.topologies import topology_st log = logging.getLogger(__name__) CONFIG_DN = 'cn=config' +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") ENCRYPTION_DN = 'cn=encryption,%s' % CONFIG_DN RSA = 'RSA' RSA_DN = 'cn=%s,%s' % (RSA, ENCRYPTION_DN) diff --git a/dirsrvtests/tests/tickets/ticket48272_test.py b/dirsrvtests/tests/tickets/ticket48272_test.py index 8f3af70..8cdafa8 100644 --- a/dirsrvtests/tests/tickets/ticket48272_test.py +++ b/dirsrvtests/tests/tickets/ticket48272_test.py @@ -11,6 +11,9 @@ else: logging.getLogger(__name__).setLevel(logging.INFO) log = logging.getLogger(__name__) +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.6'), reason="Not implemented") + USER1 = 'user1' USER1_DOMAIN = 'user1@example.com' diff --git a/dirsrvtests/tests/tickets/ticket48294_test.py b/dirsrvtests/tests/tickets/ticket48294_test.py index 260d9f6..df48dc6 100644 --- a/dirsrvtests/tests/tickets/ticket48294_test.py +++ b/dirsrvtests/tests/tickets/ticket48294_test.py @@ -94,13 +94,13 @@ def test_48294_init(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False try: topology_st.standalone.plugins.enable(name=PLUGIN_LINKED_ATTRS) except ValueError as e: - ldap.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) + log.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) assert False log.info('Add the plugin config entry') diff --git a/dirsrvtests/tests/tickets/ticket48295_test.py b/dirsrvtests/tests/tickets/ticket48295_test.py index db8fc64..d118de4 100644 --- a/dirsrvtests/tests/tickets/ticket48295_test.py +++ b/dirsrvtests/tests/tickets/ticket48295_test.py @@ -72,13 +72,13 @@ def test_48295_init(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False try: topology_st.standalone.plugins.enable(name=PLUGIN_LINKED_ATTRS) except ValueError as e: - ldap.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) + log.fatal('Failed to enable linked attributes plugin!' + e.message['desc']) assert False log.info('Add the plugin config entry') diff --git a/dirsrvtests/tests/tickets/ticket48312_test.py b/dirsrvtests/tests/tickets/ticket48312_test.py index 36c30d8..bc72a9b 100644 --- a/dirsrvtests/tests/tickets/ticket48312_test.py +++ b/dirsrvtests/tests/tickets/ticket48312_test.py @@ -26,7 +26,7 @@ def test_ticket48312(topology_st): try: topology_st.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')]) except ldap.LDAPError as e: - ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc']) + log.fatal('Failed to enable dynamic plugin!' + e.message['desc']) assert False topology_st.standalone.plugins.enable(name=PLUGIN_MANAGED_ENTRY) diff --git a/dirsrvtests/tests/tickets/ticket48362_test.py b/dirsrvtests/tests/tickets/ticket48362_test.py index 10687a3..ab0aaa5 100644 --- a/dirsrvtests/tests/tickets/ticket48362_test.py +++ b/dirsrvtests/tests/tickets/ticket48362_test.py @@ -3,6 +3,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_m2 +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented") + logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket48366_test.py b/dirsrvtests/tests/tickets/ticket48366_test.py index 98b191f..90dc6af 100644 --- a/dirsrvtests/tests/tickets/ticket48366_test.py +++ b/dirsrvtests/tests/tickets/ticket48366_test.py @@ -17,6 +17,10 @@ from lib389.topologies import topology_st log = logging.getLogger(__name__) +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.5'), reason="Not implemented") PROXY_USER_DN = 'cn=proxy,ou=people,%s' % SUFFIX TEST_USER_DN = 'cn=test,ou=people,%s' % SUFFIX USER_PW = 'password' diff --git a/dirsrvtests/tests/tickets/ticket48784_test.py b/dirsrvtests/tests/tickets/ticket48784_test.py index 0a739f4..d4d7353 100644 --- a/dirsrvtests/tests/tickets/ticket48784_test.py +++ b/dirsrvtests/tests/tickets/ticket48784_test.py @@ -8,7 +8,10 @@ # import pytest from lib389.tasks import * + from lib389.utils import * +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.5'), reason="Not implemented") from lib389.topologies import topology_m2 logging.getLogger(__name__).setLevel(logging.DEBUG) diff --git a/dirsrvtests/tests/tickets/ticket48906_test.py b/dirsrvtests/tests/tickets/ticket48906_test.py index c388feb..aea4227 100644 --- a/dirsrvtests/tests/tickets/ticket48906_test.py +++ b/dirsrvtests/tests/tickets/ticket48906_test.py @@ -13,6 +13,10 @@ import shutil import pytest from lib389.tasks import * from lib389.topologies import topology_st +from lib389.utils import * + +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.6'), reason="Not implemented") log = logging.getLogger(__name__) diff --git a/dirsrvtests/tests/tickets/ticket48916_test.py b/dirsrvtests/tests/tickets/ticket48916_test.py index 207b355..24a41b0 100644 --- a/dirsrvtests/tests/tickets/ticket48916_test.py +++ b/dirsrvtests/tests/tickets/ticket48916_test.py @@ -11,6 +11,9 @@ else: logging.getLogger(__name__).setLevel(logging.INFO) log = logging.getLogger(__name__) +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.5'), reason="Not implemented") + def _create_user(inst, idnum): diff --git a/dirsrvtests/tests/tickets/ticket48961_test.py b/dirsrvtests/tests/tickets/ticket48961_test.py index 2d92ada..8ee18b9 100644 --- a/dirsrvtests/tests/tickets/ticket48961_test.py +++ b/dirsrvtests/tests/tickets/ticket48961_test.py @@ -11,6 +11,9 @@ else: log = logging.getLogger(__name__) +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.6'), reason="Not implemented") + def test_ticket48961_storagescheme(topology_st): """ diff --git a/dirsrvtests/tests/tickets/ticket548_test.py b/dirsrvtests/tests/tickets/ticket548_test.py index 40b8048..6dd426e 100644 --- a/dirsrvtests/tests/tickets/ticket548_test.py +++ b/dirsrvtests/tests/tickets/ticket548_test.py @@ -11,6 +11,9 @@ from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st +# Skip on older versions +pytestmark = pytest.mark.skipif(ds_is_older('1.3.6'), reason="Not implemented") + log = logging.getLogger(__name__) # Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(