File: test-container.sh

package info (click to toggle)
dracut 109-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,592 kB
  • sloc: sh: 24,498; ansic: 5,234; makefile: 346; perl: 186; python: 48; javascript: 19
file content (35 lines) | stat: -rwxr-xr-x 1,057 bytes parent folder | download
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
#!/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 -eu
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 --enable-test ${CONFIGURE_ARG-}

# allow the execution of arbitrary commands within the test container
[[ -n ${TEST_CONTAINER_COMMAND-} ]] && eval "$TEST_CONTAINER_COMMAND"

# 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}