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

Lumir Balhar lbalhar at redhat.com
Thu Jan 5 13:01:10 UTC 2017


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.
> 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.
> 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?
> Thanks,
>
> Andrew Bartlett
>
Thank you and have a nice day.
Lumír



More information about the samba-technical mailing list