Skip to content

Commit 7987c0a

Browse files
swvrrhptalbert
authored andcommitted
[redhat] self-test/2001-dist-release.bats: clarify dist-release commit
JIRA: INTERNAL Upstream status: RHEL Only This test assumes that only the dist-release commit message will start with "[redhat] kernel" but that's not a guarantee. This expands that test string to better identify the dist-release commit. Signed-off-by: Scott Weaver <[email protected]> (cherry picked from commit 197740b520e5b22ab1c8b5bcb0c2896de726e130) Signed-off-by: Patrick Talbert <[email protected]>
1 parent c267094 commit 7987c0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

redhat/self-test/2001-dist-release.bats

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Purpose: These are general dist-release tests. They are run from a git
33
# worktree created by the first test.
44

5+
DIST_RELEASE_REGEX="^\[redhat\] kernel-[0-9.]*"
6+
57
load test-lib.bash
68

79
@test "dist-release setup worktree" {
@@ -36,7 +38,7 @@ _dist-release_test_2() {
3638
# release number in Makefile.rhelver.
3739
# and above in prologue.
3840
cd $BATS_TMPDIR/distrelease
39-
title="$(git log --oneline --grep "\[redhat\] kernel" -n 1 --pretty="format:%s")"
41+
title="$(git log --oneline --grep "${DIST_RELEASE_REGEX}" -n 1 --pretty="format:%s")"
4042
# title = ... [redhat] kernel-5.11.0-0.rc0.20201220git467f8165a2b0.104
4143
# Just the title message part AFTER "[redhat] ":
4244
title=${title##*\[redhat\] }
@@ -66,7 +68,7 @@ _dist-release_test_3() {
6668
changelog=$(head -1 ./redhat/kernel.changelog-${RHEL_MAJOR}.${RHEL_MINOR} | sed -e 's/.*\[\(.*\)\].*/\1/')
6769

6870
# Extract the tag in the latest [redhat] kernel commit message
69-
commit="$(git log --oneline --grep "\[redhat\] kernel" -n 1 --pretty="format:%s")"
71+
commit="$(git log --oneline --grep "${DIST_RELEASE_REGEX}" -n 1 --pretty="format:%s")"
7072
# Extract just the commit message part AFTER "[redhat] ":
7173
gitlog=${commit##*\[redhat\] }
7274
# This time, strip off "kernel-" also:

0 commit comments

Comments
 (0)