2017-05-01 22:02:49 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
export test_description="Testing file integrity"
|
|
|
|
|
|
|
|
source ./setup
|
|
|
|
|
|
|
|
test_export "test" # Using already generated tomb
|
|
|
|
test_expect_success 'Testing contents integrity' '
|
|
|
|
tt_open --tomb-pwd $DUMMYPASS &&
|
2017-05-03 18:51:36 +00:00
|
|
|
tt_set_ownership "$MEDIA/$testname" &&
|
2017-05-01 22:26:17 +00:00
|
|
|
tt dig -s 10 "$MEDIA/$testname/datacheck.raw" &&
|
|
|
|
CRC1=$(sha256sum "$MEDIA/$testname/datacheck.raw") &&
|
2017-05-01 22:02:49 +00:00
|
|
|
tt_close --unsafe &&
|
|
|
|
tt_open --tomb-pwd $DUMMYPASS &&
|
2017-05-01 22:26:17 +00:00
|
|
|
CRC2=$(sha256sum "$MEDIA/$testname/datacheck.raw") &&
|
2017-05-01 22:02:49 +00:00
|
|
|
[[ "$CRC1" == "$CRC2" ]] &&
|
|
|
|
tt_close
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|