Files
felhom-agent/internal/localapi/cutwrite_main_test.go
T

22 lines
473 B
Go

package localapi
import (
"os"
"testing"
"gitea.dooplex.hu/admin/felhom-agent/internal/config"
)
// TestMain points the config write journal (config.CutWriteDir, R-1380) at a temp folder: the real one is the
// agent's state folder on a box, and a test must not need it.
func TestMain(m *testing.M) {
dir, err := os.MkdirTemp("", "felhom-cutwrite-")
if err != nil {
panic(err)
}
config.CutWriteDir = dir
code := m.Run()
_ = os.RemoveAll(dir)
os.Exit(code)
}