コード例 #1
0
 def invoke(self):
     server = AuthenticatingServerProxy(self.args.SERVER,
                                        auth_backend=KeyringAuthBackend())
     try:
         job_id = server.scheduler.resubmit_job(self.args.JOB_ID)
     except xmlrpclib.Fault, e:
         raise CommandError(str(e))
コード例 #2
0
ファイル: commands.py プロジェクト: cataglyphis/LAVA
    def invoke(self):
        if self.args.output is None and not self.args.stdout:
            filename = str(self.args.DEVICE_HOSTNAME) + '_config.yaml'
            if os.path.exists(filename) and not self.args.overwrite:
                print >> sys.stderr, "File {filename!r} already exists".format(
                    filename=filename)
                print >> sys.stderr, "You may pass --overwrite to write over it"
                return -1
            stream = open(filename, "wb")
        elif self.args.stdout:
            stream = sys.stdout
            filename = "stdout"
        else:
            stream = self.args.output
            filename = self.args.output.name

        server = AuthenticatingServerProxy(
            self.args.SERVER, auth_backend=KeyringAuthBackend())
        try:
            stream.write(server.scheduler.get_pipeline_device_config(
                self.args.DEVICE_HOSTNAME).data)
            print "Downloaded device config of {0} to file {1!r}".format(
                self.args.DEVICE_HOSTNAME, filename)
        except xmlrpclib.Fault as exc:
            print >> sys.stderr, exc
            return -1
コード例 #3
0
ファイル: commands.py プロジェクト: jarsonfang/lava-v1
    def invoke(self):
        server = AuthenticatingServerProxy(self.args.SERVER,
                                           auth_backend=KeyringAuthBackend())
        jobs_list = server.scheduler.all_jobs()

        data_for_renderer = []
        for row in jobs_list:
            if row[6]:
                job_id = row[6]
            else:
                job_id = row[0]
            if row[4]:
                req_d = row[4]["hostname"]
            else:
                req_d = row[5]["name"]
            if row[3]:
                req_d = ""
                act_d = row[3]["hostname"]
            else:
                act_d = ""
            data_for_renderer.append(
                dict(
                    zip([
                        'id', 'description', 'status', 'actual_device',
                        'requested_device'
                    ], [job_id, row[1], row[2], act_d, req_d])))

        self.renderer.render(data_for_renderer)
コード例 #4
0
    def invoke(self):
        server = AuthenticatingServerProxy(self.args.SERVER,
                                           auth_backend=KeyringAuthBackend())
        job_details = server.scheduler.job_details(self.args.JOB_ID)

        print "Details of job {0}: \n".format(str(self.args.JOB_ID))
        for detail in job_details:
            print "%s: %s" % (detail, job_details[detail])
コード例 #5
0
    def invoke(self):
        server = AuthenticatingServerProxy(self.args.SERVER,
                                           auth_backend=KeyringAuthBackend())
        job_status = server.scheduler.job_status(self.args.JOB_ID)

        print "Job ID: %s\nJob Status: %s\nBundle SHA1: %s" % \
            (str(self.args.JOB_ID), job_status['job_status'],
             job_status['bundle_sha1'])
コード例 #6
0
 def __init__(self, parser, args):
     super(XMLRPCCommand, self).__init__(parser, args)
     xml_rpc_url = self._construct_xml_rpc_url(self.args.dashboard_url)
     self.server = AuthenticatingServerProxy(
         xml_rpc_url,
         verbose=args.verbose_xml_rpc,
         allow_none=True,
         use_datetime=True,
         auth_backend=KeyringAuthBackend())
コード例 #7
0
 def invoke(self):
     server = AuthenticatingServerProxy(self.args.SERVER,
                                        auth_backend=KeyringAuthBackend())
     with open(self.args.JSON_FILE, 'rb') as stream:
         command_text = stream.read()
     try:
         job_id = server.scheduler.submit_job(command_text)
     except xmlrpclib.Fault, e:
         raise CommandError(str(e))
コード例 #8
0
 def __init__(self, parser, args):
     super(pull, self).__init__(parser, args)
     remote_xml_rpc_url = self._construct_xml_rpc_url(self.args.FROM)
     self.remote_server = AuthenticatingServerProxy(
         remote_xml_rpc_url,
         verbose=args.verbose_xml_rpc,
         use_datetime=True,
         allow_none=True,
         auth_backend=KeyringAuthBackend())
     self.use_non_legacy_api_if_possible('remote_server')
コード例 #9
0
ファイル: commands.py プロジェクト: cataglyphis/LAVA
 def invoke(self):
     # ServerProxy for [email protected]/RPC2/
     server = AuthenticatingServerProxy(
         self.args.SERVER, auth_backend=KeyringAuthBackend())
     if not os.path.exists(self.args.JSON_FILE):
         raise CommandError("No such file: %s" % self.args.JSON_FILE)
     with open(self.args.JSON_FILE, 'rb') as stream:
         command_text = stream.read()
     try:
         job_ids = server.scheduler.submit_job(command_text)
     except xmlrpclib.Fault, e:
         raise CommandError(str(e))
コード例 #10
0
def submit_yaml_job(job_yaml_str, server_url):
    #TOKEN = ""
    #SERVER_URL="https://yongqin.liu:%[email protected]/RPC2/" % TOKEN
    # server = xmlrpclib.ServerProxy(SERVER_URL)
    server = AuthenticatingServerProxy(server_url,
                                       auth_backend=KeyringAuthBackend())
    try:
        job_id = server.scheduler.submit_job(job_yaml_str)
        print "Job %s submitted successfuly." % str(job_id)
    except xmlrpclib.Fault as e:
        raise e
    except:
        raise
コード例 #11
0
ファイル: commands.py プロジェクト: cataglyphis/LAVA
    def invoke(self):
        server = AuthenticatingServerProxy(
            self.args.SERVER, auth_backend=KeyringAuthBackend())
        all_devices = server.scheduler.all_devices()

        data_for_renderer = []
        for row in all_devices:
            if row[3]:
                job_id = row[3]
            else:
                job_id = ""
            data_for_renderer.append(dict(zip(['hostname', 'device_type_name', 'status', 'job'],
                                     [row[0], row[1], row[2], job_id])))

        self.renderer.render(data_for_renderer)
コード例 #12
0
    def authenticated_server(self):
        """Returns a connection to a LAVA server.

        It will ask the user the necessary parameters to establish the
        connection.
        """
        print >> sys.stdout, "\nServer connection parameters:"

        server_name_parameter = Parameter("server")
        rpc_endpoint_parameter = Parameter("rpc_endpoint",
                                           depends=server_name_parameter)

        self.config.get(server_name_parameter)
        endpoint = self.config.get(rpc_endpoint_parameter)

        rpc_url = verify_and_create_url(endpoint)
        server = AuthenticatingServerProxy(rpc_url,
                                           auth_backend=KeyringAuthBackend())
        return server
コード例 #13
0
    def invoke(self):
        if self.args.output is None:
            filename = str(self.args.JOB_ID) + '_output.txt'
            if os.path.exists(filename) and not self.args.overwrite:
                print >> sys.stderr, "File {filename!r} already exists".format(
                    filename=filename)
                print >> sys.stderr, "You may pass --overwrite to write over it"
                return -1
            stream = open(filename, "wb")
        else:
            stream = self.args.output
            filename = self.args.output.name

        server = AuthenticatingServerProxy(self.args.SERVER,
                                           auth_backend=KeyringAuthBackend())
        stream.write(server.scheduler.job_output(self.args.JOB_ID).data)

        print "Downloaded job output of {0} to file {1!r}".format(
            self.args.JOB_ID, filename)
コード例 #14
0
 def __init__(self, parser, args, auth_backend=None):
     super(auth_add, self).__init__(parser, args)
     if auth_backend is None:
         auth_backend = KeyringAuthBackend()
     self.auth_backend = auth_backend
コード例 #15
0
 def invoke(self):
     server = AuthenticatingServerProxy(self.args.SERVER,
                                        auth_backend=KeyringAuthBackend())
     server.scheduler.cancel_job(self.args.JOB_ID)
コード例 #16
0
                        "|arm64-v8a.+_executed"
                        "|arm64-v8a.+_failed"
                        "|armeabi-v7a.+_executed"
                        "|armeabi-v7a.+_failed"
                        ")$")
names_ignore = [
    "test-attachment",
    "test-skipped",
    "regression_4003_XTS",
    "regression_4003_NO_XTS",
    "subtests-fail-rate",
    "tradefed-test-run",
]

server = AuthenticatingServerProxy(SERVER_URL,
                                   auth_backend=KeyringAuthBackend())
#TOKEN = "n2ab47pbfbu4um0sw5r3zd22q1zdorj7nlnj3qaaaqwdfigahkn6j1kp0ze49jjir84cud7dq4kezhms0jrwy14k1m609e8q50kxmgn9je3zlum0yrlr0njxc87bpss9"
#SERVER_URL="https://yongqin.liu:%[email protected]/RPC2/" % TOKEN


def get_yaml_result(job_id, server):
    tests_res = []
    # server = xmlrpclib.ServerProxy(SERVER_URL)
    try:
        #job_id = server.scheduler.submit_job(job_yaml_str)
        res = server.results.get_testjob_results_yaml(job_id)
        #res = server.results.get_testjob_results_csv(job_id)
        #print "results for job %s:" % str(job_id)
        #print "%s" % str(yaml.load(res))
        for test in yaml.load(res):
            if test.get("suite") == "lava":