File: basic-check

package info (click to toggle)
upx-ucl 4.2.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,168 kB
  • sloc: ansic: 99,906; cpp: 60,585; asm: 32,273; python: 1,573; makefile: 1,353; sh: 1,143
file content (38 lines) | stat: -rwxr-xr-x 784 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# autopkgtest check: Run really basic tests to confirm upx-ucl works

set -e

readonly SUPPORTED_ARCHS_FILE=$(realpath $(dirname "$0")/../supported-archs)
readonly UPXTMPDIR="$(mktemp -d)"
trap "cd /; rm -rf $UPXTMPDIR" 0 INT QUIT TERM ABRT

cd "$UPXTMPDIR"

run()
{
  echo "+ $@"
  "$@"
}

is_supported_arch()
{
  status="$1"
  arch=$(dpkg-architecture -qDEB_HOST_ARCH)
  ! grep -q "^${arch}\b" "$SUPPORTED_ARCHS_FILE" || exit $status
  echo "Architecture ${arch} not in supported archs file, skipping the test"
  exit 77

}
test -e "$SUPPORTED_ARCHS_FILE" || { echo "$SUPPORTED_ARCHS_FILE does not exist" >&2; exit 101; }

run cp /bin/ls "$UPXTMPDIR"

run upx-ucl ./ls || is_supported_arch "$?"
run ./ls -al

run upx-ucl -t ./ls

run upx-ucl -d ./ls

run cmp ./ls /bin/ls