File: test.sh

package info (click to toggle)
flatpak-builder 1.0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,580 kB
  • sloc: ansic: 23,288; sh: 5,793; xml: 1,718; makefile: 114; python: 6
file content (30 lines) | stat: -rwxr-xr-x 805 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
30
#!/bin/sh
set -e

if ! bwrap --unshare-ipc --unshare-net --unshare-pid --ro-bind / / /bin/true; then
    echo "SKIP: Cannot run bwrap"
    exit 0
fi

# The tests want /sbin/ldconfig to be in PATH
export PATH="$PATH:/usr/sbin:/sbin"

tmpdir="$(mktemp -d -p /var/tmp)"

if ! setfattr -n user.test-xattr-support -v yes "$tmpdir"; then
    rm -fr "$tmpdir"
    echo "SKIP: Cannot set xattrs in /var/tmp"
    exit 0
fi

rm -fr "$tmpdir"

e=0
dh_auto_test || e=$?

echo "Killing gpg-agent processes:"
pgrep --list-full --full "gpg-agent --homedir /var/tmp/test-flatpak-.*" >&2 || :
pgrep --list-full --full "gpg-agent --homedir /var/tmp/flatpak-test-.*" >&2 || :
pkill --full "gpg-agent --homedir /var/tmp/test-flatpak-.*" >&2 || :
pkill --full "gpg-agent --homedir /var/tmp/flatpak-test-.*" >&2 || :
exit "$e"