Skip to content

Commit

Permalink
image: Use per-test temp dirs
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Nov 18, 2023
1 parent 1ee669b commit d3b4233
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions image/incus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var incusDef = shared.Definition{
}

func setupIncus(t *testing.T) *IncusImage {
cacheDir := filepath.Join(os.TempDir(), "distrobuilder-test")
cacheDir := filepath.Join(os.TempDir(), "distrobuilder-test-incus")

err := os.MkdirAll(filepath.Join(cacheDir, "rootfs"), 0755)
require.NoError(t, err)
Expand Down Expand Up @@ -66,7 +66,7 @@ func setupIncus(t *testing.T) *IncusImage {
}

func teardownIncus(t *testing.T) {
os.RemoveAll(filepath.Join(os.TempDir(), "distrobuilder-test"))
os.RemoveAll(filepath.Join(os.TempDir(), "distrobuilder-test-incus"))
}

func TestIncusBuild(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion image/lxc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var lxcDef = shared.Definition{

func lxcCacheDir() string {
wd, _ := os.Getwd()
return filepath.Join(wd, "distrobuilder-test")
return filepath.Join(wd, "distrobuilder-test-lxc")
}

func setupLXC() *LXCImage {
Expand Down

0 comments on commit d3b4233

Please sign in to comment.