From: Ben Crocker <bcrocker(a)redhat.com>
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 rpminspect package.
Signed-off-by: Ben Crocker <bcrocker(a)redhat.com>
---
redhat/self-test/1003-rpminspect.bats | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 redhat/self-test/1003-rpminspect.bats
diff --git a/redhat/self-test/1003-rpminspect.bats
b/redhat/self-test/1003-rpminspect.bats
new file mode 100644
index 000000000000..0bda8e52000c
--- /dev/null
+++ b/redhat/self-test/1003-rpminspect.bats
@@ -0,0 +1,15 @@
+#!/usr/bin/env bats
+@test "Exactly one SRPM exists" {
+ result=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm" | wc -l)
+ [ "$result" = 1 ]
+}
+
+@test "rpminspect" {
+ if ! dnf list installed rpminspect >& /dev/null
+ then
+ skip "The rpminspect package is not installed"
+ fi
+ srpm=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm")
+ run rpminspect $srpm
+ [ "$status" = 0 ]
+}
--
GitLab