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

Andrew Bartlett abartlet at samba.org
Thu Jan 5 18:10:33 UTC 2017


On Thu, 2017-01-05 at 14:01 +0100, Lumir Balhar wrote:
> On 12/22/2016 07:00 PM, Andrew Bartlett wrote:
> > 
> > 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.
> Ok, perfect. I'll prepare some tests for testing result of 
> system_session() and underlying arguments, objects and values.
> > 
> > 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?).
> I already met PIDL generated stuff during porting of DCE/RPC so it
> won't 
> be new for me. My next patchset will contain a lot of changes in
> PIDL 
> Python parser.

That will be interesting :-)

> > 
> > Perhaps skip the raw DCE/RPC tests, add some expected value testing
> > to
> > samba/tests/auth.py and run samba/tests/gensec.py?
> Ok, I can skip tests of DCE/RPC and run tests of gensec but first I
> need 
> to port samba.gensec module and samba.tests.gensec. It looks like
> that 
> it will be simple without another dependency chain.

Good!

> > 
> > 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?
> What do you prefer? Do you want to review the current patchset with 
> credentials, param and _glue modules or should I do rest of work on
> auth 
> tests and gensec and send one big patchset which will contain all
> these 
> modules at once?

I'm pretty happy with those changes, so don't expect me to come back
with big objections later.  If you could build on those with the larger
patch set, that will be perfect. 

I know it is much more satisfying to get the code merged, but I really
don't want to make a release with IS_PY3 outside the test code. 

> > 
> > Thanks,
> > 
> > Andrew Bartlett
> > 
> Thank you and have a nice day.
> Lumír

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