Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 46 lines (37 sloc) 1.165 kB
c881002 @hanwen Add test file.
authored
1 #!/bin/sh
2
3 set -eux
087265e @hanwen Renaming.
authored
4 storage="Internal Storage"
c881002 @hanwen Add test file.
authored
5 mount=$(mktemp -d)
087265e @hanwen Renaming.
authored
6 root="$mount/$storage"
7 delay="sleep 2"
8 ./go-mtpfs -fs-debug $mount &
9 $delay
c881002 @hanwen Add test file.
authored
10
087265e @hanwen Renaming.
authored
11 test -d "$root"
c881002 @hanwen Add test file.
authored
12 rm -rf "$root/mtpfs-test"
13 mkdir "$root/mtpfs-test"
087265e @hanwen Renaming.
authored
14 mkdir "$root/mtpfs-test/create"
15 mkdir "$root/mtpfs-test/delete"
16 rmdir "$root/mtpfs-test/delete"
c881002 @hanwen Add test file.
authored
17 echo -n hello > "$root/mtpfs-test/test.txt"
18 ls -l "$root/mtpfs-test/test.txt"
19 test $(cat "$root/mtpfs-test/test.txt") == "hello"
20 touch "$root/mtpfs-test/test.txt"
21 echo something else > "$root/mtpfs-test/test.txt"
22
087265e @hanwen Renaming.
authored
23 mv "$root/mtpfs-test/test.txt" "$root/mtpfs-test/test2.txt"
24 ! test -f "$root/mtpfs-test/test.txt"
25 test -f "$root/mtpfs-test/test2.txt"
26
27 echo hoi > "$root/mtpfs-test/dest.txt"
28 echo hoi > "$root/mtpfs-test/src.txt"
29 mv "$root/mtpfs-test/src.txt" "$root/mtpfs-test/dest.txt"
30 test -f "$root/mtpfs-test/dest.txt"
31 ! test -f "$root/mtpfs-test/src.txt"
32
33 fusermount -u $mount
34
35 ./go-mtpfs $mount &
36 $delay
37
38 test -d "$root/mtpfs-test/create"
39 ! test -d "$root/mtpfs-test/delete"
40 ! test -f "$root/mtpfs-test/test.txt"
41 test -f "$root/mtpfs-test/test2.txt"
42 test -f "$root/mtpfs-test/dest.txt"
43 ! test -f "$root/mtpfs-test/src.txt"
44
c881002 @hanwen Add test file.
authored
45 fusermount -u $mount
Something went wrong with that request. Please try again.