def test_14_config_gram_gateway(self): core.config['osg-info-services.gateway-file'] = '/etc/osg/config.d/10-gateway.ini' core.skip_ok_unless_installed(['osg-info-services', 'osg-ce']) files.replace_regexpr(core.config['osg-info-services.gateway-file'], 'gram_gateway_enabled = *', 'gram_gateway_enabled = True', owner='root')
def test_05_config_squid_file(self): core.skip_ok_unless_installed('osg-info-services') core.skip_ok_unless_one_installed(*self.possible_rpms) core.config['osg-info-services.squid-file'] = '/etc/osg/config.d/01-squid.ini' files.replace_regexpr(core.config['osg-info-services.squid-file'], 'location = *', 'location = UNAVAILABLE', owner='root')
def test_16_config_gratia_file(self): core.skip_ok_unless_one_installed(*self.possible_rpms) core.skip_ok_unless_installed('osg-info-services') core.config['osg-info-services.gratia-file'] = '/etc/osg/config.d/30-gratia.ini' files.replace_regexpr(core.config['osg-info-services.gratia-file'], 'enabled = *', 'enabled = False', owner='root')
def test_10_fix_tomcat_template(self): # Fix EL7 bug in Gratia template if core.el_release() == 7: core.skip_ok_unless_installed(tomcat.pkgname(), 'gratia-service') core.config['gratia.broken_template'] = '/usr/share/gratia/server.xml.template' bad_line = r'\s+sSLImplementation=.*' fixed_line = ' '*15 + 'sslImplementationName="org.glite.security.trustmanager.tomcat.TMSSLImplementation"' files.replace_regexpr(core.config['gratia.broken_template'], bad_line, fixed_line, owner='gratia')
def test_12_config_lsf(self): # Configuration needed if batch system is lsf core.skip_ok_unless_installed(['osg-info-services', 'osg-ce-lsf']) core.config['osg-info-services.lsf-file'] = '/etc/osg/config.d/20-lsf.ini' files.replace_regexpr(core.config['osg-info-services.lsf-file'], 'enabled = *', 'enabled = True', owner='root') files.replace_regexpr(core.config['osg-info-services.gip-file'], 'batch = *', 'batch = lsf', backup=False)
def test_10_config_condor(self): # Configurations needed if bath system is condor. core.config['osg-info-services.condor-file'] = '/etc/osg/config.d/20-condor.ini' core.skip_ok_unless_installed(['osg-info-services', 'osg-ce-condor']) files.replace_regexpr(core.config['osg-info-services.condor-file'], 'enabled = *', 'enabled = True', owner='root') files.replace_regexpr(core.config['osg-info-services.gip-file'], 'batch = *', 'batch = condor', backup=False)
def test_04_config_tomcat_properties(self): if core.missing_rpm(tomcat.pkgname(), 'gratia-service'): return command = ('/usr/share/gratia/configure_tomcat',) core.check_system(command, 'Unable to configure Gratia.') server_xml_path = os.path.join(tomcat.sysconfdir(), 'server.xml') files.replace_regexpr(server_xml_path, "(<Server.*\n)", r'\1<Listener className="org.apache.catalina.core.JasperListener"/>', owner='gratia', backup=True)
def test_04_config_storage_file(self): core.skip_ok_unless_installed('osg-info-services') core.skip_ok_unless_one_installed(*self.possible_rpms) core.config['osg-info-services.storage-file'] = '/etc/osg/config.d/10-storage.ini' temp_dir = core.config['osg-info-services.tmp-dir-suffix'] files.replace_regexpr(core.config['osg-info-services.storage-file'], 'app_dir = *', 'app_dir = ' + temp_dir + '/osg/app_dir', owner='root') files.replace_regexpr(core.config['osg-info-services.storage-file'], 'data_dir = *', 'data_dir = ' + temp_dir + '/osg/data_dir', backup=False)
def test_15_config_htcondor_gateway(self): core.skip_ok_unless_installed(['osg-info-services', 'htcondor-ce']) if 'osg-info-services.gateway-file' in core.config: files.replace_regexpr(core.config['osg-info-services.gateway-file'], 'htcondor_gateway_enabled = *', 'htcondor_gateway_enabled = True', backup=False) else: core.config['osg-info-services.gateway-file'] = '/etc/osg/config.d/10-gateway.ini' files.replace_regexpr(core.config['osg-info-services.gateway-file'], 'htcondor_gateway_enabled = *', 'htcondor_gateway_enabled = True', owner='root')
def test_04_config_tomcat_properties(self): if core.missing_rpm(tomcat.pkgname(), 'gratia-service'): return command = ('/usr/share/gratia/configure_tomcat', ) core.check_system(command, 'Unable to configure Gratia.') server_xml_path = os.path.join(tomcat.sysconfdir(), 'server.xml') files.replace_regexpr( server_xml_path, "(<Server.*\n)", r'\1<Listener className="org.apache.catalina.core.JasperListener"/>', owner='gratia', backup=True)
def test_08_config_site_info_file(self): core.skip_ok_unless_installed('osg-info-services') core.skip_ok_unless_one_installed(*self.possible_rpms) core.config['osg-info-services.siteinfo-file'] = '/etc/osg/config.d/40-siteinfo.ini' files.replace(core.config['osg-info-services.siteinfo-file'], 'group = OSG', 'group = OSG-ITB', owner='root') files.replace_regexpr(core.config['osg-info-services.siteinfo-file'], 'host_name = *', 'host_name = ' + core.get_hostname(), backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'sponsor = UNAVAILABLE', 'sponsor = mis:100', backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'contact = UNAVAILABLE', 'contact = Lando Calrissian', backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'email = UNAVAILABLE', 'email = [email protected]', backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'city = UNAVAILABLE', 'city = Cloud City', backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'country = UNAVAILABLE', 'country = Bespin', backup=False) files.replace_regexpr(core.config['osg-info-services.siteinfo-file'], 'longitude =*', 'longitude = -1', backup=False) files.replace(core.config['osg-info-services.siteinfo-file'], 'latitude = UNAVAILABLE', 'latitude = 45', backup=False)
def test_13_config_sge(self): # Configuration needed if batch system is sge core.skip_ok_unless_installed(['osg-info-services', 'osg-ce-sge']) core.config['osg-info-services.sge-file'] = '/etc/osg/config.d/20-sge.ini' files.replace_regexpr(core.config['osg-info-services.sge-file'], 'enabled = *', 'enabled = True', owner='root') files.replace_regexpr(core.config['osg-info-services.sge-file'], 'sge_root = *', 'sge_root = /usr/share/gridengine', backup=False) os.environ['SGE_ROOT'] = '/usr/share/gridengine' files.replace_regexpr(core.config['osg-info-services.sge-file'], 'sge_bin_location = *', 'sge_bin_location = /usr/share/gridengine/bin', backup=False) files.replace_regexpr(core.config['osg-info-services.gip-file'], 'batch = *', 'batch = sge', backup=False)
def test_01_configure(self): if core.PackageVersion('stash-cache') >= '1.1.0': caching_plugin_cfg_path = "/etc/xrootd/config.d/40-stash-cache-plugin.cfg" http_cfg_path = "/etc/xrootd/config.d/50-osg-http.cfg" else: caching_plugin_cfg_path = "/etc/xrootd/config.d/40-osg-caching-plugin.cfg" http_cfg_path = "/etc/xrootd/config.d/40-osg-http.cfg" for key, val in PARAMS.items(): setcfg(key, val) # Create dirs for d in [ PARAMS["OriginRootdir"], PARAMS["CacheRootdir"], os.path.join(PARAMS["OriginRootdir"], PARAMS["OriginExport"].lstrip("/")), os.path.join(PARAMS["OriginRootdir"], PARAMS["OriginAuthExport"].lstrip("/")), os.path.join(PARAMS["CacheRootdir"], PARAMS["OriginDummyExport"].lstrip("/")), os.path.dirname(CACHES_JSON_PATH) ]: files.safe_makedirs(d) core.system([ "chown", "-R", "xrootd:xrootd", PARAMS["OriginRootdir"], PARAMS["CacheRootdir"] ]) filelist = [] setcfg("filelist", filelist) # Modify filelist in-place with .append so changes get into core.config too # Delete the lines we can't override for path, regexp in [ (XROOTD_ORIGIN_CFG_PATH, "^\s*all.manager.+$"), (http_cfg_path, "^\s*xrd.protocol.+$"), (caching_plugin_cfg_path, "^\s*(ofs.osslib|pss.cachelib|pss.origin).+$"), ]: files.replace_regexpr(path, regexp, "", owner=NAMESPACE) filelist.append(path) # Write our new files for path, contents in [ (PARAMS_CFG_PATH, PARAMS_CFG_CONTENTS), (PRE_CFG_PATH, PRE_CFG_CONTENTS), (ORIGIN_AUTHFILE_PATH, ORIGIN_AUTHFILE_CONTENTS), (ORIGIN_PUBLIC_AUTHFILE_PATH, ORIGIN_PUBLIC_AUTHFILE_CONTENTS), (CACHE_AUTHFILE_PATH, CACHE_AUTHFILE_CONTENTS), (CACHE_PUBLIC_AUTHFILE_PATH, CACHE_PUBLIC_AUTHFILE_CONTENTS), (CACHES_JSON_PATH, CACHES_JSON_CONTENTS) ]: files.write(path, contents, owner=NAMESPACE, chmod=0o644) filelist.append(path) # Install certs. Normally done in the xrootd tests but they conflict with the StashCache tests # (both use the same config dir) core.config['certs.xrootdcert'] = '/etc/grid-security/xrd/xrdcert.pem' core.config['certs.xrootdkey'] = '/etc/grid-security/xrd/xrdkey.pem' core.install_cert('certs.xrootdcert', 'certs.hostcert', 'xrootd', 0o644) core.install_cert('certs.xrootdkey', 'certs.hostkey', 'xrootd', 0o400)