Adds a test framework that allows tests to inject fake/mock
dependencies into the vulnreport commands and record the expected
output of commands.
Some subcommand tests are left as TODOs, as they require additional
fake/mock dependencies that haven't been implemented yet.
Change-Id: I25f6085f2297e5b9d916f0927c1111ac2b49bef8
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/590038
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Adds function List, which returns a list of CVE ids that have been
added or updated since the given time.
The source of truth for this function is the "delta log"
published in the cvelistV5 repo.
This will be used by the new "stateless" worker to find the most
recent CVEs to triage.
For golang/go#64720
Change-Id: I94369691fa24924b357537aa651da7142449f2a9
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/550855
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
To make tests easier to update when we make trivial changes (such as the
wording of a lint error), use golden files to hold expected results
for lint tests.
A follow up CL will delete the existing "want" field from the test cases,
but it is left in for now to show that the existing test infra still passes
with this change in place.
Change-Id: Ibeecfef9982bd2bf55d2a699debf931c5d101aa4
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/543160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Adds various helper functions that will be used to add support for the
new CVE v5 schema.
For golang/go#49289
Change-Id: I3e9aaa95e30000c01a3f6b5738950b9dccdd84cc
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/545296
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>