fix(debian,ubuntu): collect running kernel source package (#1935)

This commit is contained in:
MaineK00n
2024-06-06 21:20:16 +09:00
committed by GitHub
parent 5af1a22733
commit e1fab805af
9 changed files with 666 additions and 358 deletions

View File

@@ -395,41 +395,6 @@ func TestDebian_detect(t *testing.T) {
}
}
func TestDebian_isKernelSourcePackage(t *testing.T) {
tests := []struct {
pkgname string
want bool
}{
{
pkgname: "linux",
want: true,
},
{
pkgname: "apt",
want: false,
},
{
pkgname: "linux-5.10",
want: true,
},
{
pkgname: "linux-grsec",
want: true,
},
{
pkgname: "linux-base",
want: false,
},
}
for _, tt := range tests {
t.Run(tt.pkgname, func(t *testing.T) {
if got := (Debian{}).isKernelSourcePackage(tt.pkgname); got != tt.want {
t.Errorf("Debian.isKernelSourcePackage() = %v, want %v", got, tt.want)
}
})
}
}
func TestDebian_CompareSeverity(t *testing.T) {
type args struct {
a string