[OS-BUILD PATCHv4 4/7] redhat/self-test: Fix version tag test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

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@xxxxxxxxxx>

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/1652
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux