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 44 "os"
55 "path/filepath"
66 "testing"
7+
8+ "github.com/lima-vm/lima/pkg/store/filenames"
79)
810
911func FuzzLoadYAMLByFilePath (f * testing.F ) {
@@ -17,3 +19,26 @@ func FuzzLoadYAMLByFilePath(f *testing.F) {
1719 LoadYAMLByFilePath (localFile )
1820 })
1921}
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