Merge pull request #3839 from monopole/harnessMkDir

Add testharness mkdir function.
This commit is contained in:
Jeff Regan
2021-04-23 11:10:22 -07:00
committed by GitHub

View File

@@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
@@ -93,6 +94,12 @@ func (th *HarnessEnhanced) GetRoot() string {
return th.ldr.Root()
}
func (th *HarnessEnhanced) MkDir(path string) string {
dir := filepath.Join(th.ldr.Root(), path)
th.GetFSys().Mkdir(dir)
return dir
}
func (th *HarnessEnhanced) Reset() {
if th.shouldWipeLdrRoot {
if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {