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

Commit

Permalink
persist: remove VCStore from container
Browse files Browse the repository at this point in the history
Remove VCStore from container struct.

Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
WeiZhang555 committed Dec 30, 2019
1 parent 633748a commit 29b55ab
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 354 deletions.
42 changes: 21 additions & 21 deletions virtcontainers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestCreateSandboxNoopAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)
}
Expand Down Expand Up @@ -176,7 +176,7 @@ func TestCreateSandboxKataAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)
}
Expand All @@ -203,7 +203,7 @@ func TestDeleteSandboxNoopAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -248,7 +248,7 @@ func TestDeleteSandboxKataAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand All @@ -264,7 +264,7 @@ func TestDeleteSandboxFailing(t *testing.T) {
defer cleanUp()
assert := assert.New(t)

sandboxDir := store.SandboxConfigurationRootPath(testSandboxID)
sandboxDir := store.SandboxRuntimeRootPath(testSandboxID)
os.Remove(sandboxDir)

p, err := DeleteSandbox(context.Background(), testSandboxID)
Expand Down Expand Up @@ -328,7 +328,7 @@ func TestStartSandboxFailing(t *testing.T) {
defer cleanUp()
assert := assert.New(t)

sandboxDir := store.SandboxConfigurationRootPath(testSandboxID)
sandboxDir := store.SandboxRuntimeRootPath(testSandboxID)
os.Remove(sandboxDir)

p, err := StartSandbox(context.Background(), testSandboxID)
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestStopSandboxKataAgentSuccessful(t *testing.T) {
func TestStopSandboxFailing(t *testing.T) {
defer cleanUp()

sandboxDir := store.SandboxConfigurationRootPath(testSandboxID)
sandboxDir := store.SandboxRuntimeRootPath(testSandboxID)
os.Remove(sandboxDir)

p, err := StopSandbox(context.Background(), testSandboxID, false)
Expand All @@ -413,7 +413,7 @@ func TestRunSandboxNoopAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)
}
Expand Down Expand Up @@ -451,7 +451,7 @@ func TestRunSandboxKataAgentSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -680,7 +680,7 @@ func TestCreateContainerSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -734,7 +734,7 @@ func TestDeleteContainerSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -778,7 +778,7 @@ func TestDeleteContainerFailingNoContainer(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -835,7 +835,7 @@ func TestStartContainerFailingNoContainer(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand All @@ -856,7 +856,7 @@ func TestStartContainerFailingSandboxNotStarted(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -936,7 +936,7 @@ func TestStopContainerFailingNoContainer(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -1040,7 +1040,7 @@ func TestEnterContainerFailingNoContainer(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -1093,7 +1093,7 @@ func TestStatusContainerSuccessful(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -1136,7 +1136,7 @@ func TestStatusContainerStateReady(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -1199,7 +1199,7 @@ func TestStatusContainerStateRunning(t *testing.T) {
assert.NoError(err)
assert.NotNil(p)

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())
_, err = os.Stat(sandboxDir)
assert.NoError(err)

Expand Down Expand Up @@ -1414,7 +1414,7 @@ func createAndStartSandbox(ctx context.Context, config SandboxConfig) (sandbox V
return nil, "", err
}

sandboxDir = store.SandboxConfigurationRootPath(sandbox.ID())
sandboxDir = store.SandboxRuntimeRootPath(sandbox.ID())
_, err = os.Stat(sandboxDir)
if err != nil {
return nil, "", err
Expand Down Expand Up @@ -1699,7 +1699,7 @@ func TestCleanupContainer(t *testing.T) {
CleanupContainer(ctx, p.ID(), c.ID(), true)
}

sandboxDir := store.SandboxConfigurationRootPath(p.ID())
sandboxDir := store.SandboxRuntimeRootPath(p.ID())

_, err = os.Stat(sandboxDir)
if err == nil {
Expand Down
Loading

0 comments on commit 29b55ab

Please sign in to comment.