Skip to content

Commit

Permalink
skip check when /bin/* file not readable
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiangmoe authored and konoui committed Dec 25, 2024
1 parent 0c6f96e commit d405c7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/lipo/archs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestLipo_ArchsToLocalFiles(t *testing.T) {
dir := "/bin/"
ents, err := os.ReadDir(dir)
if err != nil {
t.Fatal(err)
return
}

if len(ents) == 0 {
Expand All @@ -100,6 +100,11 @@ func TestLipo_ArchsToLocalFiles(t *testing.T) {
}

bin := filepath.Join(dir, ent.Name())
info, err := os.Stat(bin)
// skip test if exe not readable
if err != nil || info.Mode().Perm()&0444 != 0444 {
continue
}
gotArches, err := lipo.New(lipo.WithInputs(bin)).Archs()
if err != nil {
t.Fatalf("archs error: %v", err)
Expand Down

0 comments on commit d405c7e

Please sign in to comment.