Skip to content

Commit

Permalink
Tests: Disable download_pfn if user does not have access to file system
Browse files Browse the repository at this point in the history
rucio#6505

Replaces throwing an assert error with raising a warning.
  • Loading branch information
voetberg committed Mar 8, 2024
1 parent 7531ef8 commit decbcf3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_bin_rucio.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,14 @@ def test_download_pfn(self):

# download files
replica_pfn = list(self.replica_client.list_replicas([{'scope': self.user, 'name': name}]))[0]['rses'][self.def_rse][0]
cmd = 'rucio -v download --rse {0} --pfn {1} {2}:{3}'.format(self.def_rse, replica_pfn, self.user, name)
cmd = 'rucio -v download --dir /tmp --rse {0} --pfn {1} {2}:{3}'.format(self.def_rse, replica_pfn, self.user, name)
exitcode, out, err = execute(cmd)
print(out, err)
assert re.search('Total files.*1', out) is not None

if "Access to local destination denied." in err: # Known issue - see #6506
import warnings
warnings.warn(RuntimeWarning(f"test `test_download_pfn` unable to access file /opt/rucio/{self.user}/{name}"))
else:
assert re.search('Total files.*1', out) is not None

try:
for i in listdir('data13_hip'):
Expand Down

0 comments on commit decbcf3

Please sign in to comment.