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:
parent
4dc9ea39dd
commit
011f6356e1
@ -15,6 +15,7 @@
|
|||||||
package packages
|
package packages
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os/exec"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/coreos/clair/database"
|
"github.com/coreos/clair/database"
|
||||||
@ -42,5 +43,10 @@ var rpmPackagesTests = []packagesTest{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRpmPackagesDetector(t *testing.T) {
|
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)
|
testPackagesDetector(t, &RpmPackagesDetector{}, rpmPackagesTests)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user