Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24627 from smuzaffar/103X-poisoned-datafiles
Added unit test to make sure poisoned datafiles are not read from release
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ | |
<flags EDM_PLUGIN="1"/> | ||
</library> | ||
|
||
<test name="test-data-file-deletion" command="test-data-file-deletion.sh"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -ex | ||
cd $CMSSW_BASE | ||
rm -rf test-data-file-deletion | ||
mkdir -p test-data-file-deletion/src/Geometry/CMSCommonData/data/dir-for-data-file | ||
#Create symlink for datafile to point to the directory. cmsRun should fail to open this datafile via FileInPath mechanism | ||
ln -s dir-for-data-file test-data-file-deletion/src/Geometry/CMSCommonData/data/materials.xml | ||
ERR=0 | ||
pushd test-data-file-deletion | ||
CMSSW_SEARCH_PATH=$(pwd)/src:${CMSSW_SEARCH_PATH} cmsRun $CMSSW_BASE/src/CondTools/Geometry/test/writehelpers/geometryxmlwriter.py || ERR=$? | ||
popd | ||
let FILE_IN_PATH_ERROR=$(grep ' FileInPathError *= *' $CMSSW_RELEASE_BASE/src/FWCore/Utilities/interface/EDMException.h | sed 's|.*= *||;s|,.*$||')%256 | ||
rm -rf test-data-file-deletion | ||
if [ "$ERR" = "$FILE_IN_PATH_ERROR" ] ; then | ||
exit 0 | ||
fi | ||
|
||
echo "ERROR: This tests should have failed with FileInPath error." | ||
exit 1 |