changeset 3971:9b1d74a6b48c

tests (e2e/cli): add tests for JET: rel 378
author Goffi <goffi@goffi.org>
date Mon, 31 Oct 2022 04:09:38 +0100
parents 4c3361e2bf55
children 5fbdf986670c
files tests/e2e/libervia-cli/test_libervia-cli.py
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/e2e/libervia-cli/test_libervia-cli.py	Mon Oct 31 04:09:38 2022 +0100
+++ b/tests/e2e/libervia-cli/test_libervia-cli.py	Mon Oct 31 04:09:38 2022 +0100
@@ -372,3 +372,25 @@
         assert sign_data["signer"] == "account1@server1.test"
         assert sign_data["validated"] == True
         assert all(t == "undecided" for t in sign_data["trusts"].values())
+
+    def test_jingle_encrypted_transport_jet(self, fake_file):
+        """A file is sent and received properly with JET OMEMO"""
+        li.encryption.start("account1@server2.test", name="oldmemo")
+        source_file = fake_file.size(10240)
+        source_file_hash = fake_file.get_source_hash(source_file)
+        send_cmd = li.file.send(
+            source_file, "account1@server2.test", encrypt=True, _bg=True
+        )
+        dest_path = fake_file.dest_files / "test_send_receive"
+        dest_path.mkdir()
+        try:
+            li.file.receive(
+                "account1@server1.test", profile="account1_s2", path=dest_path)
+            dest_file = dest_path / source_file.name
+            dest_file_hash = fake_file.get_dest_hash(dest_file)
+        finally:
+            shutil.rmtree(dest_path)
+        send_cmd.wait()
+
+        assert source_file_hash == dest_file_hash
+        li.encryption.stop("account1@server2.test")