Skip to content

Commit

Permalink
Update testValidity.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefMarlin authored Sep 27, 2024
1 parent 452f75d commit 407a4b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion testValidity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ dd if=/dev/urandom of=randomData bs=1M count=1000 2>/dev/null || fail "Failed to
CKEY=test go run chap.go e < randomData > encryptedData || fail "Failed to encrypt data"
CKEY=test go run chap.go d < encryptedData > decryptedData || fail "Failed to decrypt data"

# Test pipe to make sure no decryption errors occur
dd if=/dev/urandom bs=1M count=1000 | CKEY=test go run chap.go e | CKEY=test go run chap.go d > /dev/null


# Check if on macOS, use md5 instead of md5sum
if [ "$(uname)" == "Darwin" ]; then
ORIGINAL_MD5=$(md5 -q randomData)
Expand All @@ -24,4 +28,4 @@ fi

rm randomData encryptedData decryptedData || fail "Failed to clean up"

echo "All tests passed successfully!"
echo "All tests passed successfully!"

0 comments on commit 407a4b2

Please sign in to comment.