Make the intent of the loop over servers in test_system.Connections.test_rref clearer, and able to be the same in 1.9.2 and trunk. Remove the now-unused node_key_s attribute of Client. refs #1636

This commit is contained in:
david-sarah 2012-06-16 18:18:44 +00:00
parent 635e87bd7b
commit 323774698e
2 changed files with 7 additions and 6 deletions

View File

@ -213,7 +213,6 @@ class Client(node.Node, pollmixin.PollMixin):
sk,vk_vs = keyutil.parse_privkey(sk_vs.strip())
self.write_config("node.pubkey", vk_vs+"\n")
self._server_key = sk
self.node_key_s = vk_vs
def _init_permutation_seed(self, ss):
seed = self.get_config_from_file("permutation-seed")

View File

@ -1887,6 +1887,7 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
d.addCallback(_got_lit_filenode)
return d
class Connections(SystemTestMixin, unittest.TestCase):
def test_rref(self):
if NormalizedVersion(foolscap.__version__) < NormalizedVersion('0.6.4'):
@ -1897,11 +1898,12 @@ class Connections(SystemTestMixin, unittest.TestCase):
d = self.set_up_nodes(2)
def _start(ign):
self.c0 = self.clients[0]
for s in self.c0.storage_broker.get_connected_servers():
if "pub-"+s.get_longname() != self.c0.node_key_s:
break
self.s1 = s # s1 is the server, not c0
self.s1_rref = s.get_rref()
nonclients = [s for s in self.c0.storage_broker.get_connected_servers()
if s.get_serverid() != self.c0.nodeid]
self.failUnlessEqual(len(nonclients), 1)
self.s1 = nonclients[0] # s1 is the server, not c0
self.s1_rref = self.s1.get_rref()
self.failIfEqual(self.s1_rref, None)
self.failUnless(self.s1.is_connected())
d.addCallback(_start)