-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] move checker functions to separate file
also clean up minor typos etc
- Loading branch information
1 parent
8675a14
commit 50bdc3b
Showing
3 changed files
with
41 additions
and
57 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Function checking that file(s) were encrypted | ||
function check_encrypted_file { | ||
for k do | ||
echo "working with $k" | ||
output=$(head -c 8 "$k") | ||
|
||
if [[ "$output" == "crypt4gh" ]]; then | ||
echo "Encrypted data file: $k" | ||
else | ||
echo "Failed to encrypt file: $k" | ||
exit 1 | ||
fi | ||
done | ||
} | ||
|
||
|
||
# Function checking that a file was uploaded to the S3 backend | ||
function check_uploaded_file { | ||
if s3cmd -c testing/directS3 ls s3://"$1" | grep -q "$2"; then | ||
echo "Uploaded encrypted file to s3 backend" | ||
else | ||
echo "Failed to upload file to s3 backend" | ||
exit 1 | ||
fi | ||
} |
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
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