[PATCH] Port of samba.security Python module

Lumir Balhar lbalhar at redhat.com
Tue Aug 8 07:44:36 UTC 2017


On 08/08/2017 06:38 AM, Andrew Bartlett wrote:
> On Mon, 2017-08-07 at 16:48 +0200, Lumir Balhar via samba-technical
> wrote:
>> Hello.
>>
>> Is there any problem with this patch? I've tried to rebase it to the
>> latest master and there is no conflict.
>>
>> If the problem is that the module is unstested, could you please help
>> me
>> to write some test?
> We do always need more tests :-)
>
> It doesn't look like a complex conversion however.  How about creating
> an SD from SSDL, then testing it against a token (even an empty one).
> Add that to the python/samba/tests/security.py testsuite.
>
> That should confirm the C code still gets hit by the python code.
>
> Thanks,
>
> Andrew Bartlett
Hello.

Thank you for the hint. I've created tests as you suggested with an 
empty token and same descriptor as other tests are using in 
samba.test.security.

Unfortunately, I cannot use assertRaises() as a context manager for 
testing exceptions because it is not supported in Python 2.6.

Please, let me know if this is ok.

Thank you and have a nice day.

Lumír
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-python-Enable-execution-of-samba.tests.security-with.patch
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170808/d72d777b/0003-python-Enable-execution-of-samba.tests.security-with.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-python-Add-tests-for-check_access-function-from-samb.patch
Type: text/x-patch
Size: 1882 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170808/d72d777b/0002-python-Add-tests-for-check_access-function-from-samb.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-python-Port-samba.security-to-Python-3-compatible-fo.patch
Type: text/x-patch
Size: 2602 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170808/d72d777b/0001-python-Port-samba.security-to-Python-3-compatible-fo.bin>


More information about the samba-technical mailing list