File: test-container.sh

package info (click to toggle)
dracut 106-6
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,708 kB
  • sloc: sh: 24,384; ansic: 4,704; makefile: 315; perl: 186; python: 28; javascript: 19
file content (32 lines) | stat: -rwxr-xr-x 883 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
#!/bin/bash

# script for integration testing invoked by GitHub Actions
# wraps configure && make

if command -v systemd-detect-virt > /dev/null && ! systemd-detect-virt -c &> /dev/null; then
    echo "This script assumes that it runs inside a CI container."
    exit 1
fi

set -e
if [ "$V" = "2" ]; then set -x; fi

[[ -d ${0%/*} ]] && cd "${0%/*}"/../

# remove dracut modules that are being tested
(
    cd modules.d
    for dir in *; do
        rm -rf /usr/lib/dracut/modules.d/[0-9][0-9]"${dir/#[0-9][0-9]/}"
    done
)

# disable building documentation by default
[ -z "$enable_documentation" ] && export enable_documentation=no

# shellcheck disable=SC2086
./configure $CONFIGURE_ARG

# treat warnings as error
# shellcheck disable=SC2086
CFLAGS="-Wextra -Werror" make TEST_RUN_ID="${TEST_RUN_ID:=$1}" TESTS="${TESTS:=$2}" V="${V:=1}" $MAKEFLAGS ${TARGETS:=all install check}