@@ -25,9 +25,16 @@ rlJournalStart
25
25
rlRun -s " /usr/bin/koji list-tagged --latest --inherit --quiet f${VERSION_ID} ${PACKIT_PACKAGE_NAME} " 0 " Get latest koji build"
26
26
rlRun " latest_build=\$ (cat $rlRun_LOG | sed 's/\s.*//')" 0 " Resolve latest_build variable"
27
27
if [[ -n " $latest_build " ]]; then
28
- # If the package is already uploaded downstream
28
+ # # If the package is already uploaded downstream
29
+ # Default and required options
30
+ args=" -v -c ${RPMINSPECT_CONFIG:-/ usr/ share/ rpminspect/ fedora.yaml} "
31
+ # Fetch and write to ./inspect_builds
32
+ args=" $args -f -w ./inspect_builds"
33
+ # Specify the architectures
29
34
# TODO: Should have a better way to get the current arch to cover emulated and other cases
30
- rlRun " /usr/bin/rpminspect -v -c ${RPMINSPECT_CONFIG:-/ usr/ share/ rpminspect/ fedora.yaml} -f -w ./inspect_builds --arches=src,noarch,$( arch) $latest_build " 0 " Downloading latest koji builds"
35
+ args=" $args --arches=src,noarch,$( arch) "
36
+ args=" $args $latest_build "
37
+ rlRun " /usr/bin/rpminspect $args " 0 " Downloading latest koji builds"
31
38
fi
32
39
else
33
40
rlFail " Not implemented for tags other than fedora"
@@ -42,18 +49,28 @@ rlJournalStart
42
49
done
43
50
rlRun " tree ./inspect_builds"
44
51
45
- # Do actual rpminspect
46
- args=" "
47
- args=" $args -c ${RPMINSPECT_CONFIG:-/ usr/ share/ rpminspect/ fedora.yaml} "
48
- args=" $args --output=${TMT_TEST_DATA} /result.json --format=json"
49
- args=" $args --verbose"
50
- # TODO: Only exclude if running with copr
51
- args=" $args --exclude=metadata"
52
- args=" $args ${ARCHES: +--arches=$ARCHES } "
53
- args=" $args ${RPMINSPECT_TESTS: +--tests=$RPMINSPECT } "
54
- if [[ -n " $latest_build " ]]; then
55
- args=" $args ./inspect_builds/$latest_build "
52
+ # # Do actual rpminspect
53
+ # Default and required options
54
+ args=" -v -c ${RPMINSPECT_CONFIG:-/ usr/ share/ rpminspect/ fedora.yaml} "
55
+ # Output the data to json so that it can be displayed
56
+ args=" $args --output=$TMT_TEST_DATA /result.json --format=json"
57
+ # Specify the test to run
58
+ if [[ -n " $RPMINSPECT_TESTS " ]]; then
59
+ # Run only specified tests. Takes precedence over --exclude
60
+ args=" $args --tests=$RPMINSPECT_TESTS "
61
+ elif [[ -n " $RPMINSPECT_EXCLUDE " ]]; then
62
+ # Exclude test lists given. Only run if there is no RPMINSPECT_TESTS
63
+ args=" $args --exclude=${RPMINSPECT_EXCLUDE:- metadata} "
64
+ else
65
+ # TODO: Only exclude metadata if running with copr
66
+ # https://tmt.readthedocs.io/en/stable/spec/context.html#initiator
67
+ args=" $args --exclude=metadata"
56
68
fi
69
+ # Run rpminspect for the specified architectures
70
+ [[ -n " $RPMINPSECT_ARCHES " ]] && args=" $args --arches=$RPMINPSECT_ARCHES "
71
+ # If we have a previous build to compare with, use that as before_build
72
+ [[ -n " $latest_build " ]] && args=" $args ./inspect_builds/$latest_build "
73
+ # The remaining part is treated as the after_build/the build to be inspected
57
74
args=" $args ./inspect_builds/$PACKIT_PACKAGE_NVR "
58
75
rlRun " /usr/bin/rpminspect $args " 0 " Run rpminspect"
59
76
rlRun " cp $TMT_PLAN_DATA /viewer.html $TMT_TEST_DATA /viewer.html"
0 commit comments