Skip to content

Commit

Permalink
tests: add outside bind mounts to 75_hooks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Narrat authored and jaromil committed Aug 31, 2024
1 parent 41b899e commit 73950fe
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions extras/test/75_hooks.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -18,13 +18,23 @@ 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
'

# 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

0 comments on commit 73950fe

Please sign in to comment.