-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathptfs_test.sh
More file actions
executable file
·47 lines (35 loc) · 784 Bytes
/
ptfs_test.sh
File metadata and controls
executable file
·47 lines (35 loc) · 784 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
46
47
#!/bin/bash
# Integration testing for ninja file system.
set -ex
TESTDIR=out/ptfstmp
TESTSRC=out/ptfstmpsrc
cleanup() {
fusermount3 -z -u $TESTDIR || true
}
cleanup
trap cleanup exit
mkdir $TESTDIR 2> /dev/null || true
rm -r $TESTSRC || true
cp -r testdata $TESTSRC
out/ptfs $TESTDIR --underlying_path=$TESTSRC
out/ptfs_exercise
ls -l $TESTDIR/
if cat $TESTDIR/does_not_exist; then
echo unexpected success
exit 1
else
echo 'expected'
fi
grep git $TESTDIR/README.md
touch $TESTDIR/one
echo hoge > $TESTDIR/two
if out/renameat2 $TESTDIR/two $TESTDIR/one RENAME_NOREPLACE; then
echo unexpected success
exit 1
else
echo 'expected'
fi
out/renameat2 $TESTDIR/two $TESTDIR/one RENAME_EXCHANGE
ls -l $TESTDIR/
grep hoge $TESTDIR/one
fincore $TESTDIR/*