commit | 0e22668d81b9fedfe116b091effceb14ef264319 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Fri Apr 08 16:26:32 2022 -0400 |
committer | Jonathan Amsterdam <jba@google.com> | Tue Apr 12 18:02:14 2022 +0000 |
tree | 0863aac0579c3e988a5a92872f022b3335bff43d | |
parent | 64c5db5fe4e52edda642d5e5ce4184de35bd1b9a [diff] |
cmd/govulncheck: add hermetic tests for default mode Add a test that runs the govulncheck binary on a module and vuln DB that are completely controlled by this module. - Create a tiny local vuln DB with a couple of vulns. - In our tests, run govulncheck with the GOVULNDB env var set to that DB. - Define two trivial modules that differ only in the version of a dependent module: one version matches a vulnerability in our DB, and one does not. - Create a test that runs govulncheck on each module, and verify that the vulnerability is found and the output is what we expect. Change-Id: Idc053ab3a451375f7a211b4bb24d0ec282d2aaa0 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/399234 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This repository contains the following:
The code in this repository is under active development and not to be considered stable.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Database entries available at https://vuln.go.dev are distributed under the terms of the CC-BY 4.0 license.