Check rpm executable

Before launching unit tests, we check if 'rpm' command
is present or not.

Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
This commit is contained in:
Nicolas Lamirault 2016-01-05 11:25:31 +01:00
parent 4dc9ea39dd
commit 011f6356e1

View File

@ -15,6 +15,7 @@
package packages
import (
"os/exec"
"testing"
"github.com/coreos/clair/database"
@ -42,5 +43,10 @@ var rpmPackagesTests = []packagesTest{
}
func TestRpmPackagesDetector(t *testing.T) {
_, err := exec.LookPath("rpm")
if err != nil {
log.Warningf("could not find rpm executable. skipping")
return
}
testPackagesDetector(t, &RpmPackagesDetector{}, rpmPackagesTests)
}