[PATCH] Python3 compatible modules - credentials, param, _glue

Andrew Bartlett abartlet at samba.org
Thu Dec 22 18:00:16 UTC 2016


On Fri, 2016-12-23 at 06:16 +1300, Andrew Bartlett wrote:
> On Thu, 2016-12-22 at 14:34 +0100, Lumir Balhar wrote:
> > 
> > On 12/14/2016 08:32 AM, Andrew Bartlett wrote:
> > > 
> > > 
> > > On Tue, 2016-12-13 at 12:08 +0100, Lumir Balhar wrote:
> > > > 
> > > > 
> > > > Hello.
> > > > 
> > > > The changes in this patchset port the samba.credentials,
> > > > samba.param
> > > > and
> > > > samba._glue modules to Python 3 compatible form. This patchset
> > > > also
> > > > contains a
> > > > lot of new tests of mentioned modules. The file compat.py will
> > > > help
> > > > us
> > > > with porting and to make the future code more readable.
> > > Thanks for all the hard work, and for addressing my feedback on
> > > the
> > > exceptions.  I guess you could imagine that I'm hoping you can
> > > port
> > > samba._ldb soon, so we can get that PY3 test out of
> > > samba/__init__.py.
> > > 
> > > I'll give this a closer look as soon as I can.
> > > 
> > > Thanks,
> > > 
> > > Andrew Bartlett
> > > 
> > Hello.
> > 
> > Thank you for starting the review.
> > 
> > I am currently working on the samba._ldb module, but it has a long 
> > dependency line that includes auth, params, a lot of the RPC
> > modules, 
> > and more. 
> 
> Drat.  I hadn't spotted that. 
> 
> > 
> > Nevertheless, I've managed to port the dependency tree and it 
> > seems to work.
> 
> Wow!
> 
> > 
> > But the next problem I have to solve is tests. The modules
> > mentioned 
> > above have no separate tests for each of them, and to run a more
> > complex 
> > test suites (like the raw test of DCERPC) I need to port more
> > modules 
> > which are included in this complex test suites -- for example NDR.
> > 
> > So, yes, I am working on it and it's progressing well, but it will
> > take 
> > some time to have all the test dependencies prepared and tested as
> > well.
> > 
> > Thank you very much for your cooperation and have a nice day.
> > Lumír
> 
> Thank you for all your hard work!
> 
> Andrew Bartlett

BTW, if writing new tests, then a test of pyauth to confirm that
system_session() et al return reasonable structures would be really
cool.  On the flip side, the py_auth_context_new() call is at least a
little tested by the gensec tests, so that may not be as painful.

Now you are getting to the hard stuff - the PIDL generated NDR code.  I
think you would agree that where this where it gets difficult, but it
is also essentially the finish line as I see it.  (There really isn't
much else, is there?). 

Perhaps skip the raw DCE/RPC tests, add some expected value testing to
samba/tests/auth.py and run samba/tests/gensec.py?  

We can cut the dependency chain at pyrpc_util.c by cutting the
NDR/python helpers into pyndr_util_import_export.c (including 
py_return_ndr_struct() / pyrpc_{import,export}_union()).  That way you
don't need to port and convert py_dcerpc_run_function(). 

Would this cover enough to make this work, eliminate IS_PY3 in the
runtime code, but not require you to convert the world at once?

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list