On Tue, 2017-03-14 at 13:32 +0000, Ankit Yadav wrote:
> I solved the error in /lib389/__init__.py  line number 526 was 
> 
> this code ==>  self.inst = self.serverid at line 526 was above this code ==>  
> self.serverid = args.get(SER_SERVERID_PROP, None). Now here we someone has 
> tried to assign self.serverid to self.inst before self.serverid has been 
> assigned from agrs.
> 

Can you send me the output of 

rpm -qa | grep lib389

and what the command line to run the tests is you are using?

I find that the best way is:

yum install "389*"
git clone .../lib389.git
cd lib389
sudo PYTHONPATH=`pwd` py.test -s lib389/<test name>

IE:

{william@ldapkdc 10:56} ~/development/389ds/lib389 I0> sudo
PYTHONPATH=`pwd` py.test -s lib389/tests/aci_test.py 
===============================================================================================
 test session starts 
===============================================================================================
platform linux2 -- Python 2.7.5 -- py-1.4.27 -- pytest-2.7.0
rootdir: /home/william/development/389ds/lib389, inifile: 
collected 2 items 

lib389/tests/aci_test.py OK group dirsrv exists
OK user dirsrv exists
{'allow': [{'values': ['read', 'search', 'write']}], 'target': [],
'targetattr': [{'values': ['uniqueMember', 'member'], 'equal': True}],
'targattrfilters': [], 'deny': [], 'acl': [{'values': ['Allow test
aci']}], 'deny_raw_bindrules': [], 'targetattrfilters': [],
'allow_raw_bindrules': [{'values':
['userdn="ldap:///dc=example,dc=com??sub?(ou=engineering)" and
userdn="ldap:///dc=example,dc=com??sub?(manager=uid=wbrown,ou=managers,dc=example,dc=com)
 || 
ldap:///dc=example,dc=com??sub?(manager=uid=tbrown,ou=managers,dc=example,dc=com)"
 ']}], 'targetfilter': [{'values': ['(ou=groups)'], 'equal': True}], 
'targetscope': [], 'version 3.0;': [], 'rawaci': '(targetfilter 
="(ou=groups)")(targetattr ="uniqueMember || member")(version 3.0; acl "Allow 
test aci";allow (read, search, 
write)(userdn="ldap:///dc=example,dc=com??sub?(ou=engineering)" and 
userdn="ldap:///dc=example,dc=com??sub?(manager=uid=wbrown,ou=managers,dc=example,dc=com)
 || 
ldap:///dc=example,dc=com??sub?(manager=uid=tbrown,ou=managers,dc=example,dc=com)"
 );)'}
..Instance slapd-standalone removed.


============================================================================================
 2 passed in 7.90 seconds


I don't expect you to be able to run the full test suite, just target
the ones you are working on. In this case the cli tests in:

lib389/tests/cli/

IE

sudo PYTHONPATH=`pwd` py.test -s lib389/tests/cli/conf_backend.py



> I moved the assignment ==> self.inst = self.serverid below where the serverid 
> was assigned from args. This is how I solved the first error.
> Now I am getting some other errors don't know how to resolve them below.
> 
> Now I am unable to setup and teardown because there is one error 
> 
> self = <ConfigParser.SafeConfigParser instance at 0x7f90c4b09248>, section = 
> 'slapd'
> option = 'error_log', raw = False, vars = None
> 
>     def get(self, section, option, raw=False, vars=None):
>         """Get an option value for a given section.
>     
>             If `vars' is provided, it must be a dictionary. The option is 
> looked up
>             in `vars' (if provided), `section', and in `defaults' in that 
> order.
>     
>             All % interpolations are expanded in the return values, unless the
>             optional argument `raw' is true. Values for interpolation keys are
>             looked up in the same manner as the option.
>     
>             The section DEFAULT is special.
>             """
>         sectiondict = {}
>         try:
>             sectiondict = self._sections[section]
>         except KeyError:
>             if section != DEFAULTSECT:
>                 raise NoSectionError(section)
>         # Update with the entry specific variables
>         vardict = {}
>         if vars:
>             for key, value in vars.items():
>                 vardict[self.optionxform(key)] = value
>         d = _Chainmap(vardict, sectiondict, self._defaults)
>         option = self.optionxform(option)
>         try:
>             value = d[option]
>         except KeyError:
> >           raise NoOptionError(option, section)
> E           NoOptionError: No option 'error_log' in section: 'slapd'
> 
> /usr/lib64/python2.7/ConfigParser.py:618: NoOptionError
> 
> This error is coming in 42 test cases.
> test summary ==>  5 failed, 28 passed, 42 error in 101.93 seconds
>  
> _______________________________________________
> 389-devel mailing list -- 389-devel@lists.fedoraproject.org
> To unsubscribe send an email to 389-devel-le...@lists.fedoraproject.org

-- 
Sincerely,

William Brown
Software Engineer
Red Hat, Australia/Brisbane

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
389-devel mailing list -- 389-devel@lists.fedoraproject.org
To unsubscribe send an email to 389-devel-le...@lists.fedoraproject.org

Reply via email to