From f56d70ccd65a45a0cab5cf4b23b54219850695b8 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Sun, 22 Dec 2019 19:41:56 -0800 Subject: [PATCH] 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 --- virtcontainers/virtcontainers_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virtcontainers/virtcontainers_test.go b/virtcontainers/virtcontainers_test.go index 516face355..fe96644143 100644 --- a/virtcontainers/virtcontainers_test.go +++ b/virtcontainers/virtcontainers_test.go @@ -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)