From c4a7d17b2f414c9714608e536b5ba76269f75bcd Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 10 Jun 2022 16:36:30 +0200 Subject: [PATCH] Updated tests --- tests/identity.py | 7 ++++++- tests/link.py | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/identity.py b/tests/identity.py index 85c52d1..7afaf8a 100644 --- a/tests/identity.py +++ b/tests/identity.py @@ -183,7 +183,12 @@ class TestIdentity(unittest.TestCase): # Test encrypt and decrypt of large chunks print("Testing large chunk encrypt/decrypt") mlen = 8*1000*1000 - for i in range(1, 3): + if RNS.Cryptography.backend() == "internal": + lb = 1 + else: + lb = 8 + + for i in range(1, lb): msg = os.urandom(mlen) b += mlen id1 = RNS.Identity() diff --git a/tests/link.py b/tests/link.py index 67c8ce0..35c28df 100644 --- a/tests/link.py +++ b/tests/link.py @@ -88,7 +88,11 @@ class TestLink(unittest.TestCase): b = 0 pr_t = 0 receipts = [] - num_packets = 500 + if RNS.Cryptography.backend() == "internal": + num_packets = 50 + else: + num_packets = 500 + packet_size = RNS.Link.MDU pstart = time.time() print("Sending "+str(num_packets)+" link packets of "+str(packet_size)+" bytes...") @@ -104,7 +108,7 @@ class TestLink(unittest.TestCase): print("Checking receipts...", end=" ") all_ok = False - receipt_timeout = time.time() + 30 + receipt_timeout = time.time() + 35 while not all_ok and time.time() < receipt_timeout: for r in receipts: all_ok = True @@ -192,6 +196,10 @@ class TestLink(unittest.TestCase): def test_4_medium_resource(self): + if RNS.Cryptography.backend() == "internal": + print("Skipping medium resource test...") + return + init_rns(self) print("") print("Medium resource test") @@ -226,6 +234,10 @@ class TestLink(unittest.TestCase): self.assertEqual(l1.status, RNS.Link.CLOSED) def test_5_large_resource(self): + if RNS.Cryptography.backend() == "internal": + print("Skipping large resource test...") + return + init_rns(self) print("") print("Large resource test")