summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Pujol <alexandre@pujol.io>2017-05-01 22:26:17 (GMT)
committer Alexandre Pujol <alexandre@pujol.io>2017-05-01 22:26:17 (GMT)
commit4688820b68a2f098e72b1cfe26eebb7391a6b91c (patch)
tree8b4ef519681b58cd1d5b13e1496bb857baf15d21
parent92a670efd88ab2100b1e842cd315f123e5e41877 (diff)
Tests: support for /media and /usr/media
-rw-r--r--extras/test/50_integrity.sh8
-rw-r--r--extras/test/setup4
2 files changed, 7 insertions, 5 deletions
diff --git a/extras/test/50_integrity.sh b/extras/test/50_integrity.sh
index f97cd17..753db6a 100644
--- a/extras/test/50_integrity.sh
+++ b/extras/test/50_integrity.sh
@@ -7,12 +7,12 @@ source ./setup
test_export "test" # Using already generated tomb
test_expect_success 'Testing contents integrity' '
tt_open --tomb-pwd $DUMMYPASS &&
- tomb_set_ownership "$MEDIA/$USER/$testname" &&
- tt dig -s 10 "$MEDIA/$USER/$testname/datacheck.raw" &&
- CRC1=$(sha256sum "$MEDIA/$USER/$testname/datacheck.raw") &&
+ tomb_set_ownership "$MEDIA/$testname" &&
+ tt dig -s 10 "$MEDIA/$testname/datacheck.raw" &&
+ CRC1=$(sha256sum "$MEDIA/$testname/datacheck.raw") &&
tt_close --unsafe &&
tt_open --tomb-pwd $DUMMYPASS &&
- CRC2=$(sha256sum "$MEDIA/$USER/$testname/datacheck.raw") &&
+ CRC2=$(sha256sum "$MEDIA/$testname/datacheck.raw") &&
[[ "$CRC1" == "$CRC2" ]] &&
tt_close
'
diff --git a/extras/test/setup b/extras/test/setup
index 782b572..06e5447 100644
--- a/extras/test/setup
+++ b/extras/test/setup
@@ -33,7 +33,6 @@ PROJECT_HOME="$(dirname "$EXT_HOME")"
export SHARNESS_TEST_EXTENSION="sh"
source ./sharness
TMP="/tmp/tomb"
-MEDIA="/run/media" # for bind hooks
# Check Tomb sources
@@ -44,6 +43,9 @@ if [[ ! -e "${T}" ]]; then
exit 1
fi
+MEDIA="/media"
+[[ -d /media ]] || MEDIA="/run/media/$USER/"
+
# Check for auxiliary programs
command -v steghide > /dev/null && test_set_prereq STEGHIDE
command -v e2fsck resize2fs > /dev/null && test_set_prereq RESIZER