fleet/server/vulnerabilities
Eng Zer Jun abe33f1d8d
test: use T.TempDir to create temporary test directory (#6080)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-06-13 10:20:38 -03:00
..
oval Do not use golangci action for better reproducibility (use make lint-go) (#6175) 2022-06-10 18:52:24 -03:00
testdata fix epss probability (#6083) 2022-06-03 11:37:47 -06:00
vuln_centos Sync CVE scores periodically (#5838) 2022-06-01 10:06:57 -06:00
centos.go Add CentOS parsing+post-processing to reduce false positives in vulnerability processing (#4037) 2022-02-14 15:13:44 -03:00
centos_test.go Include CVE scores when listing software (#5673) 2022-05-20 10:58:40 -06:00
cpe.go Improve vulnerability detection for Ubuntu (#6102) 2022-06-07 21:09:47 -04:00
cpe_test.go test: use T.TempDir to create temporary test directory (#6080) 2022-06-13 10:20:38 -03:00
cve.go Improve vulnerability detection for Ubuntu (#6102) 2022-06-07 21:09:47 -04:00
cve_test.go Fix flaky test TestVulnerabilityDataStream (#6162) 2022-06-09 10:36:37 -03:00
db.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
sync.go Do not use golangci action for better reproducibility (use make lint-go) (#6175) 2022-06-10 18:52:24 -03:00
sync_test.go fix mem usage cve sync (#6131) 2022-06-08 13:15:44 -06:00
testing_utils.go Fix build, add missing tests for cpe translations (#1631) 2021-08-11 14:52:09 -03:00