[OS-BUILD PATCH 3/5] redhat/self-test: Fix BUILD verification test

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

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

redhat/self-test: Fix BUILD verification test

This test fails because it assumes that the top commit will be a
"[redhat]: kernel-version" commit.  This is true for the main tree but
isn't true for development branches.

Change the test to look for the latest "[redhat]: kernel-version" commit
and compare the value of BUILD to the value in that kernel version.

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
@@ -24,19 +24,20 @@
 
 @test "dist-release test 2" {
     # Test whether release number in commit message matches
-    # release number in Makefile.rhelver, which is BUILD as
-    # established in Makefile.common (BUILD:=$(RHEL_RELEASE))
+    # release number in Makefile.rhelver.
     # and above in prologue.
     cd $BATS_TMPDIR/distrelease
-    commit="$(git log --oneline -n 1)"
-    # commit = ... [redhat] kernel-5.11.0-0.rc0.20201220git467f8165a2b0.104
-    # Just the commit message part AFTER "[redhat] ":
-    title=${commit##*\[redhat\] }
+    title="$(git log --oneline --all  --grep "\[redhat\] kernel" -n 1 --pretty="format:%s")"
+    # title = ... [redhat] kernel-5.11.0-0.rc0.20201220git467f8165a2b0.104
+    # Just the title message part AFTER "[redhat] ":
+    title=${title##*\[redhat\] }
     # Strip off ...kernel-VV.PP.SS-:
     pkgrelease=${title##*kernel-+([5-9]).+([0-9]).+([0-9])-}
-    # BUILD = RHEL_RELEASE from Makefile.rhelver; cf. Makefile.common:
-    BUILD=$(DIST=.fc33 make dist-dump-variables | grep "^BUILD=" | sed -e 's/BUILD=//')
-    echo $pkgrelease | grep -q -w $BUILD
+    build=$(BUILD= DIST=.fc33 make dist-dump-variables | grep -E "^BUILD=" | cut -d"=" -f2 | xargs)
+    ((build--))
+    echo "pkgrelease=$pkgrelease"
+    echo "build=$build"
+    echo $pkgrelease | grep -q -w "$build"
     status=$?
     [ "$status" = 0 ]
 }

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1642
_______________________________________________
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