aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/image/fsck_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/image/fsck_test.go')
-rw-r--r--pkg/image/fsck_test.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/image/fsck_test.go b/pkg/image/fsck_test.go
index aae102ec7..e901e089f 100644
--- a/pkg/image/fsck_test.go
+++ b/pkg/image/fsck_test.go
@@ -7,7 +7,6 @@ import (
"fmt"
"io"
"os"
- "os/exec"
"path/filepath"
"strings"
"testing"
@@ -24,16 +23,12 @@ import (
const corruptedFs = "IAmACorruptedFs"
-func fsckAvailable(cmd string) bool {
- _, err := exec.LookPath(strings.Fields(cmd)[0])
- return err == nil
-}
-
func TestFsck(t *testing.T) {
target, err := prog.GetTarget(targets.Linux, targets.AMD64)
if err != nil {
t.Fatal(err)
}
+ fsckChecker := FsckChecker{}
// Use the images generated by syz-imagegen as a collection of clean file systems.
cleanFsProgs, err := filepath.Glob(filepath.Join("..", "sys", "linux", "test", "syz_mount_image_*_0"))
@@ -56,7 +51,7 @@ func TestFsck(t *testing.T) {
}
fsckCmd := c.Meta.Attrs.Fsck
// Tolerate missing fsck commands except during CI runs.
- skip := !fsckAvailable(fsckCmd) && os.Getenv("CI") == ""
+ skip := !fsckChecker.Exists(fsckCmd) && os.Getenv("CI") == ""
fsName := strings.TrimPrefix(c.Meta.Name, "syz_mount_image$")
// Check that the file system in the image is detected as clean.