Browse Source

Alice and Bob get initial keys

master
Volker Birk 6 years ago
parent
commit
a46651f5c2
  1. 4
      test/sync_handshake.py
  2. 26
      test/sync_test.py

4
test/sync_handshake.py

@ -19,7 +19,9 @@ class UserInterface(pEp.UserInterface):
print("signal " + str(signal) + " for identities " + str(me) + " " + str(partner)) print("signal " + str(signal) + " for identities " + str(me) + " " + str(partner))
def run(): def run(path):
me = pEp.Identity(path + "@peptest.ch", path + " Neuman")
pEp.myself(me)
pEp.messageToSend = messageToSend pEp.messageToSend = messageToSend
ui = UserInterface() ui = UserInterface()

26
test/sync_test.py

@ -19,7 +19,7 @@ def test_for(path):
print("running tests for " + path); print("running tests for " + path);
from sync_handshake import run from sync_handshake import run
run() run(path)
os.chdir(cwd) os.chdir(cwd)
@ -76,21 +76,21 @@ optParser.add_option("-c", "--clean", action="store_true", dest="clean")
(options, args) = optParser.parse_args() (options, args) = optParser.parse_args()
if options.clean: if options.clean:
rmrf("alice") rmrf("Alice")
rmrf("bob") rmrf("Bob")
else: else:
setup("alice") setup("Alice")
setup("bob") setup("Bob")
alice = os.fork() Alice = os.fork()
if alice == 0: if Alice == 0:
test_for("alice") test_for("Alice")
else: else:
bob = os.fork() Bob = os.fork()
if bob == 0: if Bob == 0:
test_for("bob") test_for("Bob")
else: else:
waitpid(alice) waitpid(Alice)
waitpid(bob) waitpid(Bob)

Loading…
Cancel
Save