<commit_before>import os
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.osgunittest as osgunittest
import tempfile

class TestSingularity(osgunittest.OSGTestCase):

    __check_path = '/cvmfs/cms.cern.ch/cmsset_default.sh'
    __cvmfs_image = '/cvmfs/singularity.opensciencegrid.org/opensciencegrid/osg-wn:3.3-el6 cat /etc/redhat-release'

    def test_01_singularity(self):
        core.skip_ok_unless_installed('singularity-runtime')
        core.skip_ok_unless_installed('cvmfs')
        core.state['cvmfs.mounted'] = False

        command = ('ls', '/cvmfs')
        status, stdout, stderr = core.system(command, False)
        file_exists = os.path.exists('/cvmfs')
        self.assert_(file_exists, 'Cvmfs mount point missing')
        core.state['cvmfs.mounted'] = True

        singularity_repo = 'singularity.opensciencegrid.org'
        command = ('ls', '/cvmfs/' + singularity_repo)
        status, stdout, stderr = core.system(command, False)

        # If the previous command failed, output better debug info
        if status != 0:
            self.fail("failed to find /cvmfs/%s" % singularity_repo)

        command = ('ls', self.__cvmfs_image)
        status, stdout, stderr = core.system(command, False)
        self.assert_(file_exists, 'cvfms image missing')
        
        #command = ('bash', '-c', 'source ' + self.__check_path)
        command= ('singularity', 'exec', '--bind', '/cvmfs', self.__cvmfs_image, 'lsb_release -a')
        status, stdout, stderr = core.system(command, False)
        fail = core.diagnose('singularity checking a file',
                             command, status, stdout, stderr)
        self.assertEqual(status, 0, fail)<commit_msg>Changed the command to test<commit_after>import os
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.osgunittest as osgunittest
import tempfile

class TestSingularity(osgunittest.OSGTestCase):

    __check_path = '/cvmfs/cms.cern.ch/cmsset_default.sh'
    __cvmfs_image = '/cvmfs/singularity.opensciencegrid.org/opensciencegrid/osg-wn:3.3-el6 cat /etc/redhat-release'

    def test_01_singularity(self):
        core.skip_ok_unless_installed('singularity-runtime')
        core.skip_ok_unless_installed('cvmfs')
        core.state['cvmfs.mounted'] = False

        command = ('ls', '/cvmfs')
        status, stdout, stderr = core.system(command, False)
        file_exists = os.path.exists('/cvmfs')
        self.assert_(file_exists, 'Cvmfs mount point missing')
        core.state['cvmfs.mounted'] = True

        singularity_repo = 'singularity.opensciencegrid.org'
        command = ('ls', '/cvmfs/' + singularity_repo)
        status, stdout, stderr = core.system(command, False)

        # If the previous command failed, output better debug info
        if status != 0:
            self.fail("failed to find /cvmfs/%s" % singularity_repo)

        command = ('ls', self.__cvmfs_image)
        status, stdout, stderr = core.system(command, False)
        self.assert_(file_exists, 'cvfms image missing')
        
        #command = ('bash', '-c', 'source ' + self.__check_path)
        command= ('singularity', 'exec', '--bind', '/cvmfs', self.__cvmfs_image)
        status, stdout, stderr = core.system(command, False)
        fail = core.diagnose('singularity checking a file',
                             command, status, stdout, stderr)
        self.assertEqual(status, 0, fail)
{'fraction_non_alphanumeric': 0.12147380541162925, 'fraction_numerical': 0.004029936672423719, 'mean_word_length': 3.0034562211981566, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1440161', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1075, 'n_words': 235}