2023-05-11 12:03:18 +00:00
|
|
|
package snapshot
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSourcePackageVersions(t *testing.T) {
|
|
|
|
versions, err := SourcePackageVersions("linux")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(versions) == 0 {
|
|
|
|
t.Fatal(errors.New("empty response"))
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Logf("found %d package versions", len(versions))
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPackages(t *testing.T) {
|
2023-05-14 13:59:25 +00:00
|
|
|
rx := `^(linux-(image|headers)-[a-z+~0-9\.\-]*-(common|amd64|amd64-unsigned)|linux-kbuild-.*)$`
|
|
|
|
|
|
|
|
packages, err := Packages("linux", "5.10.179-1", rx,
|
2023-05-14 11:38:41 +00:00
|
|
|
[]string{"amd64", "all"}, []string{})
|
2023-05-11 12:03:18 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(packages) == 0 {
|
|
|
|
t.Fatal(errors.New("empty response"))
|
|
|
|
}
|
|
|
|
|
2023-05-14 11:06:54 +00:00
|
|
|
for _, pkg := range packages {
|
|
|
|
t.Logf("%#v", pkg)
|
|
|
|
}
|
2023-05-11 12:03:18 +00:00
|
|
|
}
|