Browse Source

add disable_all_sync_channels() and test with extra identity

Release_2.1
Volker Birk 8 months ago
parent
commit
7f2d884f6e
5 changed files with 152 additions and 10 deletions
  1. +2
    -0
      .gitignore
  2. +10
    -0
      src/pEp/_pEp/pEpmodule.cc
  3. +129
    -0
      test/data/keys/inquisitor-0xA4728718_full_expired.priv.asc
  4. +10
    -9
      test/sync_handshake.py
  5. +1
    -1
      test/sync_test.py

+ 2
- 0
.gitignore View File

@ -74,6 +74,8 @@ __pycache__/
.idea
.spyproject
*.code-workspace
tags
ws
# platform artifacts
.DS_store


+ 10
- 0
src/pEp/_pEp/pEpmodule.cc View File

@ -186,6 +186,10 @@ namespace pEp {
::leave_device_group(Adapter::session());
}
void disable_all_sync_channels() {
::disable_all_sync_channels(Adapter::session());
}
void testfunc() {
_messageToSend(NULL);
}
@ -670,6 +674,12 @@ namespace pEp {
"call this for a grouped device, which should leave\n"
);
def("disable_all_sync_channels", &disable_all_sync_channels,
"disable_all_sync_channels()\n"
"\n"
"Disable sync for all identities\n"
);
// codecs
call< object >(((object)(import("codecs").attr("register"))).ptr(), make_function(sync_search));
call< object >(((object)(import("codecs").attr("register"))).ptr(), make_function(distribution_search));


+ 129
- 0
test/data/keys/inquisitor-0xA4728718_full_expired.priv.asc View File

@ -0,0 +1,129 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----
lQVYBEdLUwABDAC2bTz7s8V9CDu/K3PtSXDvNCtx+84tdQEoNnmzQh9bkdnHWIzO
cscoO/YcJIQFJJ7WWdCudLLj+qaHS1t2EomW8ZRYe/HdIcIW/qO0ydGDShiJxEZN
4ZrNPz+BfEAhatbsN46z7DyzZjGHPPdIdLic2QAuDbv/z2/11ABDYa58vZINOp1r
pkmytOJps92K8hpY+PmfWTdNSWaNTCiQoel0MyyV/AgNLv/HUJRlN5QvqCQWqcAN
lHE5JmVZQK9wzlzs8T8pnoJJRPMG3GeiiMWMXjPUI01DdX+Fv69wkFavUOOV/JND
0nKl42xqajbkDL+Hc9veNlR4+h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ey5fOUjtEOPpvvQzAA4KRK4BMd6
RHnJI657X9ffWiX900IggFYIC+yCTaKmm9LVMgPZ5KS/C+MdvZlkWzH8jv7gKFHP
1JV1c//vSuxq0khtAIkffl0KxLQBHoov8LcFsADafhnYUZFXASOsZOdv1sp5HqLr
kJmOk28sw0+6HrVXa4PItghG5jOVG1CgWaCCtC24zQj5zhXYfmh/aGIdBf1vPe9b
Zi5tJqJFwNBceGW3kZI=
=jOL5
-----END PGP PRIVATE KEY BLOCK-----

+ 10
- 9
test/sync_handshake.py View File

@ -164,6 +164,16 @@ def run(name, color=None, imap=False, own_ident=1, leave=False):
elif color == "cyan":
pEp.debug_color(36)
if own_ident >= 2:
me2 = pEp.Identity("alice@pep.security", name + " of Alice Neuman", name)
pEp.myself(me2)
if own_ident == 3:
me3 = pEp.Identity("alice@pep.foundation", name + " of Alice Neuman", name)
pEp.myself(me3)
pEp.disable_all_sync_channels()
if imap:
import miniimap
import imap_settings
@ -174,15 +184,6 @@ def run(name, color=None, imap=False, own_ident=1, leave=False):
else:
me = pEp.Identity("alice@peptest.ch", name + " of Alice Neuman", name)
pEp.myself(me)
if own_ident >= 2:
me2 = pEp.Identity("alice@pep.security", name + " of Alice Neuman", name)
pEp.myself(me2)
if own_ident == 3:
me3 = pEp.Identity("alice@pep.foundation", name + " of Alice Neuman", name)
pEp.myself(me3)
pEp.message_to_send = messageToSend
if multithreaded:


+ 1
- 1
test/sync_test.py View File

@ -211,7 +211,7 @@ if __name__ == "__main__":
# Phone runs with own_ident = 2
Phone = Process(target=test_for, args=("Phone", "red", end_on,
options.multithreaded, options.imap, 1))
options.multithreaded, options.imap, 2))
# others run with own_ident = 1
Laptop = Process(target=test_for, args=("Laptop", "green", end_on,


Loading…
Cancel
Save