mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 23:11:57 +00:00
ut: fs test should set RunStoragePath
Otherwise it failes with permission errors. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
9bf0d67fdd
commit
e5b04a5bf2
@ -7,6 +7,7 @@ package fs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@ -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)
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user