bugged
stringlengths 4
228k
| fixed
stringlengths 0
96.3M
| __index_level_0__
int64 0
481k
|
|---|---|---|
def _LoadTests(self, args): """Returns a suite of tests loaded from the given args.
|
def _LoadTests(self, args): """Returns a suite of tests loaded from the given args.
| 475,600
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform def _NamesInSuite(suite_name): logging.debug('Expanding suite %s' % suite_name) platforms = suites.get(suite_name) names = platforms.get('all', []) + \ platforms.get(self._platform_map[platform], []) ret = [] for name in names: if name.startswith('@'): ret.extend(_NamesInSuite(name[1:])) else: ret.append(name) return ret assert suite in suites, '%s: No such suite in %s' % (suite, filename) all_names = _NamesInSuite(suite) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
| 475,601
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._ImportTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
| 475,602
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._GetTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
|
def _LoadTestNamesFrom(self, filename): modules= PyUITest.EvalDataFrom(filename) platform = sys.platform if PyUITest.IsChromeOS(): # check if it's chromeos platform = 'chromeos' assert platform in self._platform_map, '%s unsupported' % platform all_names = modules.get('all', []) + \ modules.get(self._platform_map[platform], []) args = [] excluded = [] # Find all excluded tests. Excluded tests begin with '-'. for name in all_names: if name.startswith('-'): # Exclude excluded.extend(self._GetTestsFromName(name[1:])) else: args.extend(self._ImportTestsFromName(name)) for name in excluded: if name in args: args.remove(name) else: logging.warn('Cannot exclude %s. Not included. Ignoring' % name) if excluded: logging.debug('Excluded %d test(s): %s' % (len(excluded), excluded)) return args
| 475,603
|
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
|
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
| 475,604
|
def WritePepperGLES2Interface(self, filename): """Writes the Pepper OpenGLES interface definition.""" file = CHeaderWriter( filename, "// This interface is used to access common and lite profile OpenGL ES " "2.0\n// functions.\n", 2)
|
def WritePepperGLES2Interface(self, filename): """Writes the Pepper OpenGLES interface definition.""" file = CHeaderWriter( filename, "// This interface is used to access common and lite profile OpenGL ES " "2.0\n// functions.\n", 2)
| 475,605
|
file.Write("\ntypedef struct _ppb_OpenGLES {\n")
|
file.Write("\ntypedef struct _ppb_OpenGLES {\n")
| 475,606
|
file.Write("\ntypedef struct _ppb_OpenGLES {\n")
|
file.Write("\ntypedef struct _ppb_OpenGLES {\n")
| 475,607
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
| 475,608
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
| 475,609
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
|
def WritePepperGLES2Implementation(self, filename): """Writes the Pepper OpenGLES interface implementation."""
| 475,610
|
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1)
|
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1)
| 475,611
|
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/ppb_opengles.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1)
|
def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "--generate-docs", action="store_true", help="generate a docs friendly version of the command formats.") parser.add_option( "--alternate-mode", type="choice", choices=("ppapi", "chrome_ppapi", "ppapi_gles2"), help="generate files for other projects. \"ppapi\" must be run from the " "directory containing the ppapi directory, and will generate ppapi " "bindings. \"chrome_ppapi\" must be run from chrome src directory and " "will generate chrome plumbing for ppapi.") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") if options.alternate_mode == "ppapi": gen.WritePepperGLES2Interface("ppapi/c/dev/ppb_opengles_dev.h") elif options.alternate_mode == "chrome_ppapi": gen.WritePepperGLES2Implementation( "webkit/glue/plugins/pepper_graphics_3d_gl.cc") else: gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if options.generate_docs: gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1)
| 475,612
|
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
|
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
| 475,613
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,614
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,615
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
defmain(options,args):logfile=open('testserver.log','w')sys.stdout=FileMultiplexer(sys.stdout,logfile)sys.stderr=FileMultiplexer(sys.stderr,logfile)port=options.portifoptions.server_type==SERVER_HTTP:ifoptions.cert:#let'smakesurethecertfileexists.ifnotos.path.isfile(options.cert):print'specifiedservercertfilenotfound:'+options.cert+\'exiting...'returnforca_certinoptions.ssl_client_ca:ifnotos.path.isfile(ca_cert):print'specifiedtrustedclientCAfilenotfound:'+ca_cert+\'exiting...'returnserver=HTTPSServer(('127.0.0.1',port),TestPageHandler,options.cert,options.ssl_client_auth,options.ssl_client_ca,options.ssl_bulk_cipher)print'HTTPSserverstartedonport%d...'%portelse:server=StoppableHTTPServer(('127.0.0.1',port),TestPageHandler)print'HTTPserverstartedonport%d...'%portserver.data_dir=MakeDataDir()server.file_root_url=options.file_root_urlserver._sync_handler=Noneserver._device_management_handler=None#meansFTPServerelse:my_data_dir=MakeDataDir()#Instantiateadummyauthorizerformanaging'virtual'usersauthorizer=pyftpdlib.ftpserver.DummyAuthorizer()#Defineanewuserhavingfullr/wpermissionsandaread-only#anonymoususerauthorizer.add_user('chrome','chrome',my_data_dir,perm='elradfmw')authorizer.add_anonymous(my_data_dir)#InstantiateFTPhandlerclassftp_handler=pyftpdlib.ftpserver.FTPHandlerftp_handler.authorizer=authorizer#Defineacustomizedbanner(stringreturnedwhenclientconnects)ftp_handler.banner=("pyftpdlib%sbasedftpdready."%pyftpdlib.ftpserver.__ver__)#InstantiateFTPserverclassandlistento127.0.0.1:portaddress=('127.0.0.1',port)server=pyftpdlib.ftpserver.FTPServer(address,ftp_handler)print'FTPserverstartedonport%d...'%port#Notifytheparentthatwe'vestarted.(BaseServersubclasses#bindtheirsocketsonconstruction.)ifoptions.startup_pipeisnotNone:ifsys.platform=='win32':fd=msvcrt.open_osfhandle(options.startup_pipe,0)else:fd=options.startup_pipestartup_pipe=os.fdopen(fd,"w")startup_pipe.write("READY")startup_pipe.close()try:server.serve_forever()exceptKeyboardInterrupt:print'shuttingdownserver'server.stop=True
| 475,616
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,617
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,618
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") startup_pipe.write("READY") startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,619
|
def RemovePlatformFromFile(self, tests, platform, backup=False): """Remove the platform option from test expectations file.
|
def RemovePlatformFromFile(self, tests, platform, backup=False): """Remove the platform option from test expectations file.
| 475,620
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', 'Chromium Linux', 'Chromium Linux x64', 'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', 'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
| 475,621
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', 'Chromium Linux', 'Chromium Linux x64', 'Linux Tests (valgrind)(1)', 'Linux Tests (valgrind)(2)', 'Linux Tests (valgrind)(3)', 'Linux Tests (valgrind)(4)', 'Webkit Linux (valgrind layout)', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Mac (valgrind)', 'Chromium Mac UI (valgrind)(1)', 'Chromium Mac UI (valgrind)(2)', 'Chromium Mac UI (valgrind)(3)', 'Chromium Mac (tsan)', 'Webkit Mac (valgrind)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
| 475,622
|
def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH)
|
def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.LAYOUT_TESTS_PATH) if index is not -1: index += len(self.WEBKIT_PATH)
| 475,623
|
def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH)
|
def _GetPathRelativeToLayoutTestRoot(self, test): """Returns the path of the test relative to the layout test root. For example, for: src/third_party/WebKit/LayoutTests/fast/forms/foo.html We would return fast/forms/foo.html """ index = test.find(self.WEBKIT_PATH) if index is not -1: index += len(self.WEBKIT_PATH)
| 475,624
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
| 475,625
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
| 475,626
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
|
def _GetJSON(self): """Gets the results for the results.json file.""" failures_for_json = {} for test in self._failures: failures_for_json[test] = ResultAndTime(test, self._all_tests) failures_for_json[test].result = self._GetResultsCharForTest(test)
| 475,627
|
def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return
|
def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return
| 475,628
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks?results.extend(input_api.canned_checks.CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
| 475,629
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/current?format=raw', '.*closed.*')) results.extend(input_api.canned_checks.CheckRietveldTryJobExecution(input_api, output_api, 'http://codereview.chromium.org', ('win', 'linux', 'mac'), 'tryserver@chromium.org')) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
| 475,630
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(input_api.canned_checks.CheckBuildbotPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
| 475,631
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders', 6, IGNORED_BUILDERS)) return results
|
def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) # Make sure the tree is 'open'. # TODO(maruel): Run it in a separate thread to parallelize checks? results.extend(CheckTreeIsOpen( input_api, output_api, 'http://chromium-status.appspot.com/status', '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) # These builders are just too slow. IGNORED_BUILDERS = [ 'Chromium XP', 'Chromium Mac', 'Chromium Arm (dbg)', 'Chromium Linux', 'Chromium Linux x64', ] results.extend(CheckPendingBuilds( input_api, output_api, 'http://build.chromium.org/buildbot/waterfall/json/builders?filter=1', 6, IGNORED_BUILDERS)) return results
| 475,632
|
def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) # platform|status|url values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: # It returned an empty list. Probably a private review. return outputs # Reformat as an dict of platform: [status, url] values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify maruel@chromium.org. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: # Fallback to no try job. # TODO(maruel): Change to a PresubmitPromptWarning once the try server is # stable enough and it seems to work fine. outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: # Another HTTP error happened, warn the user. # TODO(maruel): Change to a PresubmitPromptWarning once it deemed to work # fine. outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs
|
def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) # platform|status|url values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: # It returned an empty list. Probably a private review. return outputs # Reformat as an dict of platform: [status, url] values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify maruel@chromium.org. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: # Fallback to no try job. # TODO(maruel): Change to a PresubmitPromptWarning once the try server is # stable enough and it seems to work fine. outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: # Another HTTP error happened, warn the user. # TODO(maruel): Change to a PresubmitPromptWarning once it deemed to work # fine. outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs
| 475,633
|
def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache, reqCert=self.ssl_client_auth, settings=self.ssl_handshake_settings, reqCAs=self.ssl_client_cas) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSAbruptCloseError: # Ignore abrupt close. return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False
|
def handshake(self, tlsConnection): """Creates the SSL connection.""" try: tlsConnection.handshakeServer(certChain=self.cert_chain, privateKey=self.private_key, sessionCache=self.session_cache, reqCert=self.ssl_client_auth, settings=self.ssl_handshake_settings, reqCAs=self.ssl_client_cas) tlsConnection.ignoreAbruptClose = True return True except tlslite.api.TLSAbruptCloseError: # Ignore abrupt close. return True except tlslite.api.TLSError, error: print "Handshake failure:", str(error) return False
| 475,634
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,635
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,636
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,637
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,638
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,639
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + get_handlers put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,640
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,641
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
|
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
| 475,642
|
def ChromiumSyncCommandHandler(self): """Handle a chromiumsync command arriving via http.
|
def ChromiumSyncCommandHandler(self): """Handle a chromiumsync command arriving via http.
| 475,643
|
def MultipartHandler(self): """Send a multipart response (10 text/html pages).""" test_name = "/multipart" if not self._ShouldHandleRequest(test_name): return False
|
def MultipartHandler(self): """Send a multipart response (10 text/html pages).""" test_name = "/multipart" if not self._ShouldHandleRequest(test_name): return False
| 475,644
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,645
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port server._device_management_handler = None # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,646
|
def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
|
def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
| 475,647
|
def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
|
def _GetDirForTestFile(self, test_file): """Returns the highest-level directory by which to shard the given test file.""" # TODO(ojan): See if we can grab the lowest level directory. That will # provide better parallelization. We should at least be able to do so # for some directories (e.g. LayoutTests/dom). index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
| 475,648
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
| 475,649
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
| 475,650
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
|
def _PrintDirectoryTimings(self, write, directory_test_timings): """Print timing info by directory
| 475,651
|
def __init__(self, args, executable, num_shards, shard): self._args = args self._executable = executable self._num_shards = num_shards self._shard = shard self._test = None self._tempfile = tempfile.TemporaryFile()
|
def __init__(self, args, executable, num_shards, shard): self._args = args self._executable = executable self._num_shards = num_shards self._shard = shard self._test = None self._tempfile = tempfile.TemporaryFile()
| 475,652
|
def launch(self): env = os.environ.copy() env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) self._test = subprocess.Popen(args=self._args, executable=self._executable, stdout=self._tempfile, stderr=subprocess.STDOUT, env=env)
|
def launch(self): env = os.environ.copy() env['GTEST_TOTAL_SHARDS'] = str(self._num_shards) env['GTEST_SHARD_INDEX'] = str(self._shard) self._test = subprocess.Popen(args=self._args, executable=self._executable, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
| 475,653
|
def wait(self): code = self._test.wait() self._tempfile.seek(0) print self._tempfile.read() self._tempfile.close() return code
|
def wait(self): code = self._test.wait() self._tempfile.seek(0) print self._tempfile.read() self._tempfile.close() return code
| 475,654
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # First write the data length as an unsigned 4-byte value. This # is _not_ using network byte ordering since the other end of the # pipe is on the same machine. startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # First write the data length as an unsigned 4-byte value. This # is _not_ using network byte ordering since the other end of the # pipe is on the same machine. startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,655
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # First write the data length as an unsigned 4-byte value. This # is _not_ using network byte ordering since the other end of the # pipe is on the same machine. startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
|
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = json.dumps(server_data) debug('sending server_data: %s' % server_data_json) server_data_len = len(server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # First write the data length as an unsigned 4-byte value. This # is _not_ using network byte ordering since the other end of the # pipe is on the same machine. startup_pipe.write(struct.pack('=L', server_data_len)) startup_pipe.write(server_data_json) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
| 475,656
|
def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count'])
|
def testCanFindMatchCountFail(self): """Verify Find match count for invalid search""" url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title1.html')) self.NavigateToURL(url) self.assertEqual(0, self.FindInPage('blah')['match_count'])
| 475,657
|
def CommitEntry(self, entry, cache_guid, commit_session): """Attempt to commit one entry to the user's account.
|
def CommitEntry(self, entry, cache_guid, commit_session): """Attempt to commit one entry to the user's account.
| 475,658
|
def HandleCommit(self, commit_message, commit_response): """Respond to a Commit request by updating the user's account state.
|
def HandleCommit(self, commit_message, commit_response): """Respond to a Commit request by updating the user's account state.
| 475,659
|
def _GetDangerousDownload(self): """Returns the file url for a dangerous download for this OS.""" sub_path = os.path.join(self.DataDir(), 'downloads', 'dangerous') if self.IsMac(): return os.path.join(sub_path, 'invalid-dummy.dmg') return os.path.join(sub_path, 'dangerous.exe')
|
def _GetDangerousDownload(self): """Returns the file path for a dangerous download for this OS.""" sub_path = os.path.join(self.DataDir(), 'downloads', 'dangerous') if self.IsMac(): return os.path.join(sub_path, 'invalid-dummy.dmg') return os.path.join(sub_path, 'dangerous.exe')
| 475,660
|
def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg)
|
def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg)
| 475,661
|
def testDeclineDangerousDownload(self): """Verify that we can decline dangerous downloads""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg)
|
def testDeclineDangerousDownload(self): """Verify that we can decline dangerous downloads""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg)
| 475,662
|
def testNoUnsafeDownloadsOnRestart(self): """Verify that unsafe file should not show up on session restart.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self.assertTrue(self.IsDownloadShelfVisible()) # Restart the browser and assert that the download was removed. self.RestartBrowser(clear_profile=False) self.assertFalse(os.path.exists(downloaded_pkg)) self.assertFalse(self.IsDownloadShelfVisible()) self.NavigateToURL("chrome://downloads") self.assertFalse(self.GetDownloadsInfo().Downloads())
|
def testNoUnsafeDownloadsOnRestart(self): """Verify that unsafe file should not show up on session restart.""" file_path = self._GetDangerousDownload() downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) self._ClearLocalDownloadState(downloaded_pkg) self._TriggerUnsafeDownload(os.path.basename(file_path)) self.assertTrue(self.IsDownloadShelfVisible()) # Restart the browser and assert that the download was removed. self.RestartBrowser(clear_profile=False) self.assertFalse(os.path.exists(downloaded_pkg)) self.assertFalse(self.IsDownloadShelfVisible()) self.NavigateToURL("chrome://downloads") self.assertFalse(self.GetDownloadsInfo().Downloads())
| 475,663
|
def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') elif self.IsMac(): pass
|
def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): logging.info('coverage_posix.py: doing a "cd .." ' 'to accomodate Linux/make PWD') os.chdir('..') elif start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') elif self.IsMac(): pass
| 475,664
|
def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif start_dir.endswith('build'): print 'coverage_posix.py: doing a "cd src" to accomodate buildbot PWD' os.chdir('src') elif self.IsMac(): pass
|
def GenerateLcovPosix(self): """Convert profile data to lcov on Mac or Linux.""" start_dir = os.getcwd() if self.IsLinux(): # With Linux/make (e.g. the coverage_run target), the current # directory for this command is .../build/src/chrome but we need # to be in .../build/src for the relative path of source files # to be correct. However, when run from buildbot, the current # directory is .../build. Accommodate. # On Mac source files are compiled with abs paths so this isn't # a problem. # This is a bit of a hack. The best answer is to require this # script be run in a specific directory for all cases (from # Makefile or from buildbot). if start_dir.endswith('chrome'): print 'coverage_posix.py: doing a "cd .." to accomodate Linux/make PWD' os.chdir('..') elif start_dir.endswith('build'): logging.info('coverage_posix.py: doing a "cd src" ' 'to accomodate buildbot PWD') os.chdir('src') elif self.IsMac(): pass
| 475,665
|
def WriteFile(self): """This is handler dumps the content of POST request to a disk file into the data_dir/dump. Sub-directories are not supported."""
|
def WriteFile(self): """This is handler dumps the content of POST request to a disk file into the data_dir/dump. Sub-directories are not supported."""
| 475,666
|
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
|
def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents."""
| 475,667
|
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
|
def FileHandler(self): """This handler sends the contents of the requested file. Wow, it's like a real webserver!"""
| 475,668
|
def MakeDumpDir(data_dir): """Create directory named 'dump' where uploaded data via HTTP POST request will be stored. If the directory already exists all files and subdirectories will be deleted.""" dump_dir = os.path.join(data_dir, 'dump'); if os.path.isdir(dump_dir): shutil.rmtree(dump_dir) os.mkdir(dump_dir)
|
def MakeDumpDir(data_dir): """Create directory named 'dump' where uploaded data via HTTP POST/PUT requests will be stored. If the directory already exists all files and subdirectories will be deleted.""" dump_dir = os.path.join(data_dir, 'dump'); if os.path.isdir(dump_dir): shutil.rmtree(dump_dir) os.mkdir(dump_dir)
| 475,669
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) FUNCTIONS_PER_FILE = 98 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
| 475,670
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, FUNCTIONS_PER_FILE): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
| 475,671
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + step if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
|
def WriteServiceUnitTests(self, filename): """Writes the service decorder unit tests.""" num_tests = len(self.functions) step = (num_tests + 1) / 2 count = 0 for test_num in range(0, num_tests, step): count += 1 name = filename % count file = CHeaderWriter( name, "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) file.SetFileNum(count) end = test_num + FUNCTIONS_PER_FILE if end > num_tests: end = num_tests for idx in range(test_num, end): func = self.functions[idx] if True: #gen_cmd = func.GetInfo('gen_cmd') #if gen_cmd == True or gen_cmd == None: if func.GetInfo('unit_test') == False: file.Write("// TODO(gman): %s\n" % func.name) else: func.WriteServiceUnitTest(file)
| 475,672
|
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
|
def Analyze(self, log_lines, check_sanity=False): """Analyzes the app's output and applies suppressions to the reports.
| 475,673
|
def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func)
|
def WriteDestinationInitalizationValidation(self, func, file): """Writes the client side destintion initialization validation.""" for arg in func.GetOriginalArgs(): arg.WriteDestinationInitalizationValidation(file, func)
| 475,674
|
def __init__(self, info, type_handler): for key in info: setattr(self, key, info[key]) self.type_handler = type_handler if not 'type' in info: self.type = ''
|
def __init__(self, info, type_handler): for key in info: setattr(self, key, info[key]) self.type_handler = type_handler if not 'type' in info: self.type = ''
| 475,675
|
def WriteClientSideValidationCode(self, file, func): """Writes the validation code for an argument.""" pass
|
def WriteClientSideValidationCode(self, file, func): """Writes the validation code for an argument.""" pass
| 475,676
|
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
|
def WriteDestinationInitalizationValidation(self, file, func): """Overridden from Argument.""" self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
| 475,677
|
def GetImmediateVersion(self): """Overridden from Argument.""" return None
|
def GetImmediateVersion(self): """Overridden from Argument.""" return None
| 475,678
|
def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return BucketPointerArgument(self.name, self.type)
|
def GetBucketVersion(self): """Overridden from Argument.""" if self.type == "const char*": return InputStringBucketArgument(self.name, self.type) return BucketPointerArgument(self.name, self.type)
| 475,679
|
def WriteGLES2ImplementationHeader(self, file): """Writes the GLES2 Implemention declaration.""" self.type_handler.WriteGLES2ImplementationHeader(self, file)
|
def WriteGLES2ImplementationHeader(self, file): """Writes the GLES2 Implemention declaration.""" self.type_handler.WriteGLES2ImplementationHeader(self, file)
| 475,680
|
def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n")
|
def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( filename, "// These functions emluate GLES2 over command buffers.\n")
| 475,681
|
def GetWebKitRev(): """Extract the 'webkit_revision' variable out of DEPS.""" locals = {'Var': lambda _: ''} execfile('DEPS', {}, locals) return locals['vars']['webkit_revision']
|
def GetWebKitRev(): """Extract the 'webkit_revision' variable out of DEPS.""" locals = {'Var': lambda _: locals["vars"][_]} execfile('DEPS', {}, locals) return locals['vars']['webkit_revision']
| 475,682
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = 'chrome' elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR
| 475,683
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = 'Chromium.app/Contents/MacOS/Chromium' elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR
| 475,684
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = "chrome.exe" BUILD_BASE_URL += BUILD_ARCHIVE_DIR
|
def SetArchiveVars(archive): """Set a bunch of global variables appropriate for the specified archive.""" global BUILD_ARCHIVE_TYPE global BUILD_ARCHIVE_DIR global BUILD_ZIP_NAME global BUILD_DIR_NAME global BUILD_EXE_NAME global BUILD_BASE_URL BUILD_ARCHIVE_TYPE = archive BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): BUILD_ZIP_NAME = 'chrome-linux.zip' BUILD_DIR_NAME = 'chrome-linux' BUILD_EXE_NAME = "chrome" elif BUILD_ARCHIVE_TYPE in ('mac'): BUILD_ZIP_NAME = 'chrome-mac.zip' BUILD_DIR_NAME = 'chrome-mac' BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium" elif BUILD_ARCHIVE_TYPE in ('xp'): BUILD_ZIP_NAME = 'chrome-win32.zip' BUILD_DIR_NAME = 'chrome-win32' BUILD_EXE_NAME = 'chrome.exe' BUILD_BASE_URL += BUILD_ARCHIVE_DIR
| 475,685
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print('Could not retrieve the download. Sorry.') sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
| 475,686
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unziping ...' UnzipFilenameToDir(BUILD_ZIP_NAME, os.curdir) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
| 475,687
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
|
def TryRevision(rev, profile, args): """Downloads revision |rev|, unzips it, and opens it for the user to test. |profile| is the profile to use.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. args = ['--user-data-dir=%s' % profile] + args flags = ' '.join(map(pipes.quote, args)) print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass
| 475,688
|
def AskIsGoodBuild(rev): """Ask the user whether build |rev| is good or bad.""" # Loop until we get a response that we can parse. while True: response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev)) if response and response in ("g", "b"): return response == "g"
|
def AskIsGoodBuild(rev): """Ask the user whether build |rev| is good or bad.""" # Loop until we get a response that we can parse. while True: response = raw_input('\nBuild %d is [(g)ood/(b)ad]: ' % int(rev)) if response and response in ('g', 'b'): return response == 'g'
| 475,689
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = '%s/LATEST' % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,690
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input('Bad revision [HEAD:%d]: ' % latest) if (bad_rev == ''): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,691
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print('Could not determine latest revision. This could be bad...') bad_rev = int(raw_input('Bad revision: ')) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,692
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input('Last known good [0]: ')) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,693
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print 'We don\'t have enough builds to bisect. revlist: %s' % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,694
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print('%d candidates. %d tries left.' % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,695
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print('Candidates: %s' % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,696
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print('You are probably looking for build %d.' % revlist[bad]) print('CHANGELOG URL:') print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
| 475,697
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad])
|
def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print('Built at revision:') print(BUILD_VIEWVC_URL % revlist[bad])
| 475,698
|
# Bogus ifdef tricks
|
# Bogus ifdef tricks
| 475,699
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.