forked from cberner/fuser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathosx_mount_tests.sh
More file actions
executable file
·45 lines (34 loc) · 898 Bytes
/
osx_mount_tests.sh
File metadata and controls
executable file
·45 lines (34 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -x
exit_handler() {
exit "${TEST_EXIT_STATUS:-1}"
}
trap exit_handler TERM
trap 'kill $(jobs -p); exit $TEST_EXIT_STATUS' INT EXIT
export RUST_BACKTRACE=1
NC="\e[39m"
GREEN="\e[32m"
RED="\e[31m"
function run_test {
DIR=$(mktemp -d)
cargo build --example hello $1 > /dev/null 2>&1
cargo run --example hello $1 -- $DIR $3 &
FUSE_PID=$!
sleep 2
echo "mounting at $DIR"
# Make sure FUSE was successfully mounted
mount | grep hello || exit 1
if [[ $(cat ${DIR}/hello.txt) = "Hello World!" ]]; then
echo -e "$GREEN OK $2 $3 $NC"
else
echo -e "$RED FAILED $2 $3 $NC"
export TEST_EXIT_STATUS=1
exit 1
fi
kill $FUSE_PID
wait $FUSE_PID
}
run_test --features=libfuse 'with libfuse'
# TODO: re-enable this test. It seems to hang on OSX
#run_test --features=libfuse 'with libfuse' --auto_unmount
export TEST_EXIT_STATUS=0