1#!/usr/bin/python 2# 3# Copyright 2010 Google Inc. All Rights Reserved. 4 5import optparse 6import pickle 7import sys 8import xmlrpclib 9 10from automation.clients.helper import chromeos 11from automation.common import job_group 12 13 14def Main(argv): 15 parser = optparse.OptionParser() 16 parser.add_option('-c', 17 '--chromeos_version', 18 dest='chromeos_version', 19 default='quarterly', 20 help='ChromeOS version to use.') 21 parser.add_option('-t', 22 '--toolchain', 23 dest='toolchain', 24 default='latest-toolchain', 25 help='Toolchain to use {latest-toolchain,gcc_46}.') 26 parser.add_option('-b', 27 '--board', 28 dest='board', 29 default='x86-generic', 30 help='Board to use for the nightly job.') 31 options = parser.parse_args(argv)[0] 32 33 toolchain = options.toolchain 34 board = options.board 35 chromeos_version = options.chromeos_version 36 37 # Build toolchain 38 jobs_factory = chromeos.JobsFactory(chromeos_version=chromeos_version, 39 board=board, 40 toolchain=toolchain) 41 benchmark_job = jobs_factory.BuildAndBenchmark() 42 43 group_label = 'nightly_client_%s' % board 44 group = job_group.JobGroup(group_label, [benchmark_job], True, False) 45 46 server = xmlrpclib.Server('http://localhost:8000') 47 server.ExecuteJobGroup(pickle.dumps(group)) 48 49 50if __name__ == '__main__': 51 Main(sys.argv) 52