From: Prarit Bhargava <prarit(a)redhat.com>
redhat/self-test: Fix version tag test
The version tag test is using an incorrect changelog ID and doesn't
look for the last '[redhat] kernel-*' commit.
Fix both of these problems so the test runs correctly.
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
diff --git a/redhat/self-test/2001-dist-release.bats
b/redhat/self-test/2001-dist-release.bats
index blahblah..blahblah 100644
--- a/redhat/self-test/2001-dist-release.bats
+++ b/redhat/self-test/2001-dist-release.bats
@@ -48,13 +48,14 @@
cd $BATS_TMPDIR/distrelease
# Extract just the version part (the part between [ ]) on the first line of
# the change log:
- changelogversion=$(head -1 ./redhat/kernel.changelog-8.99 | sed -e
's/.*\[\(.*\)\].*/\1/')
- commit="$(git log --oneline -n 1)"
+ changelog=$(head -1 ./redhat/kernel.changelog-${RHEL_MAJOR}.${RHEL_MINOR} | sed -e
's/.*\[\(.*\)\].*/\1/')
+ commit="$(git log --oneline --all --grep "\[redhat\] kernel" -n 1
--pretty="format:%s")"
# Extract just the commit message part AFTER "[redhat] ":
- title=${commit##*\[redhat\] }
+ gitlog=${commit##*\[redhat\] }
# This time, strip off "kernel-" also:
- title=${title/kernel-/}
- [ "$changelogversion" = "$title" ]
+ gitlog=${gitlog/kernel-/}
+ echo "The kernel version in the changelog ($changelog) differs from the version
in the git log ($gitlog)"
+ [ "$changelog" = "$gitlog" ]
}
@test "dist-release epilogue" {
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1642