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

Commit

Permalink
vc: UT should set VCStorePrefix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bergwolf committed Dec 26, 2019
1 parent b9120b2 commit f56d70c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtcontainers/virtcontainers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f56d70c

Please sign in to comment.