Closed DrDaveD closed 10 months ago
yeah, it seems I didn't cover all the test cases in the following script (which I probably should add to the automated tests, but I'm not sure how to add a new shell script to the test cases) :
#!/bin/bash
set -x
FIFO=$(mktemp -u)
mkfifo "$FIFO"
./squashfuse_ll -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/nonexistent-squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mountpoint should have failed"
exit 1
else
echo "Mounting squashfuse on /tmp/squash failed as expected"
fi
mkdir -p /tmp/squash
./squashfuse_ll -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mounted successfully as expected"
else
echo "Mounting squashfuse on /tmp/squash failed"
exit 1
fi
# Second time should fail with permission denied
./squashfuse_ll -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mounted successfully when it should have failed"
exit 1
else
echo "Mounting squashfuse on /tmp/squash failed as expected"
fi
fusermount -u /tmp/squash
./squashfuse -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/nonexistent-squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mountpoint should have failed"
exit 1
else
echo "Mounting squashfuse on /tmp/squash failed as expected"
fi
mkdir /tmp/squash
./squashfuse -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mounted successfully as expected"
else
echo "Mounting squashfuse on /tmp/squash failed"
exit 1
fi
# Second time should fail with permission denied
./squashfuse -o notify_pipe="$FIFO" -f ~/work/cisco/test-puzzlefs/barehost.sqhs /tmp/squash&
STATUS=$(head -c1 "$FIFO")
if [ "$STATUS" = "s" ]; then
echo "Mounted successfully when it should have failed"
exit 1
else
echo "Mounting squashfuse on /tmp/squash failed as expected"
fi
fusermount -u /tmp/squash
I should have tested -o notify_pipe before merging #110 into the master branch, but I did it afterward. I tried both success and failures of mounts for both squashfuse_ll and squashfuse, and 3 of the combinations worked but squashfuse failures did not; there was no notification. It would be good if the automated tests tried all four combinations.
Reproduce with
and in another window do
An
f
is only sent to the pipe if squashfuse_ll is used, but not if squashfuse is used.@ariel-miculas