[OS-BUILD PATCH 3/3] redhat: fix the 'eln BUILD_TARGET' self-test

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

 



From: Patrick Talbert <ptalbert@xxxxxxxxxx>

redhat: fix the 'eln BUILD_TARGET' self-test

This test is supposed to confirm that when DIST is set to ".eln" the
BUILD_TARGET will be set to "eln" but the check is inversed. Fix it.

Also, since this test is typically invoked by make, the BUILD_TARGET,
DIST, & DISTRO environment vars will already be set. Then when the test
calls `make dist-dump-variables` it finds these existing values instead
of deriving new ones. So if the test is run from a fedora system it
will fail because setting DIST doesn't have the expected effect when
BUILD_TARGET & DISTRO are already set.

Fix this by having the test first unset BUILD_TARGET and DISTRO.

Signed-off-by: Patrick Talbert <ptalbert@xxxxxxxxxx>

diff --git a/redhat/self-test/1005-dist-dump-variables.bats b/redhat/self-test/1005-dist-dump-variables.bats
index blahblah..blahblah 100644
--- a/redhat/self-test/1005-dist-dump-variables.bats
+++ b/redhat/self-test/1005-dist-dump-variables.bats
@@ -18,8 +18,13 @@ load test-lib.bash
 }
 
 # Purpose: This test verifies the BUILD_TARGET value is "eln" for DIST=".eln".
+# The BUILD_TARGET & DISTRO environment variables need to be unset or the
+# redhat/Makefile will just pick up existing values and not reconsider the
+# DIST=".eln" passed to the make dist-dump-variables below.
 @test "eln BUILD_TARGET test" {
+	unset BUILD_TARGET
+	unset DISTRO
 	bt=$(make DIST=".eln" dist-dump-variables | grep "BUILD_TARGET=" | cut -d"=" -f2)
-	run [ "$bt" != "eln" ]
+	run [ "$bt" = "eln" ]
 	check_status
 }

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2584
_______________________________________________
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, report it: https://pagure.io/fedora-infrastructure/new_issue




[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