mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-14 14:14:15 +00:00
vc: UT should set VCStorePrefix
Otherwise we fail to run it with non-root user with errors like: `mkdir /var/lib/vc/uuid: permission denied` Fixes: #2370 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
b9120b2bb1
commit
f56d70ccd6
@ -64,12 +64,14 @@ func cleanUp() {
|
||||
store.DeleteAll()
|
||||
os.RemoveAll(testDir)
|
||||
os.MkdirAll(testDir, store.DirMode)
|
||||
store.VCStorePrefix = ""
|
||||
|
||||
setup()
|
||||
}
|
||||
|
||||
func setup() {
|
||||
os.Mkdir(filepath.Join(testDir, testBundle), store.DirMode)
|
||||
store.VCStorePrefix = testDir
|
||||
|
||||
for _, filename := range []string{testQemuKernelPath, testQemuInitrdPath, testQemuImagePath, testQemuPath} {
|
||||
_, err := os.Create(filename)
|
||||
|
Loading…
Reference in New Issue
Block a user