From 407a4b24e13896ec03464ebc7d0bcc9097c22e07 Mon Sep 17 00:00:00 2001 From: Chief Marlin <96321026+chiefMarlin@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:43:37 -0400 Subject: [PATCH] Update testValidity.sh --- testValidity.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testValidity.sh b/testValidity.sh index f51bd12..a975cb3 100755 --- a/testValidity.sh +++ b/testValidity.sh @@ -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) @@ -24,4 +28,4 @@ fi rm randomData encryptedData decryptedData || fail "Failed to clean up" -echo "All tests passed successfully!" \ No newline at end of file +echo "All tests passed successfully!"