예제 #1
0
 def do_test_connect(self, sharing, *client_args):
     display = self.find_free_display()
     log("starting test server on %s", display)
     server = self.check_start_server(display, "--start=xterm",
                                      "--sharing=%s" % sharing)
     xvfb1, client1 = self.run_client(display, "--sharing=%s" % sharing,
                                      *client_args)
     r = pollwait(client1, CLIENT_TIMEOUT)
     assert r is None, "client1 exited with code %s" % EXIT_STR.get(r, r)
     xvfb2, client2 = self.run_client(display, "--sharing=%s" % sharing,
                                      *client_args)
     r = pollwait(client2, CLIENT_TIMEOUT)
     assert r is None, "client2 exited with code %s" % EXIT_STR.get(r, r)
     if not sharing:
         #starting a second client should disconnect the first when not sharing
         assert pollwait(
             client1, 2
         ) is not None, "the first client should have been disconnected (sharing off)"
     #killing the Xvfb should kill the client
     xvfb1.terminate()
     xvfb2.terminate()
     assert pollwait(xvfb1, CLIENT_TIMEOUT) is not None
     assert pollwait(xvfb2, CLIENT_TIMEOUT) is not None
     assert pollwait(client1, CLIENT_TIMEOUT) is not None
     assert pollwait(client2, CLIENT_TIMEOUT) is not None
     server.terminate()
예제 #2
0
	def test_depth(self):
		for server_depth in (16, 24, 30):
			server_display = self.find_free_display()
			log("depth=%i starting test server on %s", server_depth, server_display)
			server = self.check_start_server(server_display,
											"--start=xterm", "--sync-xvfb=50",
											"--pixel-depth=%i" % server_depth)
			self._test_client_depth(server_display)
			server.terminate()
예제 #3
0
	def do_test_connect(self, sharing=False, *client_args):
		display = self.find_free_display()
		log("starting test server on %s", display)
		server = self.check_start_server(display, "--start=xterm", "--sharing=%s" % sharing)
		xvfb1, client1 = self.run_client(display, "--sharing=%s" % sharing, *client_args)
		assert pollwait(client1, CLIENT_TIMEOUT) is None
		xvfb2, client2 = self.run_client(display, "--sharing=%s" % sharing, *client_args)
		assert pollwait(client2, CLIENT_TIMEOUT) is None
		if not sharing:
			#starting a second client should disconnect the first when not sharing
			assert pollwait(client1, 2) is not None, "the first client should have been disconnected (sharing off)"
		#killing the Xvfb should kill the client
		xvfb1.terminate()
		xvfb2.terminate()
		assert pollwait(xvfb1, CLIENT_TIMEOUT) is not None
		assert pollwait(xvfb2, CLIENT_TIMEOUT) is not None
		assert pollwait(client1, CLIENT_TIMEOUT) is not None
		assert pollwait(client2, CLIENT_TIMEOUT) is not None
		server.terminate()