Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ut: direct factory needs to set VCStorePrefix
Browse files Browse the repository at this point in the history
Otherwise it fails with permission errors.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
  • Loading branch information
bergwolf committed Dec 26, 2019
1 parent 4c35d09 commit 9bf0d67
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion virtcontainers/factory/direct/direct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,26 @@ package direct
import (
"context"
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/assert"

vc "github.com/kata-containers/runtime/virtcontainers"
"github.com/kata-containers/runtime/virtcontainers/store"
)

func TestTemplateFactory(t *testing.T) {
assert := assert.New(t)

testDir, _ := ioutil.TempDir("", "vmfactory-tmp-")
testDir, err := ioutil.TempDir("", "vmfactory-tmp-")
assert.Nil(err)
store.VCStorePrefix = testDir
defer func() {
os.RemoveAll(testDir)
store.VCStorePrefix = ""
}()

hyperConfig := vc.HypervisorConfig{
KernelPath: testDir,
ImagePath: testDir,
Expand Down

0 comments on commit 9bf0d67

Please sign in to comment.