2
2
# Purpose: These are general dist-release tests. They are run from a git
3
3
# worktree created by the first test.
4
4
5
+ DIST_RELEASE_REGEX=" ^\[redhat\] kernel-[0-9.]*"
6
+
5
7
load test-lib.bash
6
8
7
9
@test " dist-release setup worktree" {
@@ -36,7 +38,7 @@ _dist-release_test_2() {
36
38
# release number in Makefile.rhelver.
37
39
# and above in prologue.
38
40
cd $BATS_TMPDIR /distrelease
39
- title=" $( git log --oneline --all -- grep " \[redhat\] kernel " -n 1 --pretty=" format:%s" ) "
41
+ title=" $( git log --oneline --grep " ${DIST_RELEASE_REGEX} " -n 1 --pretty=" format:%s" ) "
40
42
# title = ... [redhat] kernel-5.11.0-0.rc0.20201220git467f8165a2b0.104
41
43
# Just the title message part AFTER "[redhat] ":
42
44
title=${title##* \[ redhat\] }
@@ -60,15 +62,20 @@ _dist-release_test_3() {
60
62
# Test whether the version in the commit message matches
61
63
# the version in the change log.
62
64
cd $BATS_TMPDIR /distrelease
65
+
63
66
# Extract just the version part (the part between [ ]) on the first line of
64
67
# the change log:
65
68
changelog=$( head -1 ./redhat/kernel.changelog-${RHEL_MAJOR} .${RHEL_MINOR} | sed -e ' s/.*\[\(.*\)\].*/\1/' )
66
- commit=" $( git log --oneline --all --grep " \[redhat\] kernel" -n 1 --pretty=" format:%s" ) "
69
+
70
+ # Extract the tag in the latest [redhat] kernel commit message
71
+ commit=" $( git log --oneline --grep " ${DIST_RELEASE_REGEX} " -n 1 --pretty=" format:%s" ) "
67
72
# Extract just the commit message part AFTER "[redhat] ":
68
73
gitlog=${commit##* \[ redhat\] }
69
74
# This time, strip off "kernel-" also:
70
75
gitlog=${gitlog/ kernel-/ }
76
+
71
77
echo " The kernel version in the changelog-${RHEL_MAJOR} .${RHEL_MINOR} (" ${changelog} " ) differs from the version in the git log ($gitlog )"
78
+
72
79
run _dist-release_test_3
73
80
check_status
74
81
}
0 commit comments