forked from rfjakob/fuse-xfstests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck-gocryptfs
executable file
·61 lines (47 loc) · 1.23 KB
/
check-gocryptfs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -u
MYNAME=$(basename "$0")
if [[ $EUID -ne 0 ]]; then
echo "must run as root"
exit 1
fi
export PATH=$PATH:/usr/local/bin
# Try to keep the machine usable while the tests are running.
renice 19 $$ > /dev/null
echo "fuse-xfstests $(git rev-parse --abbrev-ref HEAD)/$(git rev-parse --short HEAD)"
date -u
echo
# Test root dir
R=/var/tmp/fuse-xfstests/$MYNAME
export TEST_DEV=$R/testdev
export TEST_DIR=$R/testdir
if mountpoint "$TEST_DIR" &> /dev/null ; then
umount "$TEST_DIR" || exit 1
fi
rm -Rf "$TEST_DEV"/*
export SCRATCH_DEV=$R/scratchdev
export SCRATCH_MNT=$R/scratchdir
if mountpoint "$SCRATCH_MNT" &> /dev/null ; then
umount "$SCRATCH_MNT" || exit 1
fi
rm -Rf "$SCRATCH_DEV"/*
mkdir -p "$TEST_DEV" "$TEST_DIR" "$SCRATCH_DEV" "$SCRATCH_MNT" || exit
if [[ $MYNAME == check-gocryptfs ]]; then
type gocryptfs
gocryptfs -version
export FSTYP=fuse.gocryptfs
if [[ ! -e $TEST_DEV/gocryptfs.conf ]]; then
gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$TEST_DEV" || exit
fi
elif [[ $MYNAME == check-loopback ]]; then
type loopback
export FSTYP=fuse.loopback
else
echo "unknown mode of operation: $MYNAME"
exit 1
fi
SECONDS=0
./check "$@"
RET=$?
echo "Runtime was $SECONDS seconds, exit code $RET"
exit $RET