2018-06-12 10:04:35 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-06-17 15:41:58 -04:00
|
|
|
"fmt"
|
2018-06-12 10:04:35 -04:00
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestVulns(t *testing.T) {
|
2018-06-17 15:41:58 -04:00
|
|
|
out, err := run("vulns", "--clair", "http://localhost:6060", fmt.Sprintf("%s/alpine:3.5", domain))
|
2018-06-12 10:04:35 -04:00
|
|
|
if err != nil {
|
2018-06-17 15:41:58 -04:00
|
|
|
t.Fatalf("output: %s, error: %v", out, err)
|
2018-06-12 10:04:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
expected := `clair.clair resp.Status=200 OK`
|
|
|
|
if !strings.HasSuffix(strings.TrimSpace(out), expected) {
|
2018-06-17 15:41:58 -04:00
|
|
|
t.Fatalf("expected: %s\ngot: %s", expected, out)
|
2018-06-12 10:04:35 -04:00
|
|
|
}
|
|
|
|
}
|