[OS-BUILD PATCHv17 3/5] [redhat] self-test/1001-rpmlint.bats, 1003-rpminspect.bats

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

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

1003-rpminspect.bats: initial commit.

Like the 1001-rpmlint.bats test, this test
• tests for exactly one SRPM
• runs rpminspect (instead of rpmlint) on that SRPM,
  after checking for the presence of the /usr/bin/rpminspect.

Both 1001-rpmlint.bats and 1003-rpminspect.bats
Check via 'test -x' whether the /usr/bin/rpmlint or rpminspect,
respectively, is installed; if not, skip the test and print a message.

For now, skip both tests entirely, pending fixes to kernel.spec.template.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 redhat/self-test/1001-rpmlint.bats    | 12 +++++++++---
 redhat/self-test/1003-rpminspect.bats | 17 +++++++++++++++++
 2 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 redhat/self-test/1003-rpminspect.bats

diff --git a/redhat/self-test/1001-rpmlint.bats b/redhat/self-test/1001-rpmlint.bats
index bd0d8d1bcc24..6329fb0dc0a2 100644
--- a/redhat/self-test/1001-rpmlint.bats
+++ b/redhat/self-test/1001-rpmlint.bats
@@ -5,7 +5,13 @@
 }
 
 @test "rpmlint" {
-      srpm=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm")
-      run rpmlint $srpm
-      [ "$status" = 0 ]
+    if ! test -x /usr/bin/rpmlint
+    then
+        skip "The rpmlint package is not installed"
+    else
+        skip "Skip rpmlint test pending kernel.spec.template changes"
+    fi
+    srpm=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm")
+    run rpmlint $srpm
+    [ "$status" = 0 ]
 }
diff --git a/redhat/self-test/1003-rpminspect.bats b/redhat/self-test/1003-rpminspect.bats
new file mode 100644
index 000000000000..85194f8c083d
--- /dev/null
+++ b/redhat/self-test/1003-rpminspect.bats
@@ -0,0 +1,17 @@
+#!/usr/bin/env bats
+@test "Exactly one SRPM exists" {
+    result=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm" | wc -l)
+    [ "$result" = 1 ]
+}
+
+@test "rpminspect" {
+    if ! test -x /usr/bin/rpminspect
+    then
+        skip "The rpminspect package is not installed"
+    else
+        skip "Skip rpminspect test pending fixes"
+    fi
+    srpm=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm")
+    run rpminspect $srpm
+    [ "$status" = 0 ]
+}
-- 
GitLab
_______________________________________________
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




[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