From ee1e15c8dd12494f9e118c2eea616e9ade496923 Mon Sep 17 00:00:00 2001 From: Nils Erik Krumnack <nils.erik.krumnack@cern.ch> Date: Wed, 22 May 2019 20:47:25 +0000 Subject: [PATCH] Merge branch '21.2-directIO-art-rucio-redirection-tests' into '21.2' DirectIOART: Adding TFile::Open tests probing rucio redirector See merge request atlas/athena!23596 (cherry picked from commit a191c95943d7eb1cff1f6d1687432dfa7d69b518) 1b28a81e Adding TFile::Open tests probing rucio redirector --- ...t_directioart_tfileopen_rucioredirector.py | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 Tools/DirectIOART/test/test_directioart_tfileopen_rucioredirector.py diff --git a/Tools/DirectIOART/test/test_directioart_tfileopen_rucioredirector.py b/Tools/DirectIOART/test/test_directioart_tfileopen_rucioredirector.py new file mode 100755 index 00000000000..211fdb6fadc --- /dev/null +++ b/Tools/DirectIOART/test/test_directioart_tfileopen_rucioredirector.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# art-description: DirectIOART TFile::Open RucioRedirector +# art-type: grid +# art-include: master/Athena +# art-include: 21.2/AthAnalysis +# art-include: 21.2/AnalysisBase + +import ROOT +ROOT.gEnv.SetValue("Davix.Debug", 3) + +### no redirection option ### +f = ROOT.TFile.Open("https://rucio-lb-prod.cern.ch/redirect/mc12_8TeV/AOD.00983781._000001.pool.root.1") +if f: print("art-result: 0 DirectIOART_TFileOpen_RucioRedirect_noOpts") +else: print("art-result: 1 DirectIOART_TFileOpen_RucioRedirect_noOpts") +del f + +### schemes=root ### +f = ROOT.TFile.Open("https://rucio-lb-prod.cern.ch/redirect/mc12_8TeV/AOD.00983781._000001.pool.root.1?schemes=root") +if f: print("art-result: 0 DirectIOART_TFileOpen_RucioRedirect_schemesROOT") +else: print("art-result: 1 DirectIOART_TFileOpen_RucioRedirect_schemesROOT") +del f + +### schemes=davs ### +f = ROOT.TFile.Open("https://rucio-lb-prod.cern.ch/redirect/mc12_8TeV/AOD.00983781._000001.pool.root.1?schemes=davs") +if f: print("art-result: 0 DirectIOART_TFileOpen_RucioRedirect_schemesDAVS") +else: print("art-result: 1 DirectIOART_TFileOpen_RucioRedirect_schemesDAVS") +del f + +### select=goeip ### +f = ROOT.TFile.Open("https://rucio-lb-prod.cern.ch/redirect/mc12_8TeV/AOD.00983781._000001.pool.root.1?select=geoip") +if f: print("art-result: 0 DirectIOART_TFileOpen_RucioRedirect_selectGEOIP") +else: print("art-result: 1 DirectIOART_TFileOpen_RucioRedirect_selectGEOIP") +del f + +### rse=LRZ-LMU_DATADISK ### +f = ROOT.TFile.Open("https://rucio-lb-prod.cern.ch/redirect/mc12_8TeV/AOD.00983781._000001.pool.root.1?rse=LRZ-LMU_DATADISK") +if f: print("art-result: 0 DirectIOART_TFileOpen_RucioRedirect_rseLRZ-LMU_DATADISK") +else: print("art-result: 1 DirectIOART_TFileOpen_RucioRedirect_rseLRZ-LMU_DATADISK") +del f + +outstr = """<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<!-- Edited By POOL --> +<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory"> +<POOLFILECATALOG> + +</POOLFILECATALOG>""" +with open("PoolFileCatalog.xml", "w") as outfile: + outfile.write(outstr) -- GitLab