summaryrefslogtreecommitdiff
path: root/python/samba/tests/messaging.py
AgeCommit message (Collapse)AuthorFilesLines
2023-11-15python:tests: Ensure we clean up callbacks in pymessaging testsJoseph Sutton1-5/+21
Not calling ‘deregister()’ results in memory getting leaked. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 15 23:11:13 UTC 2023 on atb-devel-224
2023-11-15python:tests: Fix crashing pymessaging testsJoseph Sutton1-2/+3
Commit 8c75d9fc73614fad29a998d08c4b11034ab2aebb changed Messaging.deregister() to take a two‐element tuple containing private data as well as a callback, but it did not change the call in samba.tests.messaging.MessagingTests.test_register to match. Since imessaging_deregister() completely ignored the ‘private_data’ parameter passed to it (assuming the callback was registered with msg_type == -1), everything still appeared to work — until commit b22c21799527323877b330c16c23057582721abb changed Messaging.deregister() to no longer leak memory. Now the wrong variable had its reference count decremented, causing the test to crash. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-08-11python compat: remove integer_typesDouglas Bagnall1-2/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-08-24PEP8: fix E306: expected 1 blank line before a nested definition, found 0Joe Guo1-0/+3
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>
2017-10-23python: Port tests of samba.messaging to Python 3 compatible form.Lumir Balhar1-1/+3
Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 23 15:40:48 CEST 2017 on sn-devel-144
2017-03-28pymessaging: add single element tupple form of the server_idGary Lockyer1-0/+42
This avoids the python code needing to call getpid() internally, while declaring a stable task_id. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-03-28pymessaging: Add a hook to run the event loop, make callbacks practicalAndrew Bartlett1-14/+38
These change allow us to write a messaging server in python. The previous ping_speed test did not actually test anything, so we use .loop_once() to make it actually work. To enable practial use a context is supplied in the tuple with the callback, and the server_id for the reply is not placed inside an additional tuple. In order to get at the internal event context on which to loop, we expose imessaging_context in messaging_internal.h and allow the python bindings to use that header. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-03-28selftest: Test server_id database add and removalAndrew Bartlett1-6/+13
This tests indirectly server_id_db_lookup() and server_id_db_prune_name(), as well as the imessaging and the imessaging python bindings. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705
2017-03-28pymessaging: Add irpc_remove_nameAndrew Bartlett1-0/+8
This allows tests to be indirectly added for server_id_db_lookup() and server_id_db_prune_name() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705
2017-03-28pymessaging: Add support for irpc_add_nameAndrew Bartlett1-0/+4
This allows tests to be indirectly added for server_id_db_lookup() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Pair-Programmed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705
2014-10-08tests: Pass the test context as lp_ctx for messaging testsMatthieu Patou1-1/+2
Change-Id: I1acf5c42b21465a8c45549039f0054414b8f31d1 Signed-off-by: Matthieu Patou <mat@matws.net>
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+67
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104