Lines Matching full:server
21 def server_prefunc(server, idx): argument
24 server.logger.debug("Running server %d" % idx)
38 def cleanup_server(server): argument
39 if server.process.exitcode is not None:
42 server.process.terminate()
43 server.process.join()
45 server = create_server(self.get_server_addr(self.server_index),
49 server.dbpath = dbpath
51 server.serve_as_process(prefunc=prefunc, args=(self.server_index,))
52 self.addCleanup(cleanup_server, server)
57 client = create_client(server.address)
60 return (client, server)
69 (self.client, self.server) = self.start_server()
86 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
96 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
103 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
141 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
157 client = Client(self.server.address)
188 # Tests upstream server support. This is done by creating two servers
189 # that share a database file. The downstream server has it upstream
190 # set to the test server, whereas the side server doesn't. This allows
192 # server by verifying that they appear on the downstream client, but not
196 (down_client, down_server) = self.start_server(upstream=self.server.address)
203 # check upstream server
206 # Hash should *not* be present on the side server
209 # Hash should be present on the downstream server, since it
210 # will defer to the upstream server. This will trigger
211 # the backfill in the downstream server
215 # task from the upstream server, it should appear in the side server
245 # propagating to the upstream server
257 # match which was previously reported to the upstream server
266 self.assertEqual(result['unihash'], unihash5, 'Server failed to copy unihash from upstream')
268 # Tests read through from server with
275 self.assertEqual(result['unihash'], unihash7, 'Server failed to copy unihash from upstream')
276 self.assertEqual(result['outhash'], outhash7, 'Server failed to copy unihash from upstream')
277 … self.assertEqual(result['taskhash'], taskhash7, 'Server failed to copy unihash from upstream')
286 self.assertEqual(result['unihash'], unihash8, 'Server failed to copy unihash from upstream')
287 self.assertEqual(result['outhash'], outhash8, 'Server failed to copy unihash from upstream')
288 … self.assertEqual(result['taskhash'], taskhash8, 'Server failed to copy unihash from upstream')
297 self.assertEqual(result['unihash'], unihash9, 'Server failed to copy unihash from upstream')
298 … self.assertEqual(result['taskhash'], taskhash9, 'Server failed to copy unihash from upstream')
302 (ro_client, ro_server) = self.start_server(dbpath=self.server.dbpath, read_only=True)
304 # Report a hash via the read-write server
310 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
312 # Check the hash via the read-only server
315 # Ensure that reporting via the read-only server fails
328 # Ensures that the server will exit correctly even if it gets a SIGTERM
333 def prefunc(server, idx): argument
335 server_prefunc(server, idx)
344 _, server = self.start_server(prefunc=prefunc)
345 server.process.terminate()
348 server.process.join(300)
349 self.assertIsNotNone(server.process.exitcode, "Server did not exit in a timely manner!")
425 self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')