Skip to content
Snippets Groups Projects

CI: Extend integration testing

Merged Caleb Connolly requested to merge caleb/moar-testing into master
All threads resolved!
Compare and Show latest version
1 file
+ 16
12
Compare changes
  • Side-by-side
  • Inline
+ 16
12
#!/bin/sh -e
set -x
if [ "$(id -u)" = 0 ]; then
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
@@ -14,6 +12,7 @@ usage() {
}
pmbootstrap() {
echo "+ pmbootstrap $*"
./pmbootstrap.py --details-to-stdout -t "$@"
}
@@ -32,7 +31,7 @@ pmbootstrap config device qemu-amd64
build_images() {
device="$1"
ui="$2"
if [ -z "$ui" -o -z "$device" ]; then
if [ -z "$ui" ] || [ -z "$device" ]; then
usage "<device> <ui>"
fi
pmbootstrap config ui "$ui"
@@ -49,55 +48,60 @@ build_images() {
force_build() {
arch="$1"
shift
packages="$@"
if [ -z "$arch" -o -z "$packages" ]; then
packages="$*"
if [ -z "$arch" ] || [ -z "$packages" ]; then
usage "<arch> <packages...>"
fi
echo "Force building $packages for $arch"
# shellcheck disable=SC2086
pmbootstrap build --force --arch "$arch" $packages
}
strict_build() {
arch="$1"
shift
packages="$@"
if [ -z "$arch" -o -z "$packages" ]; then
packages="$*"
if [ -z "$arch" ] || [ -z "$packages" ]; then
usage "<arch> <packages...>"
fi
echo "Strict building $packages for $arch"
# shellcheck disable=SC2086
pmbootstrap build --strict --arch "$arch" $packages
}
force_strict_build() {
arch="$1"
shift
packages="$@"
if [ -z "$arch" -o -z "$packages" ]; then
packages="$*"
if [ -z "$arch" ] || [ -z "$packages" ]; then
usage "<arch> <packages...>"
fi
echo "Force building $packages for $arch"
# shellcheck disable=SC2086
pmbootstrap build --force --strict --arch "$arch" $packages
}
bump_autobuild() {
device="$1"
package="$2"
if [ -z "$device" -o -z "$package" ]; then
if [ -z "$device" ] || [ -z "$package" ]; then
usage "<device> <package>"
fi
pmbootstrap config device "$device"
echo "Bumping pkgrel of $package"
# shellcheck disable=SC2086
pmbootstrap pkgrel_bump $package
echo "Ensuring package is built during install"
pmbootstrap config ui none
# shellcheck disable=SC2086
pmbootstrap install --no-image --add $package
pkgs="$(find -type f $(pmbootstrap config work)/packages/)"
pkgs="$(find "$(pmbootstrap config work)/packages)" -type f)"
if ! echo "$pkgs" | grep -q "$package"; then
echo "Package $package not found in built packages:"
echo "$pkgs"
@@ -106,4 +110,4 @@ bump_autobuild() {
}
# Run the test
$test $@
$test "$@"
Loading