summaryrefslogtreecommitdiffstats
path: root/tools/test-github.sh
blob: 4a8d318a61e78b8ab3fd8c1dc6b1190232da1b26 (plain)
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/bash

set -ex

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

RUN_ID="$1"
TESTS=$2

# if is cargo installed, let's build and test dracut-cpio
if command -v cargo > /dev/null; then
    ./configure --enable-dracut-cpio
else
    ./configure
fi

NCPU=$(getconf _NPROCESSORS_ONLN)

if ! [[ $TESTS ]]; then
    make -j "$NCPU" all syncheck logtee
else
    make -j "$NCPU" enable_documentation=no all logtee

    cd test

    # shellcheck disable=SC2012
    time LOGTEE_TIMEOUT_MS=590000 make \
        enable_documentation=no \
        KVERSION="$(
            cd /lib/modules
            ls -1 | tail -1
        )" \
        DRACUT_NO_XATTR=1 \
        TEST_RUN_ID="$RUN_ID" \
        ${TESTS:+TESTS="$TESTS"} \
        -k V=1 \
        check
fi