summaryrefslogtreecommitdiff
path: root/test.sh
blob: dd0da83b90f6ff23e5820d7ff444d4725046afe3 (plain)
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
#!/bin/sh -xe
make gallery
target=/tmp/G input=/tmp/Gi
rm -rf $target $input

mkdir -p $target
cp -ra $HOME/Pictures/Anime $input

./gallery init $target
#./gallery import $target $input
./gallery sync $target $input
./gallery thumbnail $target
./gallery dhash $target
./gallery tag $target autotagger "DanBooru autotagger" \
	< ../build-db/autotagger.tsv

./gallery web $target :8080 &
web=$!

echo '{"path":"/tmp/Gi"}' | \
curl http://localhost:8080/api/browse -X POST --data-binary @-
echo '{"sha1":"d53fc82162fd19a6e7b92b401b08b7505dbf3dfd"}' | \
curl http://localhost:8080/api/info -X POST --data-binary @-
echo '{"sha1":"9539d9895ab8c25d76c321b23b8a327801a496bb"}' | \
curl http://localhost:8080/api/similar -X POST --data-binary @-
echo '{}' | \
curl http://localhost:8080/api/duplicates -X POST --data-binary @-
echo '{}' | \
curl http://localhost:8080/api/orphans -X POST --data-binary @-

kill $web
wait $web