2020-01-29 16:57:42 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestParseErrata(t *testing.T) {
|
2020-05-14 07:22:25 -06:00
|
|
|
got, err := ParseRemoteErrata("http://ftp.openbsd.org/pub/OpenBSD/patches/6.7/common/")
|
2020-01-29 16:57:42 -07:00
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
}
|
2020-02-24 18:05:00 -07:00
|
|
|
l := len(got.List)
|
2020-03-29 15:42:12 -06:00
|
|
|
if l < 1 {
|
|
|
|
t.Errorf("errata count %d; want > 1", l)
|
|
|
|
}
|
|
|
|
|
|
|
|
erratum := got.List[len(got.List)-1]
|
|
|
|
|
|
|
|
err = erratum.Fetch()
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("can't fetch data for erratum\n%s", err)
|
2020-01-29 16:57:42 -07:00
|
|
|
}
|
|
|
|
}
|