Ejemplo n.º 1
0
    def test_03_update_osg_release(self):
        core.state['install.release-updated'] = False
        if not core.options.updaterelease:
            return

        self.skip_bad_unless(core.state['install.success'],
                             'Install did not succeed')

        command = ['rpm', '-e', 'osg-release']
        core.check_system(command, 'Erase osg-release')

        self.assert_(re.match('\d+\.\d+', core.options.updaterelease),
                     "Unrecognized updaterelease format")
        rpm_url = 'https://repo.opensciencegrid.org/osg/' + core.options.updaterelease + '/osg-' + \
                  core.options.updaterelease + '-el' + str(core.el_release()) + '-release-latest.rpm'
        command = ['rpm', '-Uvh', rpm_url]
        core.check_system(command, 'Update osg-release')

        core.config['yum.clean_repos'] = ['osg'] + core.options.updaterepos
        yum.clean(*core.config['yum.clean_repos'])

        # If update repos weren't specified, just use osg-release
        if not core.options.updaterepos:
            core.options.updaterepos = ['osg']

        core.state['install.release-updated'] = True
        core.osg_release(update_state=True)
Ejemplo n.º 2
0
    def test_03_update_osg_release(self):
        core.state['install.release-updated'] = False
        if not core.options.updaterelease:
            return

        self.skip_bad_unless(core.state['install.success'], 'Install did not succeed')

        command = ['rpm', '-e', 'osg-release']
        core.check_system(command, 'Erase osg-release')

        self.assert_(re.match('\d+\.\d+', core.options.updaterelease), "Unrecognized updaterelease format")
        rpm_url = 'https://repo.opensciencegrid.org/osg/' + core.options.updaterelease + '/osg-' + \
                  core.options.updaterelease + '-el' + str(core.el_release()) + '-release-latest.rpm'
        command = ['rpm', '-Uvh', rpm_url]
        core.check_system(command, 'Update osg-release')

        core.config['yum.clean_repos'] = ['osg'] + core.options.updaterepos
        yum.clean(*core.config['yum.clean_repos'])

        # If update repos weren't specified, just use osg-release
        if not core.options.updaterepos:
            core.options.updaterepos = ['osg']

        core.state['install.release-updated'] = True
        core.osg_release(update_state=True)
Ejemplo n.º 3
0
    def test_02_condor_ce_run_condor(self):
        core.skip_ok_unless_installed('htcondor-ce', 'htcondor-ce-client',
                                      'htcondor-ce-condor', 'condor')

        self.skip_bad_unless(service.is_running('condor-ce'), 'ce not running')
        self.skip_bad_unless(service.is_running('condor'),
                             'condor not running')
        self.skip_bad_unless(core.state['jobs.env-set'],
                             'job environment not set')
        token_file = core.config['token.condor_write']
        self.skip_bad_unless(
            core.state['proxy.valid'] or os.path.exists(token_file),
            'requires a scitoken or a proxy')

        command = [
            'condor_ce_run', '--debug', '-r',
            '%s:9619' % core.get_hostname(), '/bin/env'
        ]

        if os.path.exists(token_file):
            # FIXME: After HTCONDOR-636 is released (targeted for HTCondor-CE 5.1.2),
            # we can stop setting _condor_SCITOKENS_FILE
            for token_var in ('_condor_SCITOKENS_FILE', 'BEARER_TOKEN_FILE'):
                os.environ[token_var] = token_file
        else:
            core.log_message(
                'condor WRITE token not found; skipping SCITOKENS auth')

        if core.osg_release() == "3.6" and \
           core.PackageVersion('condor') >= '9.0.0' and \
           core.PackageVersion('condor') < '9.0.8':
            with core.no_x509(core.options.username):
                self.run_job_in_tmp_dir(command, 'condor_ce_run a Condor job')
        else:
            self.run_job_in_tmp_dir(command, 'condor_ce_run a Condor job')
Ejemplo n.º 4
0
    def run_trace(self, *args):
        """Run condor_ce_trace along with any additional *args. If trace completes with a held job, also return output
        from 'condor_ce_q -held'.
        """

        cwd = os.getcwd()
        os.chdir('/tmp')
        self.command += ['condor_ce_trace', '--debug'
                         ] + list(args) + [core.get_hostname()]
        if core.osg_release() == "3.6" and \
           core.PackageVersion('condor') >= '9.0.0' and \
           core.PackageVersion('condor') < '9.0.8':
            with core.no_x509(core.options.username):
                trace_rc, trace_out, trace_err = core.system(self.command,
                                                             user=True)
        else:
            trace_rc, trace_out, trace_err = core.system(self.command,
                                                         user=True)
        os.chdir(cwd)

        if trace_rc:
            msg = 'condor_ce_trace failed'
            if trace_out.find(', was held'):
                msg = 'condor_ce_trace job held'
                _, hold_out, hold_err = core.system(('condor_ce_q', '-held'))
            self.fail(
                core.diagnose(msg, self.command, trace_rc,
                              str(trace_out) + str(hold_out),
                              str(trace_err) + str(hold_err)))

        return trace_out, trace_err
Ejemplo n.º 5
0
 def test_01_yum_repositories(self):
     pre = ('rpm', '--verify', '--nomd5', '--nosize', '--nomtime')
     core.check_system(pre + ('epel-release',), 'Verify epel-release')
     # If osg-release isn't installed, try osg-release-itb
     try:
         core.check_system(pre + ('osg-release',), 'Verify osg-release')
     except AssertionError:
         core.check_system(pre + ('osg-release-itb',), 'Verify osg-release + osg-release-itb')
     core.config['install.original-release-ver'] = core.osg_release()
Ejemplo n.º 6
0
 def test_01_yum_repositories(self):
     pre = ('rpm', '--verify', '--nomd5', '--nosize', '--nomtime')
     core.check_system(pre + ('epel-release',), 'Verify epel-release')
     # If osg-release isn't installed, try osg-release-itb
     try:
         core.check_system(pre + ('osg-release',), 'Verify osg-release')
     except AssertionError:
         core.check_system(pre + ('osg-release-itb',), 'Verify osg-release + osg-release-itb')
     core.config['install.original-release-ver'] = core.osg_release()
Ejemplo n.º 7
0
    def test_02_install_packages(self):
        core.state['install.success'] = False
        core.state['install.installed'] = []
        core.state['install.updated'] = []
        core.state['install.replace'] = []
        core.state['install.orphaned'] = []
        core.state['install.os_updates'] = []

        # Install packages
        core.state['install.transaction_ids'] = []
        fail_msg = ''
        pkg_repo_dict = OrderedDict((x, core.options.extrarepos) for x in core.options.packages)

        # HACK: Install Slurm and osg-tested-internal out of development-like repos.
        # SOFTWARE-1733 may one day give us a generalized solution.
        if core.osg_release() > '3.4':
            dev_repo = ['devops-itb']
            if 'osg-tested-internal' in pkg_repo_dict:
                pkg_repo_dict['osg-tested-internal'] += dev_repo
        else:
            dev_repo = ['osg-development']

        if 'osg-tested-internal' in pkg_repo_dict or 'slurm' in pkg_repo_dict:
            pkg_repo_dict.update(dict((x, core.options.extrarepos + dev_repo) for x in core.SLURM_PACKAGES))

        # HACK: Install x509-scitokens-issuer-client out of development (SOFTWARE-3649)
        if 'xrootd-scitokens' in pkg_repo_dict:
            pkg_repo_dict["x509-scitokens-issuer-client"] = ["osg-development"]

        for pkg, repos in pkg_repo_dict.items():
            # Do not try to re-install packages
            if core.rpm_is_installed(pkg):
                continue

            # Attempt installation
            command = ['yum', '-y']
            command += ['--enablerepo=%s' % x for x in repos]
            command += ['install', pkg]

            retry_fail, _, stdout, _ = yum.retry_command(command)
            if retry_fail == '':   # the command succeeded
                core.state['install.transaction_ids'].append(yum.get_transaction_id())
                command = ('rpm', '--verify', pkg)
                core.check_system(command, 'Verify %s' % (pkg))
                yum.parse_output_for_packages(stdout)

            fail_msg += retry_fail

        if fail_msg:
            self.fail(fail_msg)
        core.state['install.success'] = True
Ejemplo n.º 8
0
    def test_03_lfc_multilib(self):
        # We do not ship lfc-* in OSG 3.3
        self.skip_ok_if(core.osg_release().split('.') >= ['3','3'], message='OSG 3.3+')
        # We do not build 32-bit packages on EL7
        self.skip_ok_if(core.el_release() >= 7, message='running on EL7+')

        core.skip_ok_unless_installed('yum-utils')

        # We can't test this on 32-bit
        uname_out, _, _ = core.check_system(['uname', '-i'], 'getting arch')
        self.skip_ok_if(re.search(r'i\d86', uname_out), message='running on 32-bit')

        cmdbase = ['repoquery', '--plugins']
        for repo in core.options.extrarepos:
            cmdbase.append('--enablerepo=%s' % repo)

        # Find the 32-bit lfc-python rpm
        stdout, _, _ = core.check_system(cmdbase + ['lfc-python.i386'], 'lfc-python multilib (32bit)')
        if stdout.strip() == '':
            self.fail('32-bit lfc-python not found in 64-bit repo')

        # Sanity check: find the 64-bit lfc-python rpm
        stdout, _, _ = core.check_system(cmdbase + ['lfc-python.x86_64'], 'lfc-python multilib (64bit)')
        if stdout.strip() == '':
            self.fail('64-bit lfc-python not found in 64-bit repo')

        # Find the 32-bit lfc-python26 rpm (on el5 only)
        if core.el_release() == 5:
            stdout, _, _ = core.check_system(cmdbase + ['lfc-python26.i386'], 'lfc-python26 multilib (32bit)')
            if stdout.strip() == '':
                self.fail('32-bit lfc-python not found in 64-bit repo')

            # Sanity check: find the 64-bit lfc-python26 rpm
            stdout, _, _ = core.check_system(cmdbase + ['lfc-python26.x86_64'], 'lfc-python26 multilib (64bit)')
            if stdout.strip() == '':
                self.fail('64-bit lfc-python not found in 64-bit repo')
Ejemplo n.º 9
0
 def setUpClass(self):
     # glexec not available in 3.4
     self.skip_ok_if(core.osg_release())
Ejemplo n.º 10
0
 def setUpClass(self):
     # glexec not available in 3.4
     self.skip_ok_if(core.osg_release())