From 73950fe3d87f516de2ace098463fa76694d3ec3e Mon Sep 17 00:00:00 2001 From: Narrat Date: Wed, 7 Aug 2024 21:56:56 +0200 Subject: [PATCH] tests: add outside bind mounts to 75_hooks it may happen, that someone bind mounts manually or via an immutable setup the tomb mountdir somewhere else. Tomb should be able to discover such mounts and close them if the tomb itself is closed. --- extras/test/75_hooks.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/extras/test/75_hooks.sh b/extras/test/75_hooks.sh index 9e547c6a..e3f65375 100644 --- a/extras/test/75_hooks.sh +++ b/extras/test/75_hooks.sh @@ -1,6 +1,6 @@ #!/usr/bin/env zsh -export test_description="Testing tomb bind hooks" +export test_description="Testing tomb bind hooks & mounts" TEMPHOME=$HOME @@ -18,8 +18,8 @@ test_expect_success 'Testing bind hooks' ' tt_close && touch "$TEMPHOME/$bindtest" && tt_open --tomb-pwd $DUMMYPASS && - echo "$RND" && - cat "$TEMPHOME/$bindtest" && + echo "$RND" && + cat "$TEMPHOME/$bindtest" && tt list $testname && tt_close ' @@ -27,4 +27,14 @@ test_expect_success 'Testing bind hooks' ' # RND2=$(cat "$TEMPHOME/$bindtest") && # [[ "$RND" = "$RND2" ]] && +test_expect_success 'Testing outside bind mounts' ' + tt_open --tomb-pwd $DUMMYPASS && + tt_set_ownership "$MEDIA/$testname" && + sudo mkdir "$MEDIA/$testname-bind" && + sudo mount --bind "$MEDIA/$testname" "$MEDIA/$testname-bind" && + tt list $testname && + tt_close && + sudo rmdir "$MEDIA/$testname-bind" + ' + test_done