File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 4
4
"os"
5
5
"path/filepath"
6
6
"testing"
7
+
8
+ "github.com/lima-vm/lima/pkg/store/filenames"
7
9
)
8
10
9
11
func FuzzLoadYAMLByFilePath (f * testing.F ) {
@@ -17,3 +19,26 @@ func FuzzLoadYAMLByFilePath(f *testing.F) {
17
19
LoadYAMLByFilePath (localFile )
18
20
})
19
21
}
22
+
23
+ func FuzzInspect (f * testing.F ) {
24
+ f .Fuzz (func (t * testing.T , yml , limaVersion []byte ) {
25
+ limaDir := t .TempDir ()
26
+ os .Setenv ("LIMA_HOME" , limaDir )
27
+ err := os .MkdirAll (filepath .Join (limaDir , "fuzz-instance" ), 0o700 )
28
+ if err != nil {
29
+ // panic so that we know of problems here
30
+ panic (err )
31
+ }
32
+ ymlFile := filepath .Join (limaDir , "fuzz-instance" , filenames .LimaYAML )
33
+ limaVersionFile := filepath .Join (limaDir , filenames .LimaVersion )
34
+ err = os .WriteFile (ymlFile , yml , 0o600 )
35
+ if err != nil {
36
+ return
37
+ }
38
+ err = os .WriteFile (limaVersionFile , limaVersion , 0o600 )
39
+ if err != nil {
40
+ return
41
+ }
42
+ _ , _ = Inspect ("fuzz-instance" )
43
+ })
44
+ }
You can’t perform that action at this time.
0 commit comments