ROS2-SLAM-Fundamental/map_merge/test/download.sh
Carlos Andrés Álvarez Restrepo 159004e0c9
Port tests: (#21)
* MVP compiles

* All tests passing

* Add downloading maps with bash scrcipt in test map merigng

* Fix tests

* Remove launch file testing in ros2

* Add action

* test

* fox workflow file

* Test

* Skip tests

* Run tests

* Fix it

* Chnage to fail tests

* Fix tests

* Try to make fail tests

* Fix tests
2022-06-29 10:48:13 -05:00

21 lines
504 B
Bash

file_name=$1
url=$2
md5=$3
# Download the file if it doesn't exist
if [ ! -f $file_name ]; then
wget $url -O $file_name
fi
# Check the MD5 sum of the file
echo "Checking MD5 sum of $file_name"
md5sum -c <<<"$md5 $file_name"
if [ $? -ne 0 ]; then
echo "MD5 sum of $file_name does not match. Downloading it again"
wget $url -O $file_name
md5sum -c <<<"$md5 $file_name"
if [ $? -ne 0 ]; then
echo "MD5 sum of $file_name still does not match. Aborting."
exit 1
fi
fi