Skip to content

Commit c267094

Browse files
praritptalbert
authored andcommitted
redhat/self-test: Remove --all from git query
JIRA: INTERNAL Upstream status: RHEL Only It was reported that executing this test on an older tag failed. This occurs because the git query to find the most recent "[redhat] kernel" commit looks at the entire git history instead of the branch's history. Removing the '--all' from the "[redhat] kernel" lookup resolves this problem. Testing: There are 3 cases that I considered which all succeed with this change: 1. running on os-build or ark-latest git co origin/os-build RHEL_MAJOR=9 RHEL_MINOR=99 bats redhat/self-test/2001-dist-release.bats 2. a new branch based on os-build/ark-latest git co origin/ark-latest git checkout -b junk /# make some changes RHEL_MAJOR=9 RHEL_MINOR=99 bats redhat/self-test/2001-dist-release.bats 3. an older branch based on a tag git co kernel-6.6.0-0.rc7.56567a20b22b.59 RHEL_MAJOR=9 RHEL_MINOR=99 bats redhat/self-test/2001-dist-release.bats Signed-off-by: Prarit Bhargava <prarit@redhat.com> (cherry picked from commit b1e1a63126003b829e28e012e1b8f87eafbbae4d) Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
1 parent 169069d commit c267094

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,20 @@ _dist-release_test_3() {
6060
# Test whether the version in the commit message matches
6161
# the version in the change log.
6262
cd $BATS_TMPDIR/distrelease
63+
6364
# Extract just the version part (the part between [ ]) on the first line of
6465
# the change log:
6566
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")"
67+
68+
# Extract the tag in the latest [redhat] kernel commit message
69+
commit="$(git log --oneline --grep "\[redhat\] kernel" -n 1 --pretty="format:%s")"
6770
# Extract just the commit message part AFTER "[redhat] ":
6871
gitlog=${commit##*\[redhat\] }
6972
# This time, strip off "kernel-" also:
7073
gitlog=${gitlog/kernel-/}
74+
7175
echo "The kernel version in the changelog-${RHEL_MAJOR}.${RHEL_MINOR} ("${changelog}") differs from the version in the git log ($gitlog)"
76+
7277
run _dist-release_test_3
7378
check_status
7479
}

0 commit comments

Comments
 (0)