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

Commit

Permalink
ut: fs test should set RunStoragePath
Browse files Browse the repository at this point in the history
Otherwise it failes with permission errors.

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Dec 26, 2019
1 parent 9bf0d67 commit e5b04a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions virtcontainers/persist/fs/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package fs

import (
"fmt"
"io/ioutil"
"os"
"testing"

Expand All @@ -32,6 +33,13 @@ func TestFsLock(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, fs)

testDir, err := ioutil.TempDir("", "fs-tmp-")
assert.Nil(t, err)
TestSetRunStoragePath(testDir)
defer func() {
os.RemoveAll(testDir)
}()

fs.sandboxState.SandboxContainer = "test-fs-driver"
sandboxDir, err := fs.sandboxDir()
assert.Nil(t, err)
Expand All @@ -51,6 +59,13 @@ func TestFsDriver(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, fs)

testDir, err := ioutil.TempDir("", "fs-tmp-")
assert.Nil(t, err)
TestSetRunStoragePath(testDir)
defer func() {
os.RemoveAll(testDir)
}()

ss := persistapi.SandboxState{}
cs := make(map[string]persistapi.ContainerState)
// missing sandbox container id
Expand Down

0 comments on commit e5b04a5

Please sign in to comment.