Debian Codegraph @

dirsrvtests/tests/suites/openldap_2_389/migrate_hdb_test.py

raw
1 # --- BEGIN COPYRIGHT BLOCK ---
2 # Copyright (C) 2021 William Brown <[email protected]>
3 # All rights reserved.
4 #
5 # License: GPL (version 3 or any later version).
6 # See LICENSE for details.
7 # --- END COPYRIGHT BLOCK ---
8 #
9 import pytest
10 import os
11 from test389.topologies import topology_st
12 from lib389.utils import ds_is_older
13 from lib389.migrate.openldap.config import olConfig
14 from lib389.migrate.openldap.config import olOverlayType
15 from lib389.migrate.plan import Migration
16
17 pytestmark = pytest.mark.tier1
18
19 DATADIR1 = os.path.join(os.path.dirname(__file__), '../../data/openldap_2_389/4539/')
20
21 @pytest.mark.skipif(ds_is_older('1.4.3'), reason="Not implemented")
22 def test_migrate_openldap_hdb(topology_st):
23 """Attempt a migration with HDB and no overlay configuration folder.
24
25 :id: 377dbdee-7138-47d9-a518-9e0b0f4d8622
26 :setup: Data directory with an openldap config with HDB database.
27 :steps:
28 1. Parse the configuration
29 2. Execute a full migration plan
30
31 :expectedresults:
32 1. Success
33 2. Success
34 """
35
36 inst = topology_st.standalone
37 config_path = os.path.join(DATADIR1, 'slapd.d')
38 config = olConfig(config_path)
39 ldifs = {}
40
41 migration = Migration(inst, config.schema, config.databases, ldifs)
42
43 print("==== migration plan ====")
44 print(migration.__unicode__())
45 print("==== end migration plan ====")
46
47 migration.execute_plan()
48 # End test, should suceed with no exceptions.