|
|
|
@ -14,9 +14,9 @@ class TestParsingMethods:
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('', 'rc_interactive'): ['"NO"'],
|
|
|
|
|
('', 'instance'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'opts_conf'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'opts'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
('', 'INSTANCE'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'OPTS_CONF'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'OPTS'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text, '/path/to/template')
|
|
|
|
|
assert openrc_object._document_dictionary == result
|
|
|
|
@ -35,9 +35,9 @@ class TestParsingMethods:
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('', 'rc_interactive'): ['"NO"'],
|
|
|
|
|
('', 'instance'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'opts_conf'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'opts'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
('', 'INSTANCE'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'OPTS_CONF'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'OPTS'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text, '/path/to/template')
|
|
|
|
|
assert openrc_object._document_dictionary == result
|
|
|
|
@ -51,9 +51,9 @@ class TestParsingMethods:
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('!', 'rc_interactive'): ['"NO"'],
|
|
|
|
|
('-', 'instance'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'opts_conf'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('!', 'opts'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
('-', 'INSTANCE'): ['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'OPTS_CONF'): ['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('!', 'OPTS'): ['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text, '/path/to/template')
|
|
|
|
|
assert openrc_object._document_dictionary == result
|
|
|
|
@ -75,13 +75,13 @@ class TestParsingMethods:
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('', 'rc_interactive'):
|
|
|
|
|
['# If you have multiple slapd instances per #376699, this will provide a default config', '"NO"'],
|
|
|
|
|
('', 'instance'):
|
|
|
|
|
('', 'INSTANCE'):
|
|
|
|
|
['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'opts_conf'):
|
|
|
|
|
('', 'OPTS_CONF'):
|
|
|
|
|
['# Comment1',
|
|
|
|
|
'# Comment2',
|
|
|
|
|
'"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'opts'):
|
|
|
|
|
('', 'OPTS'):
|
|
|
|
|
['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text, '/path/to/template')
|
|
|
|
@ -104,11 +104,11 @@ class TestParsingMethods:
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('', 'rc_interactive'):
|
|
|
|
|
['"NO"'],
|
|
|
|
|
('', 'instance'):
|
|
|
|
|
('', 'INSTANCE'):
|
|
|
|
|
['"openldap${SVCNAME#slapd}"'],
|
|
|
|
|
('', 'opts_conf'):
|
|
|
|
|
('', 'OPTS_CONF'):
|
|
|
|
|
['"-f /etc/${INSTANCE}/slapd.conf"'],
|
|
|
|
|
('', 'opts'):
|
|
|
|
|
('', 'OPTS'):
|
|
|
|
|
['"${OPTS_CONF} -h \'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock\'"']})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text, '/path/to/template',
|
|
|
|
@ -123,8 +123,8 @@ class TestParsingMethods:
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
result = OrderedDict({('!', 'rc_interactive'): ['"NO"'],
|
|
|
|
|
('!', 'instance'): [],
|
|
|
|
|
('!', 'opts_conf'): []})
|
|
|
|
|
('!', 'INSTANCE'): [],
|
|
|
|
|
('!', 'OPTS_CONF'): []})
|
|
|
|
|
|
|
|
|
|
openrc_object = OpenRCFormat(document_text,
|
|
|
|
|
'/path/to/template')
|
|
|
|
@ -224,7 +224,7 @@ OPTS_CONF="-f /etc/${INSTANCE}/slapd.conf"
|
|
|
|
|
# If you have multiple slapd instances per #376699, this will provide a default config
|
|
|
|
|
rc_interactive="NO"
|
|
|
|
|
|
|
|
|
|
instance="openldap${SVCNAME#slapd}"
|
|
|
|
|
INSTANCE="openldap${SVCNAME#slapd}"
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
@ -249,6 +249,7 @@ OPTS_CONF="-f /etc/${INSTANCE}/slapd.conf"
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
template_text = '''
|
|
|
|
|
RC_INTERACTIVE="NO"
|
|
|
|
|
!OPTS_CONF
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
@ -258,9 +259,9 @@ OPTS_CONF="-f /etc/${INSTANCE}/slapd.conf"
|
|
|
|
|
# /path/to/template
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
# If you have multiple slapd instances per #376699, this will provide a default config
|
|
|
|
|
rc_interactive="NO"
|
|
|
|
|
RC_INTERACTIVE="NO"
|
|
|
|
|
|
|
|
|
|
instance="openldap${SVCNAME#slapd}"
|
|
|
|
|
INSTANCE="openldap${SVCNAME#slapd}"
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
@ -297,7 +298,7 @@ OPTS_CONF="-f /etc/${INSTANCE}/slapd.conf"
|
|
|
|
|
# If you have multiple slapd instances per #376699, this will provide a default config
|
|
|
|
|
rc_interactive="NO"
|
|
|
|
|
|
|
|
|
|
instance="openldap${SVCNAME#slapd}"
|
|
|
|
|
INSTANCE="openldap${SVCNAME#slapd}"
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|