Skip to content

Commit 94bbbe6

Browse files
author
efajardo
committed
Moved the singularity tests along with the cvmfs tests
1 parent 1ecf5c6 commit 94bbbe6

File tree

4 files changed

+43
-56
lines changed

4 files changed

+43
-56
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
sudo: required
22
env:
33
matrix:
4-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-ce-condor,vo-client-lcmaps-voms,llrun,singularity-runtime,osg-oasis
5-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity-runtime,osg-oasis
4+
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-ce-condor,vo-client-lcmaps-voms,llrun, osg-oasis
5+
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun
66
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-ce-condor,vo-client-lcmaps-voms,llrun,singularity-runtime,osg-oasis
77
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-gridftp,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity-runtime,osg-oasis
88

files/test_sequence

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ test_53_gums
4242
test_54_gratia
4343
test_55_condorce
4444
test_59_gsiopenssh
45-
test_60_singularity
4645
test_74_slurm
4746
test_75_gums
4847
test_76_tomcat

osgtest/tests/test_38_cvmfs.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@
77
class TestCvmfs(osgunittest.OSGTestCase):
88

99
__check_path = '/cvmfs/cms.cern.ch/cmsset_default.sh'
10+
__cvmfs_image = '/cvmfs/singularity.opensciencegrid.org/opensciencegrid/osg-wn:3.3-el6'
1011
core.config['cvmfs.debug-dirs'] = []
1112

13+
def mountSingularityCVMFSRepo(self, repo):
14+
command = ('mkdir', '-p', /cvmfs + repo)
15+
status, stdout, stderr = core.system(command, False)
16+
if status != 0:
17+
self.fail("failed to mkdir /cvmfs/%s" % repo)
18+
19+
command = ('mount', '-t', 'cvmfs', 'repo', '/cvmfs/' + repo)
20+
status, stdout, stderr = core.system(command, False)
21+
if status != 0:
22+
self.fail("failed to mount: %s, error: %s" % (repo,stdout))
23+
1224
def debug_cvmfs(self, repo):
1325
temp_dir = tempfile.mkdtemp()
1426
core.config['cvmfs.debug-dirs'].append(temp_dir)
@@ -97,3 +109,32 @@ def test_03_oasis_config(self):
97109
# If the previous command failed, output better debug info
98110
if status != 0:
99111
self.debug_cvmfs(oasis_repo)
112+
113+
def test_04_singularity(self):
114+
core.skip_ok_unless_installed('singularity-runtime')
115+
core.skip_ok_unless_installed('cvmfs')
116+
singularity_repo = 'singularity.opensciencegrid.org'
117+
if core.el_release() <= 6:
118+
self.mountSingularityCVMFSRepo(singularity_repo)
119+
core.state['cvmfs.mounted'] = False
120+
121+
command = ('ls', '/cvmfs')
122+
status, stdout, stderr = core.system(command, False)
123+
file_exists = os.path.exists('/cvmfs')
124+
self.assert_(file_exists, 'Cvmfs mount point missing')
125+
core.state['cvmfs.mounted'] = True
126+
127+
command = ('ls', '/cvmfs/' + singularity_repo)
128+
status, stdout, stderr = core.system(command, False)
129+
130+
# If the previous command failed, output better debug info
131+
if status != 0:
132+
self.fail("failed to find /cvmfs/%s" % singularity_repo)
133+
134+
command = ('ls', self.__cvmfs_image)
135+
status, stdout, stderr = core.system(command, False)
136+
self.assert_(file_exists, 'cvfms image missing')
137+
command= ('singularity', 'exec', '--bind', '/cvmfs', self.__cvmfs_image, 'echo', 'working singularity image')
138+
status, stdout, stderr = core.system(command, False)
139+
fail = core.diagnose('singularity checking a file', command, status, stdout, stderr)
140+
self.assertEqual(status, 0, fail)

osgtest/tests/test_60_singularity.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)