File: test-github.sh

package info (click to toggle)
dracut 059-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,464 kB
  • sloc: sh: 24,874; ansic: 4,479; makefile: 350; perl: 241; python: 28
file content (43 lines) | stat: -rwxr-xr-x 1,193 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
36
37
38
39
40
41
42
43
#!/bin/bash

set -ex

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

RUN_ID="$1"
TESTS=$2

./configure

NCPU=$(getconf _NPROCESSORS_ONLN)

if ! [[ $TESTS ]]; then
    # GitHub workflows fetch a clone of the dracut repository which doesn't
    # contain git tags, thus "breaking" the RPM build in certain situations
    # i.e.:
    # DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
    # which in full git clone returns a tag with a numeric version. However,
    # without tags it returns SHA of the last commit, which later propagates into
    # `Provides:` attribute of the built RPM and can break dependency tree when
    # installed
    [[ -d .git ]] && git fetch --tags && git describe --tags
    make -j "$NCPU" all syncheck rpm 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
        )" \
        QEMU_CPU="IvyBridge-v2" \
        DRACUT_NO_XATTR=1 \
        TEST_RUN_ID="$RUN_ID" \
        ${TESTS:+TESTS="$TESTS"} \
        -k V=1 \
        check
fi