comparison tests/e2e/libervia-cli/test_libervia-cli.py @ 4227:dfccc90cacc6

tests: fix and update tests: - update code to newer version of `sh` - update code to newer version of `selenium` - update names of OMEMO algorithms - fix paths and names used to mount source to the test container - skip modules using `Gst` and `PyQt` when they are not available.
author Goffi <goffi@goffi.org>
date Tue, 05 Mar 2024 17:31:56 +0100
parents 4b842c1fb686
children f59e9421a650
comparison
equal deleted inserted replaced
4226:3f7ca590a5da 4227:dfccc90cacc6
374 assert sign_data["validated"] == True 374 assert sign_data["validated"] == True
375 assert all(t == "undecided" for t in sign_data["trusts"].values()) 375 assert all(t == "undecided" for t in sign_data["trusts"].values())
376 376
377 def test_jingle_encrypted_transport_jet(self, fake_file): 377 def test_jingle_encrypted_transport_jet(self, fake_file):
378 """A file is sent and received properly with JET OMEMO""" 378 """A file is sent and received properly with JET OMEMO"""
379 li.encryption.start("account1@server2.test", name="oldmemo") 379 # FIXME: transport should be checked to see if content is actually encrypted.
380 # Maybe we can use tcpdump?
381 li.encryption.start("account1@server2.test", name="omemo_legacy")
380 source_file = fake_file.size(10240) 382 source_file = fake_file.size(10240)
381 source_file_hash = fake_file.get_source_hash(source_file) 383 source_file_hash = fake_file.get_source_hash(source_file)
382 send_cmd = li.file.send( 384 send_cmd = li.file.send(
383 source_file, "account1@server2.test", encrypt=True, _bg=True 385 source_file, "account1@server2.test", encrypt=True, _bg=True,
384 ) 386 )
385 dest_path = fake_file.dest_files / "test_send_receive" 387 dest_path = fake_file.dest_files / "test_send_receive"
386 dest_path.mkdir() 388 dest_path.mkdir()
387 try: 389 try:
388 li.file.receive( 390 li.file.receive(
389 "account1@server1.test", profile="account1_s2", path=dest_path) 391 "account1@server1.test", profile="account1_s2", path=dest_path,
392 )
390 dest_file = dest_path / source_file.name 393 dest_file = dest_path / source_file.name
391 dest_file_hash = fake_file.get_dest_hash(dest_file) 394 dest_file_hash = fake_file.get_dest_hash(dest_file)
392 finally: 395 finally:
393 shutil.rmtree(dest_path) 396 shutil.rmtree(dest_path)
394 send_cmd.wait() 397 send_cmd.wait()
399 def test_pubsub_targeted_encryption_pte(self, li_elt): 402 def test_pubsub_targeted_encryption_pte(self, li_elt):
400 """An item is encrypted for specific recipients""" 403 """An item is encrypted for specific recipients"""
401 secret_blog = "this is a secret blog post" 404 secret_blog = "this is a secret blog post"
402 node = "e2ee_blog" 405 node = "e2ee_blog"
403 item = "test_pte" 406 item = "test_pte"
404 li.encryption.start("account1@server2.test", name="twomemo") 407 li.encryption.start("account1@server2.test", name="omemo")
405 li.encryption.start( 408 li.encryption.start(
406 "account1@server1.test", name="twomemo", profile="account1_s2" 409 "account1@server1.test", name="omemo", profile="account1_s2"
407 ) 410 )
408 li.blog.set( 411 li.blog.set(
409 _in=secret_blog, node="e2ee_blog", item=item, 412 _in=secret_blog, node="e2ee_blog", item=item,
410 encrypt_for="account1@server2.test" 413 encrypt_for="account1@server2.test"
411 ) 414 )