| 1 |
|
| 2 |
# --- BEGIN COPYRIGHT BLOCK --- |
| 3 |
# Copyright (C) 2020 William Brown <[email protected]> |
| 4 |
# All rights reserved. |
| 5 |
# |
| 6 |
# License: GPL (version 3 or any later version). |
| 7 |
# See LICENSE for details. |
| 8 |
# --- END COPYRIGHT BLOCK --- |
| 9 |
|
| 10 |
import logging |
| 11 |
import ldap |
| 12 |
import time |
| 13 |
import pytest |
| 14 |
from test389.topologies import topology_st as topology |
| 15 |
from lib389.utils import ds_is_older |
| 16 |
from lib389.paths import Paths |
| 17 |
from lib389.plugins import MemberOfPlugin |
| 18 |
|
| 19 |
default_paths = Paths() |
| 20 |
pytestmark = pytest.mark.tier1 |
| 21 |
|
| 22 |
log = logging.getLogger(__name__) |
| 23 |
|
| 24 |
@pytest.mark.skipif(ds_is_older('1.4.4.0'), reason="Notice not generated in older versions") |
| 25 |
def test_notice_when_dynamic_not_enabled(topology): |
| 26 |
""" Test to show the logged noticed when dynamic plugins is disabled. |
| 27 |
|
| 28 |
:id: e4923789-c187-44b0-8734-34f26cbae06e |
| 29 |
|
| 30 |
:setup: Standalone instance |
| 31 |
|
| 32 |
:steps: |
| 33 |
1. Ensure Dynamic Plugins is disabled |
| 34 |
2. Enable a plugin |
| 35 |
|
| 36 |
:expectedresults: |
| 37 |
1. Success |
| 38 |
2. Notice generated |
| 39 |
""" |
| 40 |
st = topology.standalone |
| 41 |
|
| 42 |
st.config.set("nsslapd-dynamic-plugins", "off") |
| 43 |
st.restart() |
| 44 |
|
| 45 |
mo = MemberOfPlugin(st) |
| 46 |
mo.enable() |
| 47 |
# Now check the error log. |
| 48 |
pattern = ".*nsslapd-dynamic-plugins is off.*" |
| 49 |
assert st.ds_error_log.match(pattern) |
| 50 |
|
| 51 |
|