|
@@ -4,9 +4,21 @@ from rfc1982_serial_number import Serial
|
|
from random import randint
|
|
from random import randint
|
|
from subprocess import run
|
|
from subprocess import run
|
|
|
|
|
|
-for test in range(10000):
|
|
|
|
- i1 = randint(0, Serial.modulus - 1)
|
|
|
|
- i2 = randint(0, Serial.modulus - 1)
|
|
|
|
- cmd = "./rfc1982_serial_number.py", str(i1), str(i2)
|
|
|
|
|
|
+def test(n, cmd):
|
|
print(f"\nTest: {test}: {cmd[0]} {cmd[1]} {cmd[2]}")
|
|
print(f"\nTest: {test}: {cmd[0]} {cmd[1]} {cmd[2]}")
|
|
run(cmd)
|
|
run(cmd)
|
|
|
|
+
|
|
|
|
+for n in range(100):
|
|
|
|
+ i1 = randint(0, Serial.modulus - 1)
|
|
|
|
+ i2 = randint(0, Serial.modulus - 1)
|
|
|
|
+ test(n, ("./rfc1982_serial_number.py", str(i1), str(i2)))
|
|
|
|
+
|
|
|
|
+for n in range(10):
|
|
|
|
+ i1 = randint(0, Serial.modulus - 1)
|
|
|
|
+ i2 = i1 ^ (Serial.modulus >> 1)
|
|
|
|
+ test(n, ("./rfc1982_serial_number.py", str(i1), str(i2)))
|
|
|
|
+
|
|
|
|
+for n in range(10):
|
|
|
|
+ i1 = randint(0, Serial.modulus - 1)
|
|
|
|
+ i2 = (i1 + Serial.modulus - 1) & (Serial.modulus - 1)
|
|
|
|
+ test(n, ("./rfc1982_serial_number.py", str(i1), str(i2)))
|