From c94dfb3281d6f9ba7c290af59261798a98c2ffa8 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Thu, 2 Mar 2017 16:53:55 +0100 Subject: [PATCH] Issue 49156 - Clean up test suites dir structure and docstrings Description: We have a lot of plugin directories in dirsrvtests/tests/suites: - dynamic_plugins - [PluginName]_plugin - 27 directories While we are in the process of creating tickets for the porting sprint, it would be nice to have an organised structure. As discussed on the Engineering/QE Sync Up meeting we need to move all of them to 'plugins' dir. Also, as a part of test suites cleanup, we should organise test plans in the docstrings and IDs to an each test case (can be generated with Python 'import uuid; uuid.uuid4()'). create_test.py script should be fixed too and it should check if the ID is unique throughout the tests. https://pagure.io/389-ds-base/issue/49156 Reviewed by: ? --- dirsrvtests/create_test.py | 40 +++++- .../suites/attr_uniqueness_plugin/__init__.py | 0 .../tests/suites/automember_plugin/__init__.py | 0 .../tests/suites/chaining_plugin/__init__.py | 0 .../tests/suites/collation_plugin/__init__.py | 0 dirsrvtests/tests/suites/config/config_test.py | 44 +++++-- dirsrvtests/tests/suites/cos_plugin/__init__.py | 0 dirsrvtests/tests/suites/deref_plugin/__init__.py | 0 .../tests/suites/distrib_plugin/__init__.py | 0 dirsrvtests/tests/suites/dna_plugin/__init__.py | 0 .../tests/suites/dynamic-plugins/__init__.py | 0 .../__init__.py | 0 .../dynamic_plugins_test.py} | 0 .../plugin_tests.py | 0 .../stress_tests.py | 0 .../suites/filter/rfc3673_all_oper_attrs_test.py | 24 ++-- .../tests/suites/linkedattrs_plugin/__init__.py | 0 .../tests/suites/memberof_plugin/__init__.py | 0 dirsrvtests/tests/suites/mep_plugin/__init__.py | 0 .../suites/paged_results/paged_results_test.py | 136 ++++++++++----------- .../tests/suites/pam_passthru_plugin/__init__.py | 0 .../tests/suites/passthru_plugin/__init__.py | 0 .../suites/password/pwdPolicy_attribute_test.py | 20 ++- .../password/pwdPolicy_inherit_global_test.py | 24 ++-- .../suites/password/pwdPolicy_warning_test.py | 85 ++++++------- .../{acctpolicy_plugin => plugins}/__init__.py | 0 .../{acctpolicy_plugin => plugins}/accpol_test.py | 44 +++---- .../attr_uniqueness_test.py | 0 .../suites/{dna_plugin => plugins}/dna_test.py | 0 .../{memberof_plugin => plugins}/memberof_test.py | 0 .../rootdn_plugin_test.py | 0 .../tests/suites/posix_winsync_plugin/__init__.py | 0 .../tests/suites/referint_plugin/__init__.py | 0 .../tests/suites/replication/acceptance_test.py | 58 ++++----- .../tests/suites/replication/single_master_test.py | 32 ++--- .../tests/suites/replication/tombstone_test.py | 20 +-- .../tests/suites/replsync_plugin/__init__.py | 0 .../tests/suites/retrocl_plugin/__init__.py | 0 .../tests/suites/reverpwd_plugin/__init__.py | 0 dirsrvtests/tests/suites/roles_plugin/__init__.py | 0 dirsrvtests/tests/suites/rootdn_plugin/__init__.py | 0 .../tests/suites/schema_reload_plugin/__init__.py | 0 dirsrvtests/tests/suites/syntax_plugin/__init__.py | 0 dirsrvtests/tests/suites/usn_plugin/__init__.py | 0 dirsrvtests/tests/suites/views_plugin/__init__.py | 0 dirsrvtests/tests/suites/whoami_plugin/__init__.py | 0 46 files changed, 281 insertions(+), 246 deletions(-) delete mode 100644 dirsrvtests/tests/suites/attr_uniqueness_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/automember_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/chaining_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/collation_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/cos_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/deref_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/distrib_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/dna_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/dynamic-plugins/__init__.py rename dirsrvtests/tests/suites/{acct_usability_plugin => dynamic_plugins}/__init__.py (100%) rename dirsrvtests/tests/suites/{dynamic-plugins/test_dynamic_plugins.py => dynamic_plugins/dynamic_plugins_test.py} (100%) rename dirsrvtests/tests/suites/{dynamic-plugins => dynamic_plugins}/plugin_tests.py (100%) rename dirsrvtests/tests/suites/{dynamic-plugins => dynamic_plugins}/stress_tests.py (100%) delete mode 100644 dirsrvtests/tests/suites/linkedattrs_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/memberof_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/mep_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/pam_passthru_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/passthru_plugin/__init__.py rename dirsrvtests/tests/suites/{acctpolicy_plugin => plugins}/__init__.py (100%) rename dirsrvtests/tests/suites/{acctpolicy_plugin => plugins}/accpol_test.py (91%) rename dirsrvtests/tests/suites/{attr_uniqueness_plugin => plugins}/attr_uniqueness_test.py (100%) rename dirsrvtests/tests/suites/{dna_plugin => plugins}/dna_test.py (100%) rename dirsrvtests/tests/suites/{memberof_plugin => plugins}/memberof_test.py (100%) rename dirsrvtests/tests/suites/{rootdn_plugin => plugins}/rootdn_plugin_test.py (100%) delete mode 100644 dirsrvtests/tests/suites/posix_winsync_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/referint_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/replsync_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/retrocl_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/reverpwd_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/roles_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/rootdn_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/schema_reload_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/syntax_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/usn_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/views_plugin/__init__.py delete mode 100644 dirsrvtests/tests/suites/whoami_plugin/__init__.py diff --git a/dirsrvtests/create_test.py b/dirsrvtests/create_test.py index d898397..0461ae0 100755 --- a/dirsrvtests/create_test.py +++ b/dirsrvtests/create_test.py @@ -9,7 +9,10 @@ # --- END COPYRIGHT BLOCK --- import optparse +import os +import re import sys +import uuid from lib389 import topologies """This script generates a template test script that handles the @@ -113,6 +116,24 @@ def get_existing_topologies(inst, masters, hubs, consumers): return [False, my_topology] +def check_id_uniqueness(id_value): + """Checks if ID is already present in other tests. + create_test.py script should exist in the directory + with a 'tests' dir. + """ + + tests_dir = os.path.join(os.getcwd(), 'tests') + + for root, dirs, files in os.walk(tests_dir): + for name in files: + with open(os.path.join(root, name), "r") as file: + for line in file: + if re.search(str(id_value), line): + return False + + return True + + desc = 'Script to generate an initial lib389 test script. ' + \ 'This generates the topology, test, final, and run-isolated functions.' @@ -654,6 +675,9 @@ if len(sys.argv) > 0: TEST.write(', standalone' + str(idx)) TEST.write(')\n\n\n') + tc_id = '0' + while not check_id_uniqueness(tc_id): tc_id = uuid.uuid4() + # Write the test function if ticket: TEST.write('def test_ticket{}(topo):\n'.format(ticket)) @@ -664,11 +688,17 @@ if len(sys.argv) > 0: TEST.write(' """\n\n') else: TEST.write('def test_something(topo):\n') - TEST.write(' """Write a single test here...\n\n') - TEST.write(' Also, if you need any test suite initialization,\n') - TEST.write(' please, write additional fixture for that (including finalizer).\n' - ' Topology for suites are predefined in lib389/topologies.py.\n' - ' """\n\n') + TEST.write(' """Write one-line test case purpose (name) here\n\n') + TEST.write(' :ID: {}\n'.format(tc_id)) + TEST.write(' :feature: Fill in feature name here\n') + TEST.write(' :setup: Fill in set up configuration here\n') + TEST.write(' :steps: 1. Fill in test case steps here\n') + TEST.write(' 2. And indent them like this (RST format requirement)\n') + TEST.write(' :assert: Fill in the result that is expected\n') + TEST.write(' """\n\n') + TEST.write(' # If you need any test suite initialization,\n') + TEST.write(' # please, write additional fixture for that (including finalizer).\n' + ' # Topology for suites are predefined in lib389/topologies.py.\n\n') TEST.write(' if DEBUGGING:\n') TEST.write(' # Add debugging steps(if any)...\n') diff --git a/dirsrvtests/tests/suites/attr_uniqueness_plugin/__init__.py b/dirsrvtests/tests/suites/attr_uniqueness_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/automember_plugin/__init__.py b/dirsrvtests/tests/suites/automember_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/chaining_plugin/__init__.py b/dirsrvtests/tests/suites/chaining_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/collation_plugin/__init__.py b/dirsrvtests/tests/suites/collation_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/config/config_test.py b/dirsrvtests/tests/suites/config/config_test.py index 361a23d..1c67fcf 100644 --- a/dirsrvtests/tests/suites/config/config_test.py +++ b/dirsrvtests/tests/suites/config/config_test.py @@ -63,16 +63,14 @@ def test_user(topology_m2): def test_maxbersize_repl(topology_m2, test_user, big_file): """maxbersize is ignored in the replicated operations. - :Feature: Config - - :Setup: MMR with two masters, test user, + :ID: ad57de60-7d56-4323-bbca-5556e5cdb126 + :feature: Config + :setup: MMR with two masters, test user, 1 MiB big value for attribute - - :Steps: 1. Set 20KiB small maxbersize on master2 + :steps: 1. Set 20KiB small maxbersize on master2 2. Add big value to master2 3. Add big value to master1 - - :Assert: Adding the big value to master2 is failed, + :assert: Adding the big value to master2 is failed, adding the big value to master1 is succeed, the big value is successfully replicated to master2 """ @@ -136,9 +134,18 @@ def test_maxbersize_repl(topology_m2, test_user, big_file): def test_config_listen_backport_size(topology_m2): - """We need to check that we can search on nsslapd-listen-backlog-size, - and change its value: to a psoitive number and a negative number. - Verify invalid value is rejected. + """Check that nsslapd-listen-backlog-size acted as expected + + :ID: a4385d58-a6ab-491e-a604-6df0e8ed91cd + :feature: Config + :setup: An instance + :steps: 1. Search for nsslapd-listen-backlog-size + 2. Set nsslapd-listen-backlog-size to a valid value + Try positive and negative. + 3. Set nsslapd-listen-backlog-size to an invalid value + 4. Set nsslapd-listen-backlog-size back to a default value + :assert: Search and the valid modification should be a success + Modification with an invalid value should throw an error """ try: @@ -184,8 +191,19 @@ def test_config_listen_backport_size(topology_m2): def test_config_deadlock_policy(topology_m2): - """We need to check that nsslapd-db-deadlock-policy exists, that we can - change the value, and invalid values are rejected + """Check that nsslapd-db-deadlock-policy acted as expected + + :ID: a24e25fd-bc15-47fa-b018-372f6a2ec59c + :feature: Config + :setup: An instance + :steps: 1. Search for nsslapd-db-deadlock-policy and check if + it contains a default value + 2. Set nsslapd-db-deadlock-policy to a valid value + Try positive and negative. + 3. Set nsslapd-db-deadlock-policy to an invalid value + 4. Set nsslapd-db-deadlock-policy back to a default value + :assert: Search and the valid modification should be a success + Modification with invalid values should throw an error """ LDBM_DN = 'cn=config,cn=ldbm database,cn=plugins,cn=config' @@ -196,7 +214,7 @@ def test_config_deadlock_policy(topology_m2): ['nsslapd-db-deadlock-policy']) val = entry[0].data['nsslapd-db-deadlock-policy'][0] assert val, 'Failed to get nsslapd-db-deadlock-policy from config' - assert val == default_val, 'The wrong derfualt value was present' + assert val == default_val, 'The wrong default value was present' except ldap.LDAPError as e: log.fatal('Failed to search config, error: ' + e.message('desc')) raise diff --git a/dirsrvtests/tests/suites/cos_plugin/__init__.py b/dirsrvtests/tests/suites/cos_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/deref_plugin/__init__.py b/dirsrvtests/tests/suites/deref_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/distrib_plugin/__init__.py b/dirsrvtests/tests/suites/distrib_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/dna_plugin/__init__.py b/dirsrvtests/tests/suites/dna_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/dynamic-plugins/__init__.py b/dirsrvtests/tests/suites/dynamic-plugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/acct_usability_plugin/__init__.py b/dirsrvtests/tests/suites/dynamic_plugins/__init__.py similarity index 100% rename from dirsrvtests/tests/suites/acct_usability_plugin/__init__.py rename to dirsrvtests/tests/suites/dynamic_plugins/__init__.py diff --git a/dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py b/dirsrvtests/tests/suites/dynamic_plugins/dynamic_plugins_test.py similarity index 100% rename from dirsrvtests/tests/suites/dynamic-plugins/test_dynamic_plugins.py rename to dirsrvtests/tests/suites/dynamic_plugins/dynamic_plugins_test.py diff --git a/dirsrvtests/tests/suites/dynamic-plugins/plugin_tests.py b/dirsrvtests/tests/suites/dynamic_plugins/plugin_tests.py similarity index 100% rename from dirsrvtests/tests/suites/dynamic-plugins/plugin_tests.py rename to dirsrvtests/tests/suites/dynamic_plugins/plugin_tests.py diff --git a/dirsrvtests/tests/suites/dynamic-plugins/stress_tests.py b/dirsrvtests/tests/suites/dynamic_plugins/stress_tests.py similarity index 100% rename from dirsrvtests/tests/suites/dynamic-plugins/stress_tests.py rename to dirsrvtests/tests/suites/dynamic_plugins/stress_tests.py diff --git a/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py b/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py index 3fc94d7..b9fcafc 100644 --- a/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py +++ b/dirsrvtests/tests/suites/filter/rfc3673_all_oper_attrs_test.py @@ -96,13 +96,11 @@ def test_supported_features(topology_st): """Verify that OID 1.3.6.1.4.1.4203.1.5.1 is published in the supportedFeatures [RFC3674] attribute in the rootDSE. - :Feature: Filter - - :Setup: Standalone instance - - :Steps: 1. Search for 'supportedFeatures' at rootDSE - - :Assert: Value 1.3.6.1.4.1.4203.1.5.1 is presented + :ID: 441b3f1f-a24b-4943-aa65-7edce460abbf + :feature: Filter + :setup: Standalone instance + :steps: 1. Search for 'supportedFeatures' at rootDSE + :assert: Value 1.3.6.1.4.1.4203.1.5.1 is presented """ entries = topology_st.standalone.search_s('', ldap.SCOPE_BASE, @@ -122,16 +120,14 @@ def test_search_basic(topology_st, test_user, user_aci, add_attr, by a Search Request [RFC2251] with '+' (ASCII 43) filter. Please see: https://tools.ietf.org/html/rfc3673 - :Feature: Filter - - :Setup: Standalone instance, test user for binding, + :ID: 14c66bc2-28e1-4f5f-893e-508e0f720f8c + :feature: Filter + :setup: Standalone instance, test user for binding, deny one attribute aci for that user - - :Steps: 1. Bind as regular user or Directory Manager + :steps: 1. Bind as regular user or Directory Manager 2. Search with '+' filter and with additionaly 'objectClass' and '*' attrs too - - :Assert: All expected values were returned, not more + :assert: All expected values were returned, not more """ if regular_user: diff --git a/dirsrvtests/tests/suites/linkedattrs_plugin/__init__.py b/dirsrvtests/tests/suites/linkedattrs_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/memberof_plugin/__init__.py b/dirsrvtests/tests/suites/memberof_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/mep_plugin/__init__.py b/dirsrvtests/tests/suites/mep_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/paged_results/paged_results_test.py b/dirsrvtests/tests/suites/paged_results/paged_results_test.py index 149a2ea..e54e293 100644 --- a/dirsrvtests/tests/suites/paged_results/paged_results_test.py +++ b/dirsrvtests/tests/suites/paged_results/paged_results_test.py @@ -247,15 +247,15 @@ def test_search_success(topology_st, test_user, page_size, users_num): """Verify that search with a simple paged results control returns all entries it should without errors. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through added users with a simple paged control - :Assert: All users should be found + :assert: All users should be found """ users_list = add_users(topology_st, users_num, DEFAULT_SUFFIX) @@ -296,17 +296,17 @@ def test_search_limits_fail(topology_st, test_user, page_size, users_num, throws expected exceptoins when corresponding limits are exceeded. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Set limit attribute to the value that will cause an expected exception 3. Search through added users with a simple paged control - :Assert: Should fail with appropriate exception + :assert: Should fail with appropriate exception """ users_list = add_users(topology_st, users_num, DEFAULT_SUFFIX) @@ -381,16 +381,16 @@ def test_search_sort_success(topology_st, test_user): and a server side sort control returns all entries it should without errors. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through added users with a simple paged control and a server side sort control - :Assert: All users should be found and sorted + :assert: All users should be found and sorted """ users_num = 50 @@ -427,16 +427,16 @@ def test_search_abandon(topology_st, test_user): """Verify that search with simple paged results control can be abandon - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through added users with a simple paged control 3. Abandon the search - :Assert: It will throw an ldap.TIMEOUT exception, while trying + :assert: It will throw an ldap.TIMEOUT exception, while trying to get the rest of the search results """ @@ -477,18 +477,18 @@ def test_search_with_timelimit(topology_st, test_user): to completion, each with a timelimit, it wouldn't fail, if we sleep for a time more than the timelimit. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through added users with a simple paged control and timelimit set to 5 3. When the returned cookie is empty, wait 10 seconds 4. Perform steps 2 and 3 three times in a row - :Assert: No error happens + :assert: No error happens """ users_num = 100 @@ -557,12 +557,12 @@ def test_search_dns_ip_aci(topology_st, test_user, aci_subject): """Verify that after performing multiple simple paged searches to completion on the suffix with DNS or IP based ACI - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Back up and remove all previous ACI from suffix + :steps: 1. Back up and remove all previous ACI from suffix 2. Add an anonymous ACI for DNS check 3. Bind as test user 4. Search through added users with a simple paged control @@ -571,7 +571,7 @@ def test_search_dns_ip_aci(topology_st, test_user, aci_subject): 7. Go through all steps onece again, but use IP subjectdn insted of DNS - :Assert: No error happens, all users should be found and sorted + :assert: No error happens, all users should be found and sorted """ users_num = 100 @@ -631,17 +631,17 @@ def test_search_multiple_paging(topology_st, test_user): """Verify that after performing multiple simple paged searches on a single connection without a complition, it wouldn't fail. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Initiate the search with a simple paged control 3. Acquire the returned cookie only one time 4. Perform steps 2 and 3 three times in a row - :Assert: No error happens + :assert: No error happens """ users_num = 100 @@ -691,17 +691,17 @@ def test_search_invalid_cookie(topology_st, test_user, invalid_cookie): search with the simple paged results control throws a TypeError exception - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Initiate the search with a simple paged control 3. Put an invalid cookie (-1, 1000) to the control 4. Continue the search - :Assert: It will throw an TypeError exception + :assert: It will throw an TypeError exception """ users_num = 100 @@ -744,16 +744,16 @@ def test_search_abandon_with_zero_size(topology_st, test_user): """Verify that search with simple paged results control can be abandon using page_size = 0 - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through added users with a simple paged control and page_size = 0 - :Assert: No cookie should be returned at all + :assert: No cookie should be returned at all """ users_num = 10 @@ -793,17 +793,17 @@ def test_search_pagedsizelimit_success(topology_st, test_user): returns all entries it should without errors while valid value set to nsslapd-pagedsizelimit. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 10 users for the search base - :Steps: 1. Set nsslapd-pagedsizelimit: 20 + :steps: 1. Set nsslapd-pagedsizelimit: 20 2. Bind as test user 3. Search through added users with a simple paged control using page_size = 10 - :Assert: All users should be found + :assert: All users should be found """ users_num = 10 @@ -845,12 +845,12 @@ def test_search_nspagedsizelimit(topology_st, test_user, nsslapd-pagedsizelimit while performing search with the simple paged results control. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 10 users for the search base - :Steps: 1. Set nsslapd-pagedsizelimit: 5 + :steps: 1. Set nsslapd-pagedsizelimit: 5 2. Set nsPagedSizeLimit: 15 3. Bind as test user 4. Search through added users with a simple paged control @@ -863,7 +863,7 @@ def test_search_nspagedsizelimit(topology_st, test_user, 10. Search through added users with a simple paged control using page_size = 10 - :Assert: After the steps 1-4, it should PASS. + :assert: After the steps 1-4, it should PASS. After the steps 7-10, it should throw SIZELIMIT_EXCEEDED exception """ @@ -915,12 +915,12 @@ def test_search_paged_limits(topology_st, test_user, conf_attr_values, expected_ nsslapd-lookthroughlimit can limit the administrator search abilities. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 10 users for the search base - :Steps: 1. Set nsslapd-sizelimit and nsslapd-pagedsizelimit to 5000 + :steps: 1. Set nsslapd-sizelimit and nsslapd-pagedsizelimit to 5000 2. Set nsslapd-idlistscanlimit: 120 3. Set nsslapd-lookthroughlimit: 122 4. Bind as test user @@ -933,7 +933,7 @@ def test_search_paged_limits(topology_st, test_user, conf_attr_values, expected_ 10. Search through added users with a simple paged control using page_size = 10 - :Assert: After the steps 1-4, it should PASS. + :assert: After the steps 1-4, it should PASS. After the steps 7-10, it should throw ADMINLIMIT_EXCEEDED exception """ @@ -992,12 +992,12 @@ def test_search_paged_user_limits(topology_st, test_user, conf_attr_values, expe override nsslapd-idlistscanlimit and nsslapd-lookthroughlimit while performing search with the simple paged results control. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 10 users for the search base - :Steps: 1. Set nsslapd-idlistscanlimit: 1000 + :steps: 1. Set nsslapd-idlistscanlimit: 1000 2. Set nsslapd-lookthroughlimit: 1000 3. Set nsPagedIDListScanLimit: 120 4. Set nsPagedLookthroughLimit: 122 @@ -1011,7 +1011,7 @@ def test_search_paged_user_limits(topology_st, test_user, conf_attr_values, expe 11. Search through added users with a simple paged control using page_size = 10 - :Assert: After the steps 1-4, it should PASS. + :assert: After the steps 1-4, it should PASS. After the steps 8-11, it should throw ADMINLIMIT_EXCEEDED exception """ @@ -1067,15 +1067,15 @@ def test_ger_basic(topology_st, test_user): and get effective rights control returns all entries it should without errors. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, variated number of users for the search base - :Steps: 1. Search through added users with a simple paged control + :steps: 1. Search through added users with a simple paged control and get effective rights control - :Assert: All users should be found, every found entry should have + :assert: All users should be found, every found entry should have an 'attributeLevelRights' returned """ @@ -1107,19 +1107,19 @@ def test_multi_suffix_search(topology_st, test_user, new_suffixes): """Verify that page result search returns empty cookie if there is no returned entry. - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, two suffixes with backends, one is inserted into another, 10 users for the search base within each suffix - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Search through all 20 added users with a simple paged control using page_size = 4 3. Wait some time logs to be updated 3. Check access log - :Assert: All users should be found, the access log should contain + :assert: All users should be found, the access log should contain the pr_cookie for each page request and it should be equal 0, except the last one should be equal -1 """ @@ -1167,17 +1167,17 @@ def test_multi_suffix_search(topology_st, test_user, new_suffixes): def test_maxsimplepaged_per_conn_success(topology_st, test_user, conf_attr_value): """Verify that nsslapd-maxsimplepaged-per-conn acts according design - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 20 users for the search base - :Steps: 1. Set nsslapd-maxsimplepaged-per-conn in cn=config + :steps: 1. Set nsslapd-maxsimplepaged-per-conn in cn=config to the next values: no value, -1, some positive 2. Search through the added users with a simple paged control using page size = 4 - :Assert: If no value or value = -1 - all users should be found, + :assert: If no value or value = -1 - all users should be found, default behaviour; If the value is positive, the value is the max simple paged results requests per connection. @@ -1216,19 +1216,19 @@ def test_maxsimplepaged_per_conn_success(topology_st, test_user, conf_attr_value def test_maxsimplepaged_per_conn_failure(topology_st, test_user, conf_attr_value): """Verify that nsslapd-maxsimplepaged-per-conn acts according design - :Feature: Simple paged results + :feature: Simple paged results - :Setup: Standalone instance, test user for binding, + :setup: Standalone instance, test user for binding, 20 users for the search base - :Steps: 1. Set nsslapd-maxsimplepaged-per-conn = 0 in cn=config + :steps: 1. Set nsslapd-maxsimplepaged-per-conn = 0 in cn=config 2. Search through the added users with a simple paged control using page size = 4 3. Set nsslapd-maxsimplepaged-per-conn = 1 in cn=config 4. Search through the added users with a simple paged control using page size = 4 two times, but don't close the connections - :Assert: During the searches UNWILLING_TO_PERFORM should be throwned + :assert: During the searches UNWILLING_TO_PERFORM should be throwned """ users_list = add_users(topology_st, 20, DEFAULT_SUFFIX) diff --git a/dirsrvtests/tests/suites/pam_passthru_plugin/__init__.py b/dirsrvtests/tests/suites/pam_passthru_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/passthru_plugin/__init__.py b/dirsrvtests/tests/suites/passthru_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/password/pwdPolicy_attribute_test.py b/dirsrvtests/tests/suites/password/pwdPolicy_attribute_test.py index c0ee044..d076cf4 100644 --- a/dirsrvtests/tests/suites/password/pwdPolicy_attribute_test.py +++ b/dirsrvtests/tests/suites/password/pwdPolicy_attribute_test.py @@ -122,17 +122,17 @@ def test_change_pwd(topology_st, test_user, password_policy, """Verify that 'passwordChange' attr works as expected User should have a priority over a subtree. - :Feature: Password policy + :feature: Password policy - :Setup: Standalone instance, test user, + :setup: Standalone instance, test user, password policy entries for a user and a subtree - :Steps: 1. Set passwordChange on the user and the subtree + :steps: 1. Set passwordChange on the user and the subtree to various combinations 2. Bind as test user 3. Try to change password - :Assert: Subtree/User passwordChange - result + :assert: Subtree/User passwordChange - result off/on, on/on - success on/off, off/off - UNWILLING_TO_PERFORM """ @@ -191,20 +191,18 @@ def test_pwd_min_age(topology_st, test_user, password_policy): should not allow the user to change the password within 10 seconds after his previous change. - :Feature: Password policy - - :Setup: Standalone instance, test user, + :ID: 85b98516-8c82-45bd-b9ec-90bd1245e09c + :feature: Password policy + :setup: Standalone instance, test user, password policy entries for a user and a subtree - - :Steps: 1. Set passwordMinAge to 10 on the user pwpolicy entry + :steps: 1. Set passwordMinAge to 10 on the user pwpolicy entry 2. Set passwordMinAge to 10 on the subtree pwpolicy entry 3. Set passwordMinAge to 10 on the cn=config entry 4. Bind as test user 5. Try to change password two times in a row 6. Wait 12 seconds 7. Try to change password - - :Assert: User should be not allowed to change the password + :assert: User should be not allowed to change the password right after previous change - CONSTRAINT_VIOLATION User should be not allowed to change the password after 12 seconds passed diff --git a/dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py b/dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py index 38a7950..fddbd49 100644 --- a/dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py +++ b/dirsrvtests/tests/suites/password/pwdPolicy_inherit_global_test.py @@ -146,20 +146,18 @@ def test_entry_has_no_restrictions(topology_st, password_policy, test_user, - 'passwordCheckSyntax' is 'on' for 'nsslapd-pwpolicy-inherit-global' equaled 'off' - :Feature: Password policy - - :Setup: Standalone instance, test user, + :ID: 2f07ff40-76ca-45a9-a556-331c94084945 + :feature: Password policy + :setup: Standalone instance, test user, password policy entries for a subtree - - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Set 'nsslapd-pwpolicy-inherit-global' and 'passwordCheckSyntax' accordingly: a) 'off' and 'off' b) 'on' and 'off' c) 'off' and 'on' 3. Try to add user with a short password - - :Assert: No exception should occure + :assert: No exception should occure """ log.info('Set {} to {}'.format(ATTR_INHERIT_GLOBAL, inherit_value)) @@ -210,12 +208,11 @@ def test_entry_has_restrictions(topology_st, password_policy, test_user, contain syntax rules work, if set them at both: cn=config and ou=people policy container. - :Feature: Password policy - - :Setup: Standalone instance, test user, + :ID: 4bb0f474-17c1-40f7-aab4-4ddc17d019e8 + :feature: Password policy + :setup: Standalone instance, test user, password policy entries for a subtree - - :Steps: 1. Bind as test user + :steps: 1. Bind as test user 2. Switch 'nsslapd-pwpolicy-inherit-global: on' 3. Switch 'passwordCheckSyntax: on' 4. Set 'passwordMinLength: 9' to: @@ -223,8 +220,7 @@ def test_entry_has_restrictions(topology_st, password_policy, test_user, contain b) ou=people policy container 5. Try to add user with a short password (<9) 6. Try to add user with a long password (>9) - - :Assert: User should be rejected + :assert: User should be rejected """ log.info('Set {} to {}'.format(ATTR_INHERIT_GLOBAL, 'on')) diff --git a/dirsrvtests/tests/suites/password/pwdPolicy_warning_test.py b/dirsrvtests/tests/suites/password/pwdPolicy_warning_test.py index 468131d..bc7175a 100644 --- a/dirsrvtests/tests/suites/password/pwdPolicy_warning_test.py +++ b/dirsrvtests/tests/suites/password/pwdPolicy_warning_test.py @@ -232,17 +232,15 @@ def test_different_values(topology_st, value): """Try to set passwordSendExpiringTime attribute to various values both valid and invalid - :Feature: Password Expiry Warning Time - - :Setup: Standalone DS instance - - :Steps: 1. Try to set valid and invalid values + :ID: 3e6d79fb-b4c8-4860-897e-5b207815a75d + :feature: Password Expiry Warning Time + :setup: Standalone DS instance + :steps: 1. Try to set valid and invalid values for passwordSendExpiringTime attribute under cn=config entry 2. Run the search command to check the value of passwordSendExpiringTime attribute - - :Assert: 1. Invalid values should be rejected with + :assert: 1. Invalid values should be rejected with an OPERATIONS_ERROR 2. Valid values should be accepted and saved """ @@ -276,20 +274,18 @@ def test_expiry_time(topology_st, global_policy, add_user): """Test whether the password expiry warning time for a user is returned appropriately - :Feature: Pasword Expiry Warning Time - - :Setup: Standalone DS instance with, + :ID: 7adfd395-9b25-4cc0-9b71-14710dc1a28c + :feature: Pasword Expiry Warning Time + :setup: Standalone DS instance with, 1. Global password policy configured as below: passwordExp: on passwordMaxAge: 172800 passwordWarning: 86400 passwordSendExpiringTime: on 2. User entry for binding - - :Steps: 1. Bind as the user + :steps: 1. Bind as the user 2. Request the control for the user - - :Assert: The password expiry warning time for the user should be + :assert: The password expiry warning time for the user should be returned """ @@ -317,28 +313,23 @@ def test_password_warning(topology_st, global_policy, add_user, attr, val): setting passwordSendExpiringTime to off and setting passwordWarning to a short value - :Feature: Password Expiry Warning Time - - :Setup: Standalone DS instance with, + :ID: 39f54b3c-8c80-43ca-856a-174d81c56ce8 + :feature: Password Expiry Warning Time + :setup: Standalone DS instance with, 1. Global password policy configures as below: passwordExp: on passwordMaxAge: 172800 passwordWarning: 86400 passwordSendExpiringTime: on 2. User entry for binding - - :Steps: 1. Set passwordSendExpiringTime attribute to off + :steps: 1a. Set passwordSendExpiringTime attribute to off. + 1b. In the another attempt, try to set passwordWarning + to a small value (for eg: 3600 seconds) 2. Bind as the user - 3. Request the control for the user - - :Assert: Password expiry warning time should not be returned - - :Steps: 1. Set passwordWarning to a small value - (for eg: 3600 seconds) - 2. Bind with the user and request the password expiry warning - time - - :Assert: Password expiry warning time should be returned + 3a. Request the control for the user + 3b. Request the password expiry warning time + :assert: a. Password expiry warning time should not be returned + b. Password expiry warning time should be returned """ try: @@ -364,24 +355,22 @@ def test_password_warning(topology_st, global_policy, add_user, attr, val): def test_with_different_password_states(topology_st, global_policy, add_user): """Test the control with different password states - :Feature: Password Expiry Warning Time - - :Setup: Standalone DS instance with, + :ID: d297fb1a-661f-4d52-bb43-2a2a340b8b0e + :feature: Password Expiry Warning Time + :setup: Standalone DS instance with, 1. Global password policy configured as below: passwordExp: on passwordMaxAge: 172800 passwordWarning: 86400 passwordSendExpiringTime: on 2. User entry for binding to the server - - :Steps: 1. Expire user's password by setting the system + :steps: 1. Expire user's password by setting the system date past the valid period for the password 2. Try to bind to the server with the user entry 3. Set the system date to the current day 4. Try to bind with the user entry and request the control - - :Assert: 1. In the first try, the bind should fail with an + :assert: 1. In the first try, the bind should fail with an INVALID_CREDENTIALS error 2. In the second try, the bind should be successful and the password expiry warning time should be @@ -428,20 +417,18 @@ def test_default_behavior(topology_st, global_policy_default, add_user): """Test the default behavior of password expiry warning time - :Feature: Password Expiry Warning Time - - :Setup: Standalone DS instance with, + :ID: c47fa824-ee08-4b78-885f-bca4c42bb655 + :feature: Password Expiry Warning Time + :setup: Standalone DS instance with, 1. Global password policy configured as follows, passwordExp: on passwordMaxAge: 86400 passwordWarning: 86400 passwordSendExpiringTime: off 2. User entry for binding to the server - - :Steps: 1. Bind as the user + :steps: 1. Bind as the user 2. Request the control for the user - - :Assert: Password expiry warning time should be returned by the + :assert: Password expiry warning time should be returned by the server by the server since passwordMaxAge and passwordWarning are set to the same value """ @@ -467,9 +454,9 @@ def test_with_local_policy(topology_st, global_policy, local_policy): """Test the attribute with fine grained policy set for the user - :Feature: Password Expiry Warning Time - - :Setup: Standalone DS instance with, + :ID: ab7d9f86-8cfe-48c3-8baa-739e599f006a + :feature: Password Expiry Warning Time + :setup: Standalone DS instance with, 1. Global password policy configured as below, passwordExp: on passwordMaxAge: 172800 @@ -480,11 +467,9 @@ def test_with_local_policy(topology_st, global_policy, local_policy): as below: ns-newpwpolicy.pl -D 'cn=Directory Manager' -w secret123 -h localhost -p 389 -U 'uid=tuser,dc=example,dc=com' - - :Steps: 1. Bind as the user + :steps: 1. Bind as the user 2. Request the control for the user - - :Assert: Password expiry warning time should not be returned for the + :assert: Password expiry warning time should not be returned for the user """ diff --git a/dirsrvtests/tests/suites/acctpolicy_plugin/__init__.py b/dirsrvtests/tests/suites/plugins/__init__.py similarity index 100% rename from dirsrvtests/tests/suites/acctpolicy_plugin/__init__.py rename to dirsrvtests/tests/suites/plugins/__init__.py diff --git a/dirsrvtests/tests/suites/acctpolicy_plugin/accpol_test.py b/dirsrvtests/tests/suites/plugins/accpol_test.py similarity index 91% rename from dirsrvtests/tests/suites/acctpolicy_plugin/accpol_test.py rename to dirsrvtests/tests/suites/plugins/accpol_test.py index 1ed13c7..1dbf505 100644 --- a/dirsrvtests/tests/suites/acctpolicy_plugin/accpol_test.py +++ b/dirsrvtests/tests/suites/plugins/accpol_test.py @@ -1,3 +1,11 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2017 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# import pytest from lib389.tasks import * from lib389.utils import * @@ -107,20 +115,18 @@ def account_status(topology_st, suffix, subtre, userid, nousrs, ulimit, tochck): def test_actNinact_local(topology_st, accpolicy_local): """Verify if user account is inactivated when accountInactivityLimit is exceeded. User is created in the default suffix. - :Feature: Account Policy Plugin - - :Setup: Standalone instance, Local account policy plugin configuration, + :ID: 470f480c-da55-47ee-9095-5ff50a6d5be1 + :feature: Account Policy Plugin + :setup: Standalone instance, Local account policy plugin configuration, accountInactivityLimit set to 15, Inactivate account by Account policy plugin - - :Steps: 1. Configure account policy plugin with accpol_local for ou=people subtree + :steps: 1. Configure account policy plugin with accpol_local for ou=people subtree 2. Set accountInactivityLimit to 15 3. Add few users to ou=people subtre in the default suffix 4. Wait for 14 secs and run ldapsearch as normal user to check if its not inactivated, expected 0. 5. Wait for 2 secs or till accountInactivityLimit is exceeded 6. Run ldapsearch as normal user and check if its inactivated, expected error 19. 7. Sleep for +14 secs to check if accounts accessed at step4 are inactivated now - - :Assert: Should return error code 19 + :assert: Should return error code 19 """ suffix = DEFAULT_SUFFIX @@ -146,17 +152,15 @@ def test_actNinact_local(topology_st, accpolicy_local): def test_noinact_local(topology_st, accpolicy_local): """Verify if user account is inactivated when moved from ou=groups to ou=people subtree. - :Feature: Account Policy Plugin - - :Setup: Standalone instance, Local account policy plugin configuration, + :ID: 235e3f00-db20-4166-9cfd-77e7c08cabdf + :feature: Account Policy Plugin + :setup: Standalone instance, Local account policy plugin configuration, accountInactivityLimit set to 15, Inactivate account by Account policy plugin - - :Steps: 1. Add few users to ou=groups subtre in the default suffix, plugin configured to ou=people subtree only. + :steps: 1. Add few users to ou=groups subtre in the default suffix, plugin configured to ou=people subtree only. 2. Wait for 16 secs and run ldapsearch as normal user to check account is active, expected 0. 3. Move users from ou=groups to ou=people subtree 4. Sleep for 16 secs and check if entries are inactivated - - :Assert: Should return error code 0 and 19 + :assert: Should return error code 0 and 19 """ suffix = DEFAULT_SUFFIX @@ -187,18 +191,16 @@ def test_noinact_local(topology_st, accpolicy_local): def test_inact_local(topology_st, accpolicy_local): """Verify if user account is inactivated when users moved from ou=people to ou=groups subtree. - :Feature: Account Policy Plugin - - :Setup: Standalone instance, Local account policy plugin configuration, + :ID: ffccf0fd-b684-4462-87ef-1ec6d3e40574 + :feature: Account Policy Plugin + :setup: Standalone instance, Local account policy plugin configuration, accountInactivityLimit set to 15, Inactivate account by Account policy plugin - - :Steps: 1. Add few users to ou=people subtre in the default suffix + :steps: 1. Add few users to ou=people subtre in the default suffix 2. Wait for 14 secs and run ldapsearch as normal user to check if its not inactivated, expected 0. 3. Move users from ou=people to ou=groups subtree 4. Sleep for +2 secs and check if users are inactivated in ou=people subtree 5. Check if users are not inactivated in ou=groups subtree - - :Assert: Should return error code 0 + :assert: Should return error code 0 """ suffix = DEFAULT_SUFFIX diff --git a/dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py b/dirsrvtests/tests/suites/plugins/attr_uniqueness_test.py similarity index 100% rename from dirsrvtests/tests/suites/attr_uniqueness_plugin/attr_uniqueness_test.py rename to dirsrvtests/tests/suites/plugins/attr_uniqueness_test.py diff --git a/dirsrvtests/tests/suites/dna_plugin/dna_test.py b/dirsrvtests/tests/suites/plugins/dna_test.py similarity index 100% rename from dirsrvtests/tests/suites/dna_plugin/dna_test.py rename to dirsrvtests/tests/suites/plugins/dna_test.py diff --git a/dirsrvtests/tests/suites/memberof_plugin/memberof_test.py b/dirsrvtests/tests/suites/plugins/memberof_test.py similarity index 100% rename from dirsrvtests/tests/suites/memberof_plugin/memberof_test.py rename to dirsrvtests/tests/suites/plugins/memberof_test.py diff --git a/dirsrvtests/tests/suites/rootdn_plugin/rootdn_plugin_test.py b/dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py similarity index 100% rename from dirsrvtests/tests/suites/rootdn_plugin/rootdn_plugin_test.py rename to dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py diff --git a/dirsrvtests/tests/suites/posix_winsync_plugin/__init__.py b/dirsrvtests/tests/suites/posix_winsync_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/referint_plugin/__init__.py b/dirsrvtests/tests/suites/referint_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py index e6f2ef7..501786f 100644 --- a/dirsrvtests/tests/suites/replication/acceptance_test.py +++ b/dirsrvtests/tests/suites/replication/acceptance_test.py @@ -1,7 +1,15 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2017 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# import pytest from lib389.tasks import * from lib389.utils import * -from lib389.topologies import topology_m4 as topo +from lib390.topologies import topology_m4 as topo TEST_ENTRY_NAME = 'mmrepl_test' TEST_ENTRY_DN = 'uid={},{}'.format(TEST_ENTRY_NAME, DEFAULT_SUFFIX) @@ -62,15 +70,13 @@ def get_repl_entries(topo, entry_name, attr_list): def test_add_entry(topo, test_entry): """Check that entries are replicated after add operation - :Feature: Multi master replication - - :Setup: Four masters replication setup - - :Steps: 1. Add entry to master1 + :ID: 024250f1-5f7e-4f3b-a9f5-27741e6fd405 + :feature: Multi master replication + :setup: Four masters replication setup + :steps: 1. Add entry to master1 2. Wait for replication to happen 3. Check entry on all other masters - - :Assert: Entry should be replicated + :assert: Entry should be replicated """ entries = get_repl_entries(topo, TEST_ENTRY_NAME, ["uid"]) @@ -80,15 +86,13 @@ def test_add_entry(topo, test_entry): def test_modify_entry(topo, test_entry): """Check that entries are replicated after modify operation - :Feature: Multi master replication - - :Setup: Four masters replication setup, an entry - - :Steps: 1. Modify the entry on master1 (try add, modify and delete operations) + :ID: 36764053-622c-43c2-a132-d7a3ab7d9aaa + :feature: Multi master replication + :setup: Four masters replication setup, an entry + :steps: 1. Modify the entry on master1 (try add, modify and delete operations) 2. Wait for replication to happen 3. Check entry on all other masters - - :Assert: Entry attr should be replicated + :assert: Entry attr should be replicated """ log.info('Modifying entry {} - add operation'.format(TEST_ENTRY_DN)) @@ -134,15 +138,13 @@ def test_modify_entry(topo, test_entry): def test_delete_entry(topo, test_entry): """Check that entry deletion is replicated after delete operation - :Feature: Multi master replication - - :Setup: Four masters replication setup, an entry - - :Steps: 1. Delete the entry from master1 + :ID: 18437262-9d6a-4b98-a47a-6182501ab9bc + :feature: Multi master replication + :setup: Four masters replication setup, an entry + :steps: 1. Delete the entry from master1 2. Wait for replication to happen 3. Check entry on all other masters - - :Assert: Entry deletion should be replicated + :assert: Entry deletion should be replicated """ log.info('Deleting entry {} during the test'.format(TEST_ENTRY_DN)) @@ -156,15 +158,13 @@ def test_delete_entry(topo, test_entry): def test_modrdn_entry(topo, test_entry, delold): """Check that entries are replicated after modrdn operation - :Feature: Multi master replication - - :Setup: Four masters replication setup, an entry - - :Steps: 1. Make modrdn operation on entry on master1 with both delold 1 and 0 + :ID: 02558e6d-a745-45ae-8d88-34fe9b16adc9 + :feature: Multi master replication + :setup: Four masters replication setup, an entry + :steps: 1. Make modrdn operation on entry on master1 with both delold 1 and 0 2. Wait for replication to happen 3. Check entry on all other masters - - :Assert: Entry with new RDN should be replicated. + :assert: Entry with new RDN should be replicated. If delold was specified, entry with old RDN shouldn't exist """ diff --git a/dirsrvtests/tests/suites/replication/single_master_test.py b/dirsrvtests/tests/suites/replication/single_master_test.py index 7c2ff27..8be6d37 100644 --- a/dirsrvtests/tests/suites/replication/single_master_test.py +++ b/dirsrvtests/tests/suites/replication/single_master_test.py @@ -1,3 +1,11 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2017 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# import pytest from lib389.tasks import * from lib389.utils import * @@ -67,19 +75,17 @@ def replica_without_init(topo_nr): def test_mail_attr_repl(topo_r, test_user): """Check that no crash happens during mail attribute replication - :Feature: Single master replication - - :Setup: Replication setup with master and consumer instances, + :ID: 959edc84-05be-4bf9-a541-53afae482052 + :feature: Single master replication + :setup: Replication setup with master and consumer instances, test user on master - - :Steps: 1. Check that user was replicated to consumer + :steps: 1. Check that user was replicated to consumer 2. Back up mail database file 3. Remove mail attribute from the user entry 4. Restore mail database 5. Search for the entry with a substring 'mail=user*' 6. Search for the entry once again to make sure that server is alive - - :Assert: No crash happens + :assert: No crash happens """ master = topo_r.ms["master1"] @@ -132,15 +138,13 @@ def test_mail_attr_repl(topo_r, test_user): def test_lastupdate_attr_before_init(topo_nr, replica_without_init): """Check that LastUpdate replica attributes show right values - :Feature: Single master replication - - :Setup: Replication setup with master and consumer instances + :ID: bc8ce431-ff65-41f5-9331-605cbcaaa887 + :feature: Single master replication + :setup: Replication setup with master and consumer instances without initialization - - :Steps: 1. Check nsds5replicaLastUpdateStart, nsds5replicaLastUpdateEnd, + :steps: 1. Check nsds5replicaLastUpdateStart, nsds5replicaLastUpdateEnd, nsds5replicaLastUpdateStatus attrs - - :Assert: nsds5replicaLastUpdateStart: 0, nsds5replicaLastUpdateEnd: 0 and + :assert: nsds5replicaLastUpdateStart: 0, nsds5replicaLastUpdateEnd: 0 and nsds5replicaLastUpdateStatus is not equal to "0 Replica acquired successfully: Incremental update started" """ diff --git a/dirsrvtests/tests/suites/replication/tombstone_test.py b/dirsrvtests/tests/suites/replication/tombstone_test.py index 83a72a3..4c623ba 100644 --- a/dirsrvtests/tests/suites/replication/tombstone_test.py +++ b/dirsrvtests/tests/suites/replication/tombstone_test.py @@ -1,3 +1,11 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2017 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# import pytest from lib389.tasks import * from lib389.utils import * @@ -7,16 +15,14 @@ from lib389.topologies import topology_st def test_purge_success(topology_st): """Verify that tombstones are created successfully - :Feature: nsTombstone - - :Setup: Standalone instance - - :Steps: 1. Enable replication to unexisting instance + :ID: adb86f50-ae76-4ed6-82b4-3cdc30ccab78 + :feature: nsTombstone + :setup: Standalone instance + :steps: 1. Enable replication to unexisting instance 2. Add an entry to the replicated suffix 3. Delete the entry 4. Check that tombstone entry exists (objectclass=nsTombstone) - - :Assert: Tombstone entry exist + :assert: Tombstone entry exist """ log.info('Setting up replication...') diff --git a/dirsrvtests/tests/suites/replsync_plugin/__init__.py b/dirsrvtests/tests/suites/replsync_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/retrocl_plugin/__init__.py b/dirsrvtests/tests/suites/retrocl_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/reverpwd_plugin/__init__.py b/dirsrvtests/tests/suites/reverpwd_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/roles_plugin/__init__.py b/dirsrvtests/tests/suites/roles_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/rootdn_plugin/__init__.py b/dirsrvtests/tests/suites/rootdn_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/schema_reload_plugin/__init__.py b/dirsrvtests/tests/suites/schema_reload_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/syntax_plugin/__init__.py b/dirsrvtests/tests/suites/syntax_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/usn_plugin/__init__.py b/dirsrvtests/tests/suites/usn_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/views_plugin/__init__.py b/dirsrvtests/tests/suites/views_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dirsrvtests/tests/suites/whoami_plugin/__init__.py b/dirsrvtests/tests/suites/whoami_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 -- 2.9.3