Updated tests

This commit is contained in:
Mark Qvist 2022-06-10 16:36:30 +02:00
parent c758c4d279
commit c4a7d17b2f
2 changed files with 20 additions and 3 deletions

View File

@ -183,7 +183,12 @@ class TestIdentity(unittest.TestCase):
# Test encrypt and decrypt of large chunks # Test encrypt and decrypt of large chunks
print("Testing large chunk encrypt/decrypt") print("Testing large chunk encrypt/decrypt")
mlen = 8*1000*1000 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) msg = os.urandom(mlen)
b += mlen b += mlen
id1 = RNS.Identity() id1 = RNS.Identity()

View File

@ -88,7 +88,11 @@ class TestLink(unittest.TestCase):
b = 0 b = 0
pr_t = 0 pr_t = 0
receipts = [] receipts = []
num_packets = 500 if RNS.Cryptography.backend() == "internal":
num_packets = 50
else:
num_packets = 500
packet_size = RNS.Link.MDU packet_size = RNS.Link.MDU
pstart = time.time() pstart = time.time()
print("Sending "+str(num_packets)+" link packets of "+str(packet_size)+" bytes...") print("Sending "+str(num_packets)+" link packets of "+str(packet_size)+" bytes...")
@ -104,7 +108,7 @@ class TestLink(unittest.TestCase):
print("Checking receipts...", end=" ") print("Checking receipts...", end=" ")
all_ok = False all_ok = False
receipt_timeout = time.time() + 30 receipt_timeout = time.time() + 35
while not all_ok and time.time() < receipt_timeout: while not all_ok and time.time() < receipt_timeout:
for r in receipts: for r in receipts:
all_ok = True all_ok = True
@ -192,6 +196,10 @@ class TestLink(unittest.TestCase):
def test_4_medium_resource(self): def test_4_medium_resource(self):
if RNS.Cryptography.backend() == "internal":
print("Skipping medium resource test...")
return
init_rns(self) init_rns(self)
print("") print("")
print("Medium resource test") print("Medium resource test")
@ -226,6 +234,10 @@ class TestLink(unittest.TestCase):
self.assertEqual(l1.status, RNS.Link.CLOSED) self.assertEqual(l1.status, RNS.Link.CLOSED)
def test_5_large_resource(self): def test_5_large_resource(self):
if RNS.Cryptography.backend() == "internal":
print("Skipping large resource test...")
return
init_rns(self) init_rns(self)
print("") print("")
print("Large resource test") print("Large resource test")