Skip to content

Commit

Permalink
Merge branch 'master' of github.com:future-architect/vuls
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe committed Nov 26, 2019
2 parents 03e7b90 + 7f72b6a commit 3f80749
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion scan/alpine.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ func (o *alpine) apkUpdate() error {
func (o *alpine) preCure() error {
o.log.Infof("Scanning in %s", o.getServerInfo().Mode)
if err := o.detectIPAddr(); err != nil {
o.log.Debugf("Failed to detect IP addresses: %s", err)
o.log.Warnf("Failed to detect IP addresses: %s", err)
o.warns = append(o.warns, err)
}
// Ignore this error as it just failed to detect the IP addresses
return nil
Expand Down
3 changes: 2 additions & 1 deletion scan/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ func (o *debian) checkDeps() error {
func (o *debian) preCure() error {
o.log.Infof("Scanning in %s", o.getServerInfo().Mode)
if err := o.detectIPAddr(); err != nil {
o.log.Debugf("Failed to detect IP addresses: %s", err)
o.log.Warnf("Failed to detect IP addresses: %s", err)
o.warns = append(o.warns, err)
}
// Ignore this error as it just failed to detect the IP addresses
return nil
Expand Down
4 changes: 3 additions & 1 deletion scan/debian_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scan

import (
"sort"
"os"
"reflect"
"testing"
Expand Down Expand Up @@ -729,15 +730,16 @@ dpkg-query: no path found matching pattern /lib/udev/hwdb.bin
libuuid1:amd64: /lib/x86_64-linux-gnu/libuuid.so.1.3.0`,
},
wantPkgNames: []string{
"udev",
"libuuid1",
"udev",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
o := &debian{}
gotPkgNames := o.parseGetPkgName(tt.args.stdout)
sort.Strings(gotPkgNames)
if !reflect.DeepEqual(gotPkgNames, tt.wantPkgNames) {
t.Errorf("debian.parseGetPkgName() = %v, want %v", gotPkgNames, tt.wantPkgNames)
}
Expand Down

0 comments on commit 3f80749

Please sign in to comment.