-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·59 lines (38 loc) · 1.1 KB
/
test.sh
File metadata and controls
executable file
·59 lines (38 loc) · 1.1 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# SPDX-FileCopyrightText: 2024 Ferenc Nandor Janky <ferenj@effective-range.com>
# SPDX-FileCopyrightText: 2024 Attila Gombos <attila.gombos@effective-range.com>
# SPDX-License-Identifier: MIT
set -e
ROOT_DIR="$(dirname $0)"
BUILD_ARCH="$1"
DISTRO="$2"
if [ -z "$BUILD_ARCH" ]
then
echo "Usage: $0 <BUILD_ARCH> [<DISTRO>]"
exit 1
fi
if [ -z "$DISTRO" ]
then
echo "Usage: $0 [<DISTRO>]"
exit 1
fi
if [ $BUILD_ARCH == "amd64" ]
then
TARGET=AMD64-${DISTRO^^}
elif [ $BUILD_ARCH == "arm64" ]
then
TARGET=AARCH64-${DISTRO^^}
else
TARGET=${BUILD_ARCH^^}-${DISTRO^^}
fi
if [ ! -d "$ROOT_DIR/TARGET/$TARGET" ]
then
echo "Target directory $TARGET does not exist!"
exit 1
fi
# python tests
python3 -m venv /tmp/testvenv
/tmp/testvenv/bin/python3 -m pip install $ROOT_DIR/build_tools/dpkgdeps_src
/tmp/testvenv/bin/python3 -m unittest discover -s $ROOT_DIR/build_tools/dpkgdeps_src/test/ -p *test.py
IMG_ID=$(uuidgen)
make -C "$ROOT_DIR" base-$BUILD_ARCH TARGET_NAME=$TARGET IMG_TAG=$IMG_ID
make -C "$ROOT_DIR/test" clean test BASE_IMAGE_REPO=effectiverange/$BUILD_ARCH-$DISTRO-tools-base BASE_IMAGE_VER=$IMG_ID