From: Ben Crocker bcrocker@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 /usr/bin/rpminspect.
Checks for existence of /usr/bin/rpminspect via test -x
Signed-off-by: Ben Crocker bcrocker@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..58ec8f9665cd --- /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 ! test -x /usr/bin/rpminspect + then + skip "The rpminspect package is not installed" + fi + srpm=$(find "$BATS_TEST_DIRNAME"/.. -name "*.rpm") + run rpminspect $srpm + [ "$status" = 0 ] +}