示例#1
0
 def test_01_stop_server(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['pbs_server.started-service'],
                         'did not start pbs server')
     service.check_stop('pbs_server')
     files.restore(core.config['torque.pbs-serverdb'], 'pbs')
     files.restore(core.config['torque.pbs-nodes-file'], 'pbs')
示例#2
0
 def test_01_stop_condor(self):
     core.skip_ok_unless_installed('condor')
     self.skip_ok_unless(core.state['condor.started-service'],
                         'did not start server')
     service.check_stop('condor')
     files.restore(core.config['condor.personal_condor'], 'condor')
     core.state['condor.running-service'] = False
示例#3
0
 def test_01_stop_slurm(self):
     self.slurm_reqs()
     self.skip_ok_unless(core.state['%s.started-service' % core.config['slurm.service-name']], 'did not start slurm')
     service.check_stop(core.config['slurm.service-name']) # service requires config so we stop it first
     if core.el_release() == 7:
         service.check_stop(core.config['slurm.ctld-service-name'])
     files.restore(core.config['slurm.config'], 'slurm')
     files.restore(core.config['cgroup.config'], 'slurm')
     files.restore(core.config['cgroup_allowed_devices_file.conf'], 'slurm')
示例#4
0
    def test_01_stop_xrootd(self):
        if core.config['xrootd.gsi'] == "ON" and core.state['xrootd.backups-exist']:
            files.restore(core.config['xrootd.config'], "xrootd")
            files.restore('/etc/xrootd/auth_file', "xrootd")
            if not core.rpm_is_installed('xrootd-lcmaps'):
                files.restore('/etc/grid-security/xrd/xrdmapfile', "xrootd")

        core.skip_ok_unless_installed('xrootd', by_dependency=True)
        self.skip_ok_if(core.state['xrootd.started-server'], 'did not start server')
        service.check_stop(core.config['xrootd_service'])
示例#5
0
    def test_01_stop_xrootd(self):
        if core.state['xrootd.tpc.backups-exist']:
            files.restore(core.config['xrootd.tpc.config-1'], "xrootd")
            files.restore(core.config['xrootd.tpc.config-2'], "xrootd")

        core.skip_ok_unless_installed('xrootd', 'xrootd-scitokens', by_dependency=True)
        self.skip_ok_if(not core.state['xrootd.started-http-server-1'] and 
                        not core.state['xrootd.started-http-server-2'], 
                        'did not start any of the http servers')
        service.check_stop(core.config['xrootd_tpc_service_1'])
        service.check_stop(core.config['xrootd_tpc_service_2'])
示例#6
0
 def test_01_stop_slurm(self):
     self.slurm_reqs()
     self.skip_ok_unless(
         core.state['%s.started-service' %
                    core.config['slurm.service-name']],
         'did not start slurm')
     service.check_stop(core.config['slurm.service-name']
                        )  # service requires config so we stop it first
     service.check_stop(core.config['slurm.ctld-service-name'])
     files.restore(core.config['slurm.config'], 'slurm')
     files.restore(core.config['cgroup.config'], 'slurm')
     files.restore(core.config['cgroup_allowed_devices_file.conf'], 'slurm')
示例#7
0
    def test_01_stop_xrootd(self):
        if core.config['xrootd.gsi'] == "ON" and core.state[
                'xrootd.backups-exist']:
            files.restore(core.config['xrootd.config'], "xrootd")
            files.restore('/etc/xrootd/auth_file', "xrootd")
            if not core.rpm_is_installed('xrootd-lcmaps'):
                files.restore('/etc/grid-security/xrd/xrdmapfile', "xrootd")

        core.skip_ok_unless_installed('xrootd', by_dependency=True)
        self.skip_ok_if(core.state['xrootd.started-server'],
                        'did not start server')
        service.check_stop(core.config['xrootd_service'])
示例#8
0
 def test_01_stop_xrootd(self):
     if core.state['xrootd.backups-exist']:
         if core.PackageVersion('xrootd') < '1:4.9.0':
             files.restore(core.config['xrootd.config'], "xrootd")
         else:
             files.restore(core.config['xrootd.config-extra'], "xrootd")
         files.restore('/etc/xrootd/auth_file', "xrootd")
         if not core.rpm_is_installed('xrootd-lcmaps'):
             files.restore('/etc/grid-security/xrd/xrdmapfile', "xrootd")
     core.skip_ok_unless_installed('xrootd', by_dependency=True)
     self.skip_ok_if(core.state['xrootd.started-server'], 'did not start server')
     service.check_stop(core.config['xrootd_service'])
     files.remove(core.config['xrootd.tmp-dir'], force=True)
示例#9
0
    def test_01_stop_xrootd(self):
        if core.state['xrootd.tpc.backups-exist']:
            files.restore(core.config['xrootd.tpc.config-1'], "xrootd")
            files.restore(core.config['xrootd.tpc.config-2'], "xrootd")
            files.restore(core.config['xrootd.tpc.basic-config'], "xrootd")
            files.restore('/etc/xrootd/config.d/40-osg-standalone.cfg',
                          "xrootd")

        self.skip_ok_if(
            not core.state['xrootd.started-http-server-1']
            and not core.state['xrootd.started-http-server-2'],
            'did not start any of the http servers')
        service.check_stop(core.config['xrootd_tpc_service_1'])
        service.check_stop(core.config['xrootd_tpc_service_2'])
示例#10
0
 def test_01_stop_xrootd(self):
     if core.state['xrootd.backups-exist']:
         files.restore(core.config['xrootd.config'], "xrootd")
         files.restore('/etc/xrootd/auth_file', "xrootd")
         if not core.rpm_is_installed('xrootd-lcmaps'):
             files.restore('/etc/grid-security/xrd/xrdmapfile', "xrootd")
         if core.el_release() < 7:
             files.restore(core.config['xrootd.service-defaults'], "xrootd")
     core.skip_ok_unless_installed('xrootd',
                                   'globus-proxy-utils',
                                   by_dependency=True)
     self.skip_ok_if(core.state['xrootd.started-server'],
                     'did not start server')
     service.check_stop(core.config['xrootd_service'])
     files.remove(core.config['xrootd.tmp-dir'], force=True)
    def test_02_stop_xrootd_tpc(self):
        if core.state['xrootd.tpc.backups-exist']:
            files.restore(core.config['xrootd.tpc.config-1'], "xrootd")
            files.restore(core.config['xrootd.tpc.config-2'], "xrootd")
            files.restore(core.config['xrootd.tpc.basic-config'], "xrootd")
            files.restore(xrootd.logfile("third-party-copy-1"),
                          "xrootd",
                          ignore_missing=True)
            files.restore(xrootd.logfile("third-party-copy-2"),
                          "xrootd",
                          ignore_missing=True)

        self.skip_ok_if(
            not core.state['xrootd.started-http-server-1']
            and not core.state['xrootd.started-http-server-2'],
            'did not start any of the http servers')
        service.check_stop(core.config['xrootd_tpc_service_1'])
        service.check_stop(core.config['xrootd_tpc_service_2'])
示例#12
0
    def test_02_stop_xrootd(self):
        if core.state['xrootd.backups-exist']:
            files.restore(core.config['xrootd.config'], "xrootd")
            files.restore(core.config['xrootd.logging-config'], "xrootd")
            files.restore(core.config['xrootd.authfile'], "xrootd")
            files.restore(xrootd.logfile("standalone"), "xrootd", ignore_missing=True)
            if "SCITOKENS" in core.config['xrootd.security']:
                files.restore('/etc/xrootd/scitokens.conf', "xrootd")
                files.remove("/etc/xrootd/config.d/99-osgtest-ztn.cfg", force=True)
            if os.path.exists(xrootd.ROOTDIR):
                shutil.rmtree(xrootd.ROOTDIR)

        # Get xrootd service back to its original state
        self.skip_ok_unless(core.state['xrootd.is-configured'], "xrootd is not configured")
        xrootd_service = core.config['xrootd_service']
        if service.is_running(xrootd_service):
            service.check_stop(xrootd_service, force=True)
        if core.state.get('xrootd.service-was-running', False):
            service.check_start(xrootd_service, force=True)
示例#13
0
 def test_02_stop_cache(self):
     service.check_stop("xrootd@stashcache-cache-server")
示例#14
0
 def test_01_stop_gridftp(self):
     core.skip_ok_unless_installed('globus-gridftp-server-progs')
     self.skip_ok_if(core.state['gridftp.started-server'] == False, 'did not start server')
     service.check_stop('globus-gridftp-server')
     core.state['gridftp.running-server'] = False
示例#15
0
 def test_03_stop_scheduler(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['pbs_sched.started-service'],
                         'did not start pbs scheduler')
     service.check_stop('pbs_sched')
示例#16
0
 def test_01_stop_server(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['pbs_server.started-service'], 'did not start pbs server')
     service.check_stop('pbs_server')
     files.restore(core.config['torque.pbs-serverdb'], 'pbs')
     files.restore(core.config['torque.pbs-nodes-file'], 'pbs')
示例#17
0
    def test_01_stop_voms(self):
        voms.skip_ok_unless_installed()
        self.skip_ok_unless(core.state['voms.started-server'], 'did not start server')

        service.check_stop(core.config['voms_service'])
示例#18
0
 def test_01_stop_rsv(self):
     core.skip_ok_unless_installed('rsv')
     self.skip_ok_if(core.state['rsv.started-service'] == False,
                     'did not start service')
     service.check_stop('rsv')
     core.state['rsv.running-service'] = False
示例#19
0
 def test_01_stop_condor(self):
     core.skip_ok_unless_installed('condor')
     self.skip_ok_unless(core.state['condor.started-service'], 'did not start server')
     service.check_stop('condor')
     files.restore(core.config['condor.personal_condor'], 'condor')
     core.state['condor.running-service'] = False
示例#20
0
 def test_02_stop_trqauthd(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['trqauthd.started-service'], 'did not start trqauthd')
     service.check_stop('trqauthd')
     files.restore(core.config['torque.pbs-servername-file'], 'pbs')
示例#21
0
 def test_01_stop_munge(self):
     core.skip_ok_unless_installed('munge')
     self.skip_ok_unless(core.state['munge.started-service'],
                         'munge not running')
     service.check_stop('munge')
     files.restore(core.config['munge.keyfile'], 'munge')
示例#22
0
 def test_01_stop_rsv(self):
     core.skip_ok_unless_installed('rsv')
     self.skip_ok_if(core.state['rsv.started-service'] == False, 'did not start service')
     service.check_stop('rsv')
     core.state['rsv.running-service'] = False
示例#23
0
 def test_01_stop_munge(self):
     core.skip_ok_unless_installed('munge')
     self.skip_ok_unless(core.state['munge.started-service'], 'munge not running')
     service.check_stop('munge')
     files.restore(core.config['munge.keyfile'], 'munge')
示例#24
0
 def test_01_stop_condor_cron(self):
     core.skip_ok_unless_installed('condor-cron')
     self.skip_ok_if(core.state['condor-cron.started-service'] == False, 'did not start server')
     service.check_stop('condor-cron')
     core.state['condor-cron.running-service'] = False
示例#25
0
 def test_01_stop(self):
     service.check_stop('gsisshd')
示例#26
0
 def test_01_stop_bestman(self):
     core.skip_ok_unless_installed('bestman2-server', 'bestman2-client', 'gums-service')
     self.skip_ok_unless(core.state['bestman.started-server'], 'bestman server not started')
     service.check_stop('bestman2')
示例#27
0
 def test_01_stop_gridftp(self):
     core.skip_ok_unless_installed('globus-gridftp-server-progs')
     self.skip_ok_if(core.state['gridftp.started-server'] == False,
                     'did not start server')
     service.check_stop('globus-gridftp-server')
     core.state['gridftp.running-server'] = False
示例#28
0
def stop():
    service.check_stop(PACKAGE_NAME)
示例#29
0
 def test_stop_haveged(self):
     core.skip_ok_unless_installed('haveged')
     service.check_stop('haveged')
示例#30
0
 def test_02_stop_trqauthd(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['trqauthd.started-service'],
                         'did not start trqauthd')
     service.check_stop('trqauthd')
     files.restore(core.config['torque.pbs-servername-file'], 'pbs')
示例#31
0
 def test_01_stop_tomcat(self):
     core.skip_ok_unless_installed(tomcat.pkgname())
     self.skip_bad_unless(core.state['tomcat.started'], 'Tomcat not started')
     service.check_stop(tomcat.pkgname())
示例#32
0
    def test_01_stop_voms(self):
        voms.skip_ok_unless_installed()
        self.skip_ok_unless(core.state['voms.started-server'],
                            'did not start server')

        service.check_stop(core.config['voms_service'])
示例#33
0
 def test_01_stop_myproxy(self):
     core.skip_ok_unless_installed('myproxy-server')
     self.skip_ok_unless(core.state['myproxy.started-server'],
                         'did not start server')
     service.check_stop('myproxy-server')
示例#34
0
 def test_01_stop_origin(self):
     service.check_stop("xrootd@stashcache-origin-server")
示例#35
0
 def test_stop_haveged(self):
     core.skip_ok_unless_installed('haveged')
     service.check_stop('haveged')
示例#36
0
    def test_07_ping_with_gums(self):
        core.state['condor-ce.gums-auth'] = False
        self.general_requirements()
        core.skip_ok_unless_installed('gums-service')

        # Setting up GUMS auth using the instructions here:
        # https://opensciencegrid.github.io/docs/compute-element/install-htcondor-ce/#authentication-with-gums
        hostname = core.get_hostname()

        lcmaps_contents = '''gumsclient = "lcmaps_gums_client.mod"
             "-resourcetype ce"
             "-actiontype execute-now"
             "-capath /etc/grid-security/certificates"
             "-cert   /etc/grid-security/hostcert.pem"
             "-key    /etc/grid-security/hostkey.pem"
             "--cert-owner root"
# Change this URL to your GUMS server
             "--endpoint https://%s:8443/gums/services/GUMSXACMLAuthorizationServicePort"

verifyproxy = "lcmaps_verify_proxy.mod"
          "--allow-limited-proxy"
          " -certdir /etc/grid-security/certificates"

# lcmaps policies require at least two modules, so these are here to
#   fill in if only one module is needed.  "good | bad" has no effect.
good        = "lcmaps_dummy_good.mod"
bad         = "lcmaps_dummy_bad.mod"

authorize_only:
## Policy 1: GUMS but not SAZ (most common, default)
gumsclient -> good | bad
''' % hostname

        gums_properties_contents = '''gums.location=https://%s:8443/gums/services/GUMSAdmin
gums.authz=https://%s:8443/gums/services/GUMSXACMLAuthorizationServicePort
''' % (hostname, hostname)

        core.config['condor-ce.lcmapsdb'] = '/etc/lcmaps.db'
        core.config['condor-ce.gums-properties'] = '/etc/gums/gums-client.properties'
        core.config['condor-ce.gsi-authz'] = '/etc/grid-security/gsi-authz.conf'

        files.write(core.config['condor-ce.lcmapsdb'], lcmaps_contents, owner='condor-ce.gums')
        files.write(core.config['condor-ce.gums-properties'], gums_properties_contents, owner='condor-ce')
        files.replace(core.config['condor-ce.gsi-authz'],
                      '# globus_mapping liblcas_lcmaps_gt4_mapping.so lcmaps_callout',
                      'globus_mapping liblcas_lcmaps_gt4_mapping.so lcmaps_callout',
                      owner='condor-ce')
        try:
            core.state['condor-ce.gums-auth'] = True

            service.check_stop('condor-ce')

            stat = core.get_stat(core.config['condor-ce.collectorlog'])

            service.check_start('condor-ce')
            # Wait for the schedd to come back up
            self.failUnless(condor.wait_for_daemon(core.config['condor-ce.collectorlog'], stat, 'Schedd', 300.0),
                            'Schedd failed to restart within the 1 min window')
            command = ('condor_ce_ping', 'WRITE', '-verbose')
            stdout, _, _ = core.check_system(command, 'ping using GSI and gridmap', user=True)
            self.assert_(re.search(r'Authorized:\s*TRUE', stdout), 'could not authorize with GSI')

        finally:
            files.restore(core.config['condor-ce.lcmapsdb'], 'condor-ce.gums')
            files.restore(core.config['condor-ce.gsi-authz'], 'condor-ce')
            files.restore(core.config['condor-ce.gums-properties'], 'condor-ce')
示例#37
0
def stop():
    service.check_stop(daemon_name())
示例#38
0
 def test_01_stop_condorce(self):
     core.skip_ok_unless_installed('condor', 'htcondor-ce', 'htcondor-ce-client')
     self.skip_ok_unless(core.state['condor-ce.started-service'], 'did not start server')
     service.check_stop('condor-ce')
示例#39
0
 def test_01_stop(self):
     service.check_stop('gsisshd')
示例#40
0
 def test_01_stop_condorce(self):
     core.skip_ok_unless_installed('condor', 'htcondor-ce',
                                   'htcondor-ce-client')
     self.skip_ok_unless(core.state['condor-ce.started-service'],
                         'did not start server')
     service.check_stop('condor-ce')
示例#41
0
 def test_01_stop_tomcat(self):
     core.skip_ok_unless_installed(tomcat.pkgname())
     self.skip_bad_unless(core.state['tomcat.started'],
                          'Tomcat not started')
     service.check_stop(tomcat.pkgname())
示例#42
0
 def test_03_stop_scheduler(self):
     core.skip_ok_unless_installed(*self.required_rpms, by_dependency=True)
     self.skip_ok_unless(core.state['pbs_sched.started-service'], 'did not start pbs scheduler')
     service.check_stop('pbs_sched')
示例#43
0
def stop_xrootd(instance):
    svc = "xrootd@%s" % instance
    service.check_stop(svc)
示例#44
0
 def test_01_stop_myproxy(self):
     core.skip_ok_unless_installed('myproxy-server')
     self.skip_ok_unless(core.state['myproxy.started-server'], 'did not start server')
     service.check_stop('myproxy-server')
示例#45
0
    def test_07_ping_with_gums(self):
        core.state['condor-ce.gums-auth'] = False
        self.general_requirements()
        core.skip_ok_unless_installed('gums-service')

        # Setting up GUMS auth using the instructions here:
        # https://opensciencegrid.github.io/docs/compute-element/install-htcondor-ce/#authentication-with-gums
        hostname = core.get_hostname()

        lcmaps_contents = '''gumsclient = "lcmaps_gums_client.mod"
             "-resourcetype ce"
             "-actiontype execute-now"
             "-capath /etc/grid-security/certificates"
             "-cert   /etc/grid-security/hostcert.pem"
             "-key    /etc/grid-security/hostkey.pem"
             "--cert-owner root"
# Change this URL to your GUMS server
             "--endpoint https://%s:8443/gums/services/GUMSXACMLAuthorizationServicePort"

verifyproxy = "lcmaps_verify_proxy.mod"
          "--allow-limited-proxy"
          " -certdir /etc/grid-security/certificates"

# lcmaps policies require at least two modules, so these are here to
#   fill in if only one module is needed.  "good | bad" has no effect.
good        = "lcmaps_dummy_good.mod"
bad         = "lcmaps_dummy_bad.mod"

authorize_only:
## Policy 1: GUMS but not SAZ (most common, default)
gumsclient -> good | bad
''' % hostname

        gums_properties_contents = '''gums.location=https://%s:8443/gums/services/GUMSAdmin
gums.authz=https://%s:8443/gums/services/GUMSXACMLAuthorizationServicePort
''' % (hostname, hostname)

        core.config['condor-ce.lcmapsdb'] = '/etc/lcmaps.db'
        core.config['condor-ce.gums-properties'] = '/etc/gums/gums-client.properties'
        core.config['condor-ce.gsi-authz'] = '/etc/grid-security/gsi-authz.conf'

        files.write(core.config['condor-ce.lcmapsdb'], lcmaps_contents, owner='condor-ce.gums')
        files.write(core.config['condor-ce.gums-properties'], gums_properties_contents, owner='condor-ce')
        files.replace(core.config['condor-ce.gsi-authz'],
                      '# globus_mapping liblcas_lcmaps_gt4_mapping.so lcmaps_callout',
                      'globus_mapping liblcas_lcmaps_gt4_mapping.so lcmaps_callout',
                      owner='condor-ce')
        try:
            core.state['condor-ce.gums-auth'] = True

            service.check_stop('condor-ce')

            stat = core.get_stat(core.config['condor-ce.collectorlog'])

            service.check_start('condor-ce')
            # Wait for the schedd to come back up
            self.failUnless(condor.wait_for_daemon(core.config['condor-ce.collectorlog'], stat, 'Schedd', 300.0),
                            'Schedd failed to restart within the 1 min window')
            command = ('condor_ce_ping', 'WRITE', '-verbose')
            stdout, _, _ = core.check_system(command, 'ping using GSI and gridmap', user=True)
            self.assert_(re.search(r'Authorized:\s*TRUE', stdout), 'could not authorize with GSI')

        finally:
            files.restore(core.config['condor-ce.lcmapsdb'], 'condor-ce.gums')
            files.restore(core.config['condor-ce.gsi-authz'], 'condor-ce')
            files.restore(core.config['condor-ce.gums-properties'], 'condor-ce')