selftest: enable py3 for samba.tests.common
authorJoe Guo <joeg@catalyst.net.nz>
Mon, 26 Mar 2018 04:07:33 +0000 (17:07 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 Apr 2018 06:59:10 +0000 (08:59 +0200)
commit0ebf52744c5171d4eb5f0b0616d3880d7bbd9db4
treee2337d1404b83e2dd53d003845528be4f90e349f
parent80aaafc2ce96b3b18ae66d37cdb70cc731edb6e5
selftest: enable py3 for samba.tests.common

fix dsdb_Dn comparison for Python 3

In Python 3, the builtin `cmp` funtion was dropped. And the `__cmp__` magic
method in object is no longer honored, which is replaced by 6 new methods:
__eq__, __ne__, __lt__, __le__, __gt__, __ge__.

This caused `tests.CommonTests` failed with `py3_compatiable=True`.
Fixed by adding the above methods.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/common.py
selftest/tests.py