Environment variable to ignore md5 (#2695)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 14 Sep 2018 05:06:08 +0000 (14:06 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Fri, 14 Sep 2018 05:06:08 +0000 (14:06 +0900)
Environment variable to ignore md5 when model file is in cache directory

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
tests/framework/run_test.sh

index eb32a0a..3f8a9c8 100755 (executable)
@@ -41,6 +41,11 @@ function verify_downloaded_file()
     LOCAL_PATH=$1
     REMOTE_URL=$2
 
+    # Ignore checking md5 in cache
+    if [ ! -z $IGNORE_MD5 ] && [ "$IGNORE_MD5" == "1" ]; then
+        return 0
+    fi
+
     LOCAL_HASH=$(md5sum $LOCAL_PATH | awk '{ print $1 }')
     REMOTE_HASH=$(curl -I -ss $REMOTE_URL | grep '^Content-MD5' | tr -d '\r\n' | awk '{ print $2 }' | base64 -d | xxd -p)
     # TODO Emit an error when Content-MD5 field was not found. (Server configuration issue)