Skip to content

Commit

Permalink
rucio#2311 rucio server upload/download tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Nov 26, 2020
1 parent 0adcf58 commit bb182d8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/rucio/tests/test_rucio_server.py
Expand Up @@ -37,6 +37,21 @@ def file_generator(size=2048, namelen=10):
return fn


def get_scope_and_rses():
"""
Check if xrd containers rses for xrootd are available in the testing environment.
:return: A tuple (scope, rses) for the rucio client where scope is mock/test and rses is a list.
"""
cmd = "rucio list-rses --expression 'test_container_xrd=True'"
print(cmd)
exitcode, out, err = execute(cmd)
print(out, err)
rses = out.split()
if len(rses) == 0:
return 'mock', ['MOCK-POSIX']
return 'test', rses


def delete_rules(did):
# get the rules for the file
print('Deleting rules')
Expand All @@ -57,8 +72,8 @@ class TestRucioClient(unittest.TestCase):

def setUp(self):
self.marker = '$ > '
self.scope = 'mock'
self.rse = 'MOCK-POSIX'
self.scope, self.rses = get_scope_and_rses()
self.rse = self.rses[0]
self.generated_dids = []

def tearDown(self):
Expand Down

0 comments on commit bb182d8

Please sign in to comment.