예제 #1
0
 def __init__(self, cmd_json):
     logging.info('Starting new Build Run')
     launch_bldsrv_cmd = ['gce-xfstests', 'launch-bldsrv']
     self.launch_bldsrv_cmd = launch_bldsrv_cmd
     self.gce_proj_id = gce_funcs.get_proj_id()
     self.gce_project = gce_funcs.get_proj_id().strip()
     self.gce_zone = gce_funcs.get_gce_zone()
     self.gce_region = self.gce_zone[:-2]
     self.gs_bucket = gce_funcs.get_gs_bucket().strip()
     self.instance_name = 'xfstests-bldsrv'
     self.cmd_json = cmd_json
     self.compute = googleapiclient.discovery.build('compute', 'v1')
예제 #2
0
 def __init__(self, orig_cmd, test_run_id, shard_log_dir_path, gs_bucket,
              bucket_subdir, gs_kernel):
     self.gce_proj_id = gce_funcs.get_proj_id()
     self.gce_zone = gce_funcs.get_gce_zone()
     self.gce_region = self.gce_zone[:-2]
     self.gs_bucket = gs_bucket
     self.bucket_subdir = bucket_subdir
     self.gs_kernel = gs_kernel
     self.test_run_id = test_run_id
     self.shard_log_dir_path = shard_log_dir_path
     self.orig_cmd = orig_cmd
     self.parser = LTMParser(orig_cmd)
     self.compute = googleapiclient.discovery.build('compute', 'v1')
     self.extra_cmds = ' '.join(self.parser.extra_cmds)
예제 #3
0
    def __init__(self, cmd_json, orig_cmd, opts=None):
        logging.info('Launching new build')
        logging.info('Getting unique build id..')
        build_id = get_datetime_build_id()
        logging.info('Creating new build with id %s', build_id)

        self.id = build_id
        self.orig_cmd = orig_cmd.strip()
        self.log_dir_path = BLDSRV.build_log_dir + '%s/' % build_id
        self.log_file_path = self.log_dir_path + 'run.log'

        BLDSRV.create_log_dir(self.log_dir_path)
        logging.info('Created new build with id %s', self.id)

        self.gs_bucket = gce_funcs.get_gs_bucket().strip()
        self.bucket_subdir = gce_funcs.get_bucket_subdir().strip()
        self.gs_kernel = None
        self.gce_proj_id = gce_funcs.get_proj_id()
        self.gce_project = gce_funcs.get_proj_id().strip()
        self.gce_zone = gce_funcs.get_gce_zone()
        self.gce_region = self.gce_zone[:-2]
        self.cmd_json = cmd_json

        if opts and 'commit_id' in opts:
            self.commit = opts['commit_id'].strip()
        if opts and 'git_repo' in opts:
            self.repository = opts['git_repo'].strip()
        self.build_dir = make_kernel_dir(self.repository)
        self.build_path = BLDSRV.repo_cache_path + self.build_dir
        self.kernel_build = self.build_path + BLDSRV.image_path
        self.kernel_build_filename = BLDSRV.image_name

        logging.info('Cloning repository to %s', self.build_path)

        self.kbuild = Kbuild(self.repository, self.commit, self.build_dir,
                             self.id, self.log_dir_path)
예제 #4
0
  def __init__(self, test_fs_cfg, extra_cmds, shard_id, test_run_id,
               log_dir_path, gce_zone=None, gs_bucket=None, gce_project=None,
               bucket_subdir=None, gs_kernel=None):
    if (not isinstance(extra_cmds, basestring) or
        not isinstance(shard_id, basestring) or
        not isinstance(test_run_id, basestring)):
      raise TypeError
    logging.debug('Creating Shard instance %s', shard_id)

    self.extra_cmds = extra_cmds
    self.test_run_id = test_run_id
    self.id = shard_id
    self.test_fs_cfg = test_fs_cfg
    self.config_cmd_arr = ['-c', test_fs_cfg]
    self.extra_cmd_arr = extra_cmds.strip().split(' ')
    if gce_zone:
      self.gce_zone = gce_zone
    else:
      self.gce_zone = gce_funcs.get_gce_zone().strip()
    if gs_bucket:
      self.gs_bucket = gs_bucket
    else:
      self.gs_bucket = gce_funcs.get_gs_bucket().strip()
    if bucket_subdir:
      self.bucket_subdir = bucket_subdir
    else:
      self.bucket_subdir = gce_funcs.get_bucket_subdir().strip()
    if gce_project:
      self.gce_project = gce_project
    else:
      self.gce_project = gce_funcs.get_proj_id().strip()
    self.keep_dead_vm = gce_funcs.get_keep_dead_vm()
    self.instance_name = 'xfstests-%s-%s-%s' % (
        LTM.ltm_username, self.test_run_id, self.id)

    gce_xfstests_cmd = ['gce-xfstests', '--instance-name', self.instance_name]
    if gce_zone:
      gce_xfstests_cmd.extend(['--gce-zone', gce_zone])
    if gs_bucket:
      gce_xfstests_cmd.extend(['--gs-bucket', gs_bucket])
    if bucket_subdir:
      gce_xfstests_cmd.extend(['--bucket-subdir', bucket_subdir])
    if gs_kernel:
      gce_xfstests_cmd.extend(['--kernel', gs_kernel])
    gce_xfstests_cmd.extend(['--image-project', self.gce_project])
    gce_xfstests_cmd.extend(['--no-email'])  # Shards shouldn't send emails.
    gce_xfstests_cmd.extend(self.config_cmd_arr)
    gce_xfstests_cmd.extend(self.extra_cmd_arr)
    self.gce_xfstests_cmd = gce_xfstests_cmd

    # LOG/RESULTS VARIABLES
    self.log_file_path = log_dir_path + self.id
    self.cmdlog_file_path = self.log_file_path + '.cmdlog'
    self.serial_output_file_path = self.log_file_path + '.serial'
    self.results_name = '%s-%s-%s' % (LTM.ltm_username, self.test_run_id,
                                      self.id)
    self.tmp_results_dir = '/tmp/results-%s-%s-%s' % (
        LTM.ltm_username, self.test_run_id, self.id)
    self.unpacked_results_dir = '%s/results-%s-%s-%s' % (
        log_dir_path, LTM.ltm_username, self.test_run_id, self.id)

    logging.debug('Created Shard instance %s', shard_id)