1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import random
- rng = random.SystemRandom()
- OLD_TOR="tor-stable"
- Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
- OldAuthority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl",
- tor=OLD_TOR)
- ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
- OldExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl",
- tor=OLD_TOR)
- Client = Node(tag="c", torrc="client.tmpl")
- OldClient = Node(tag="c", torrc="client.tmpl", tor=OLD_TOR)
- OldNewExitRelay = rng.choice([OldExitRelay, ExitRelay])
- OldNewClient = rng.choice([OldClient, Client])
- def version(node):
- if node._env["tor"] == Authority._env["tor"]:
- return "new"
- elif node._env["tor"] == OldAuthority._env["tor"]:
- return "old"
- else:
- return "unk"
- print("Chose 1 %s authority, 1 %s authority, 1 %s exit and 1 %s client"
- % (version(Authority),
- version(OldAuthority),
- version(OldNewExitRelay),
- version(OldNewClient)))
- NODES = Authority.getN(1) + OldAuthority.getN(1) + OldExitRelay.getN(1) + OldClient.getN(1)
- ConfigureNodes(NODES)
|