libct/cg/fs/*_test.go: use t.TempDir

This simplifies the code as no explicit cleanup is required.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-07-19 15:23:00 -07:00
parent 2d1645d2e5
commit f6a56f603c
12 changed files with 8 additions and 84 deletions
-2
View File
@@ -27,7 +27,6 @@ const (
func TestCpuacctStats(t *testing.T) {
helper := NewCgroupTestUtil("cpuacct.", t)
defer helper.cleanup()
helper.writeFileContents(map[string]string{
"cpuacct.usage": cpuAcctUsageContents,
"cpuacct.usage_percpu": cpuAcctUsagePerCPUContents,
@@ -68,7 +67,6 @@ func TestCpuacctStats(t *testing.T) {
func TestCpuacctStatsWithoutUsageAll(t *testing.T) {
helper := NewCgroupTestUtil("cpuacct.", t)
defer helper.cleanup()
helper.writeFileContents(map[string]string{
"cpuacct.usage": cpuAcctUsageContents,
"cpuacct.usage_percpu": cpuAcctUsagePerCPUContents,