File: test-gphotofs.sh

package info (click to toggle)
gphotofs 0.5-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,580 kB
  • sloc: sh: 10,616; ansic: 709; makefile: 23
file content (29 lines) | stat: -rwxr-xr-x 746 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -ex

mountpoint=${mountpoint-test-mountpoint}
testdir="${testdir-.}"
camera="Mass Storage Camera"

# FIXME: 
# If libgphoto2 is not installed yet,
# - IOLIBS must be pointed to where the "disk" iolib is.
# - CAMLIBS must be pointed to where the "directory" camlib is.

trap "umount ${mountpoint}; rm "$testdir"/*; rmdir ${mountpoint} $testdir" EXIT

if test -d "$mountpoint"; then rmdir "$mountpoint"; fi
if test -d "$testdir"; then rmdir "$testdir"; fi
mkdir "${mountpoint}" "$testdir"
cp "$srcdir/gphotofs.c" "$testdir/"

"./gphotofs" --port "disk:$(cd "$testdir" > /dev/null && pwd)" --camera "$camera" "${mountpoint}"

sleep 2
ls -al "${mountpoint}"

umount "${mountpoint}"

rm -f "$testdir"/*
rmdir "${mountpoint}" "$testdir"