Skip to content

Commit

Permalink
Issue 6619 - test_dblib_migration fails on RHEL10 (#6620)
Browse files Browse the repository at this point in the history
* Issue 6619 - test_dblib_migration fails on RHEL10
Test test_dblib_migration fails on RHEL10 because bdb is not supported.
Test should be skipped in that case and libdb should provide a function to check if server can starts on bdb

Issue: #6619

Reviewed by: @jchapma (Thanks!)
  • Loading branch information
progier389 authored Feb 19, 2025
1 parent fc3439c commit c79c1eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dirsrvtests/tests/suites/clu/dsctl_dblib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
import time
from lib389._constants import DEFAULT_SUFFIX
from lib389.backend import DatabaseConfig
from lib389.cli_ctl.dblib import (FakeArgs, dblib_bdb2mdb, dblib_mdb2bdb, dblib_cleanup)
from lib389.cli_ctl.dblib import (
FakeArgs,
dblib_bdb2mdb,
dblib_cleanup,
is_bdb_supported)
from lib389.idm.user import UserAccounts
from lib389.replica import ReplicationManager
from lib389.topologies import topology_m2 as topo_m2, topology_st as topo_st
Expand Down Expand Up @@ -87,6 +91,7 @@ def _check_db(inst, log, impl):
assert db_files == mdb_list


@pytest.mark.skipif(is_bdb_supported() is False, reason='This test requires bdb support')
def test_dblib_migration(init_user):
"""
Verify dsctl dblib xxxxxxx sub commands (migration between bdb and lmdb)
Expand Down
10 changes: 9 additions & 1 deletion src/lib389/lib389/cli_ctl/dblib.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, *args, **kwargs):

def get_bdb_impl_status():
backldbm = 'libback-ldbm'
bundledbdb_plugin = 'libback-ldbm'
bundledbdb_plugin = 'libback-bdb'
robdb_symbol = 'bdbro_getcb_vector'
libdb = 'libdb-'
plgstrs = check_plugin_strings(backldbm, [bundledbdb_plugin, robdb_symbol, libdb])
Expand All @@ -70,6 +70,14 @@ def get_bdb_impl_status():
return BDB_IMPL_STATUS.UNKNOWN


def is_bdb_supported(read_write=True):
bdbok = [BDB_IMPL_STATUS.BUNDLED, BDB_IMPL_STATUS.STANDARD]
if not read_write:
# READ_MODE is ok too
bdbok.append(BDB_IMPL_STATUS.READ_ONLY)
return get_bdb_impl_status() in bdbok


def get_ldif_dir(instance):
"""
Get the server's LDIF directory.
Expand Down

0 comments on commit c79c1eb

Please sign in to comment.