<commit_before>import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.service as service
import osgtest.library.osgunittest as osgunittest

class TestStopXrootd(osgunittest.OSGTestCase):

    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")
        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)<commit_msg>conditionalize restore in xrootd cleanup tests (SOFTWARE-3485)<commit_after>import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.service as service
import osgtest.library.osgunittest as osgunittest

class TestStopXrootd(osgunittest.OSGTestCase):

    def test_01_stop_xrootd(self):
        if core.state['xrootd.backups-exist']:
            if core.PackageVersion('xrootd') < '4.9.0':
                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'])
        files.remove(core.config['xrootd.tmp-dir'], force=True)
{'fraction_non_alphanumeric': 0.12670671764063354, 'fraction_numerical': 0.006007646095030038, 'mean_word_length': 3.783289817232376, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3845952', 'n_tokens_mistral': 622, 'n_tokens_neox': 595, 'n_words': 90}