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.
This commit is contained in:
Goffi 2024-03-05 17:31:56 +01:00
commit 48201780de
2 changed files with 58 additions and 29 deletions

View file

@ -38,7 +38,7 @@ class LiberviaCliJson:
kwargs['output'] = 'json-raw'
kwargs['_tty_out'] = False
cmd = li(*args, **kwargs)
return json.loads(cmd.stdout)
return json.loads(cmd)
def __getattr__(self, name):
if name.startswith('_'):
@ -63,7 +63,7 @@ class LiberviaCliElt(LiberviaCliJson):
kwargs['output'] = 'xml-raw'
kwargs['_tty_out'] = False
cmd = li(*args, **kwargs)
return self.parser(cmd.stdout.decode().strip())
return self.parser(cmd.strip())
class Editor:

View file

@ -376,17 +376,20 @@ class TestE2EEncryption:
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")
# FIXME: transport should be checked to see if content is actually encrypted.
# Maybe we can use tcpdump?
li.encryption.start("account1@server2.test", name="omemo_legacy")
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
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)
"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:
@ -401,9 +404,9 @@ class TestE2EEncryption:
secret_blog = "this is a secret blog post"
node = "e2ee_blog"
item = "test_pte"
li.encryption.start("account1@server2.test", name="twomemo")
li.encryption.start("account1@server2.test", name="omemo")
li.encryption.start(
"account1@server1.test", name="twomemo", profile="account1_s2"
"account1@server1.test", name="omemo", profile="account1_s2"
)
li.blog.set(
_in=secret_blog, node="e2ee_blog", item=item,