Make the intent of the loop over servers in test_system.Connections.test_rref clearer...
authordavid-sarah <david-sarah@jacaranda.org>
Sat, 16 Jun 2012 18:18:44 +0000 (18:18 +0000)
committerdavid-sarah <david-sarah@jacaranda.org>
Sat, 16 Jun 2012 18:18:44 +0000 (18:18 +0000)
src/allmydata/client.py
src/allmydata/test/test_system.py

index 239fdc1f06505fc20afd0e9e2e0ce57b0862c22e..1e4479bb47f0c85c143209f6a8737847581ac289 100644 (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")
index f69c5f74127ac798f60a436946034437d85fc6e5..b2461ac6e9900e6c22ff36de5f58bd33a28f4342 100644 (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)