Testing: Test directory traversal

This commit is contained in:
Shahram Najm 2023-01-22 14:52:09 +00:00
parent d9406ccd17
commit a658cb444c
1 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,7 @@ label="grib_to_netcdf_test"
tempGrib=temp.${label}.grib
tempNetcdf=temp.${label}.nc
tempText=temp.${label}.txt
tempDir=temp.${label}.dir
have_netcdf4=0
@ -124,5 +125,15 @@ grep -q "GRIB message 2 has different resolution" $tempText
rm -f $tempGrib2
echo "Test directory traversal ..."
# ------------------------------------
rm -f $tempNetcdf
mkdir -p $tempDir/subdir
cp ${data_dir}/regular_latlon_surface.grib2 $tempDir/subdir
${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempDir > $tempText
[ -f "$tempNetcdf" ]
grep -q "Processing input file .*/subdir/regular_latlon_surface.grib2" $tempText
rm -rf $tempDir
# Clean up
rm -f $tempNetcdf $tempGrib $tempText