1
0
out-of-tree/distro/debian/debian_test.go

50 lines
747 B
Go
Raw Normal View History

2023-05-12 17:26:53 +00:00
package debian
import (
"testing"
"github.com/stretchr/testify/assert"
"code.dumpstack.io/tools/out-of-tree/distro"
2023-05-12 17:26:53 +00:00
)
func TestDebian(t *testing.T) {
assert := assert.New(t)
u := Debian{release: Wheezy}
assert.True(u.Equal(distro.Distro{Release: "wheezy", ID: distro.Debian}))
assert.NotEmpty(u.Packages())
}
2023-05-12 20:05:44 +00:00
func TestKernelRelease(t *testing.T) {
kernels, err := GetKernels()
if err != nil {
t.Fatal(err)
2023-05-12 20:05:44 +00:00
}
for _, k := range kernels {
r, err := kernelRelease(k)
2023-05-12 20:05:44 +00:00
if err != nil {
t.Log(k.Version, r, err)
2023-05-12 20:05:44 +00:00
}
}
for _, k := range kernels {
r, err := kernelRelease(k)
if err != nil {
continue
}
if r == Wheezy {
t.Log("Wheezy", k.Version)
}
if r == Jessie {
t.Log("Jessie", k.Version)
}
}
}