Verify downloaded test runner zip file 812 (#4193)

* if download has checksum use it to verify downloaded file

* check only filesize if no checksum available

* add download tests

* move checksum into util for reuse, be explicit

* add comments explaining headers used to verify checksum

* move hasha to dev dependency

* remove unnecessary function

* do not use deprecated Promise.join with spread

* fix promise join callback

* linting
This commit is contained in:
Gleb Bahmutov
2019-07-09 14:03:00 -04:00
committed by Zach Bloomquist
parent bfec784e7a
commit c57d302176
6 changed files with 285 additions and 5 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ setChecksum = (filename, key) =>
la(check.unemptyString(filename), 'expected filename', filename)
la(check.unemptyString(key), 'expected uploaded S3 key', key)
checksum = hasha.fromFileSync(filename)
checksum = hasha.fromFileSync(filename, { algorithm: 'sha512' })
size = fs.statSync(filename).size
console.log('SHA256 checksum %s', checksum)
console.log('size', size)