@@ -11,15 +11,11 @@ class TestCvmfs(osgunittest.OSGTestCase):
11
11
core .config ['cvmfs.debug-dirs' ] = []
12
12
13
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 )
14
+ command = ('mkdir' , '-p' , '/cvmfs/' + repo )
15
+ core .check_system (command , 'Manually creating cvmfs dir' )
18
16
19
17
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 ))
18
+ core .check_system (command , 'Manually mounting cvmfs singularity repo' )
23
19
24
20
def debug_cvmfs (self , repo ):
25
21
temp_dir = tempfile .mkdtemp ()
@@ -113,28 +109,16 @@ def test_03_oasis_config(self):
113
109
def test_04_singularity (self ):
114
110
core .skip_ok_unless_installed ('singularity-runtime' )
115
111
core .skip_ok_unless_installed ('cvmfs' )
112
+ core .skip_ok_unless_installed ('cvmfs-keys' , by_dependency = True )
116
113
singularity_repo = 'singularity.opensciencegrid.org'
117
114
if core .el_release () <= 6 :
118
115
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
116
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
-
117
+ core .check_system (command , "testing cvmfs access to singularity repo" )
118
+
134
119
command = ('ls' , self .__cvmfs_image )
135
- status , stdout , stderr = core .system (command , False )
136
- self . assert_ ( file_exists , 'cvfms image missing' )
120
+ core .check_system (command , "testing cvmfs access to singularity image" )
121
+
137
122
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 )
123
+ core .check_system (command , "'singularity checking a file" )
124
+
0 commit comments