mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
lint: Rename vcMock to vcmock
As recommended by `golint`, renamed the `vcMock` package to `vcmock`. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
b1628639e8
commit
ce37ac146d
@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@ -301,9 +301,9 @@ func TestCreateCLIFunctionCreateFail(t *testing.T) {
|
|||||||
func TestCreateInvalidArgs(t *testing.T) {
|
func TestCreateInvalidArgs(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
@ -401,7 +401,7 @@ func TestCreateInvalidConfigJSON(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +448,7 @@ func TestCreateInvalidContainerType(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,16 +496,16 @@ func TestCreateContainerInvalid(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateProcessCgroupsPathSuccessful(t *testing.T) {
|
func TestCreateProcessCgroupsPathSuccessful(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -598,9 +598,9 @@ func TestCreateCreateCgroupsFilesFail(t *testing.T) {
|
|||||||
|
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -671,7 +671,7 @@ func TestCreateCreateCgroupsFilesFail(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,9 +683,9 @@ func TestCreateCreateCreatePidFileFail(t *testing.T) {
|
|||||||
|
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -747,16 +747,16 @@ func TestCreateCreateCreatePidFileFail(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -873,7 +873,7 @@ func TestCreateInvalidKernelParams(t *testing.T) {
|
|||||||
for detach := range []bool{true, false} {
|
for detach := range []bool{true, false} {
|
||||||
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
|
||||||
assert.Errorf(err, "%+v", detach)
|
assert.Errorf(err, "%+v", detach)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -921,7 +921,7 @@ func TestCreateCreatePodPodConfigFail(t *testing.T) {
|
|||||||
|
|
||||||
_, err = createPod(spec, runtimeConfig, testContainerID, bundlePath, testConsole, true)
|
_, err = createPod(spec, runtimeConfig, testContainerID, bundlePath, testConsole, true)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateCreatePodFail(t *testing.T) {
|
func TestCreateCreatePodFail(t *testing.T) {
|
||||||
@ -956,7 +956,7 @@ func TestCreateCreatePodFail(t *testing.T) {
|
|||||||
|
|
||||||
_, err = createPod(spec, runtimeConfig, testContainerID, bundlePath, testConsole, true)
|
_, err = createPod(spec, runtimeConfig, testContainerID, bundlePath, testConsole, true)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateCreateContainerContainerConfigFail(t *testing.T) {
|
func TestCreateCreateContainerContainerConfigFail(t *testing.T) {
|
||||||
@ -998,7 +998,7 @@ func TestCreateCreateContainerContainerConfigFail(t *testing.T) {
|
|||||||
for _, disableOutput := range []bool{true, false} {
|
for _, disableOutput := range []bool{true, false} {
|
||||||
_, err = createContainer(spec, testContainerID, bundlePath, testConsole, disableOutput)
|
_, err = createContainer(spec, testContainerID, bundlePath, testConsole, disableOutput)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
assert.True(strings.Contains(err.Error(), containerType))
|
assert.True(strings.Contains(err.Error(), containerType))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1042,7 +1042,7 @@ func TestCreateCreateContainerFail(t *testing.T) {
|
|||||||
for _, disableOutput := range []bool{true, false} {
|
for _, disableOutput := range []bool{true, false} {
|
||||||
_, err = createContainer(spec, testContainerID, bundlePath, testConsole, disableOutput)
|
_, err = createContainer(spec, testContainerID, bundlePath, testConsole, disableOutput)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1055,7 +1055,7 @@ func TestCreateCreateContainer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testingImpl.CreateContainerFunc = func(podID string, containerConfig vc.ContainerConfig) (vc.VCPod, vc.VCContainer, error) {
|
testingImpl.CreateContainerFunc = func(podID string, containerConfig vc.ContainerConfig) (vc.VCPod, vc.VCContainer, error) {
|
||||||
return &vcMock.Pod{}, &vcMock.Container{}, nil
|
return &vcmock.Pod{}, &vcmock.Container{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -61,12 +61,12 @@ func TestDeleteInvalidContainer(t *testing.T) {
|
|||||||
// Missing container id
|
// Missing container id
|
||||||
err := delete("", false)
|
err := delete("", false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// Mock Listpod error
|
// Mock Listpod error
|
||||||
err = delete(testContainerID, false)
|
err = delete(testContainerID, false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.ListPodFunc = func() ([]vc.PodStatus, error) {
|
testingImpl.ListPodFunc = func() ([]vc.PodStatus, error) {
|
||||||
return []vc.PodStatus{}, nil
|
return []vc.PodStatus{}, nil
|
||||||
@ -79,13 +79,13 @@ func TestDeleteInvalidContainer(t *testing.T) {
|
|||||||
// Container missing in ListPod
|
// Container missing in ListPod
|
||||||
err = delete(testContainerID, false)
|
err = delete(testContainerID, false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDeleteMissingContainerTypeAnnotation(t *testing.T) {
|
func TestDeleteMissingContainerTypeAnnotation(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,13 +109,13 @@ func TestDeleteMissingContainerTypeAnnotation(t *testing.T) {
|
|||||||
|
|
||||||
err := delete(pod.ID(), false)
|
err := delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDeleteInvalidConfig(t *testing.T) {
|
func TestDeleteInvalidConfig(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ func TestDeleteInvalidConfig(t *testing.T) {
|
|||||||
|
|
||||||
err := delete(pod.ID(), false)
|
err := delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func testConfigSetup(t *testing.T) string {
|
func testConfigSetup(t *testing.T) string {
|
||||||
@ -165,7 +165,7 @@ func testConfigSetup(t *testing.T) string {
|
|||||||
func TestDeletePod(t *testing.T) {
|
func TestDeletePod(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ func TestDeletePod(t *testing.T) {
|
|||||||
|
|
||||||
err = delete(pod.ID(), false)
|
err = delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StopPodFunc = func(podID string) (vc.VCPod, error) {
|
testingImpl.StopPodFunc = func(podID string) (vc.VCPod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
@ -211,7 +211,7 @@ func TestDeletePod(t *testing.T) {
|
|||||||
|
|
||||||
err = delete(pod.ID(), false)
|
err = delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.DeletePodFunc = func(podID string) (vc.VCPod, error) {
|
testingImpl.DeletePodFunc = func(podID string) (vc.VCPod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
@ -228,7 +228,7 @@ func TestDeletePod(t *testing.T) {
|
|||||||
func TestDeleteInvalidContainerType(t *testing.T) {
|
func TestDeleteInvalidContainerType(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,13 +263,13 @@ func TestDeleteInvalidContainerType(t *testing.T) {
|
|||||||
// Delete an invalid container type
|
// Delete an invalid container type
|
||||||
err = delete(pod.ID(), false)
|
err = delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDeletePodRunning(t *testing.T) {
|
func TestDeletePodRunning(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ func TestDeletePodRunning(t *testing.T) {
|
|||||||
// Delete on a running pod should fail
|
// Delete on a running pod should fail
|
||||||
err = delete(pod.ID(), false)
|
err = delete(pod.ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StopPodFunc = func(podID string) (vc.VCPod, error) {
|
testingImpl.StopPodFunc = func(podID string) (vc.VCPod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
@ -317,7 +317,7 @@ func TestDeletePodRunning(t *testing.T) {
|
|||||||
// Force delete a running pod
|
// Force delete a running pod
|
||||||
err = delete(pod.ID(), true)
|
err = delete(pod.ID(), true)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.DeletePodFunc = func(podID string) (vc.VCPod, error) {
|
testingImpl.DeletePodFunc = func(podID string) (vc.VCPod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
@ -334,11 +334,11 @@ func TestDeletePodRunning(t *testing.T) {
|
|||||||
func TestDeleteRunningContainer(t *testing.T) {
|
func TestDeleteRunningContainer(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -376,12 +376,12 @@ func TestDeleteRunningContainer(t *testing.T) {
|
|||||||
// Delete on a running container should fail.
|
// Delete on a running container should fail.
|
||||||
err = delete(pod.MockContainers[0].ID(), false)
|
err = delete(pod.MockContainers[0].ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// force delete
|
// force delete
|
||||||
err = delete(pod.MockContainers[0].ID(), true)
|
err = delete(pod.MockContainers[0].ID(), true)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StopContainerFunc = testStopContainerFuncReturnNil
|
testingImpl.StopContainerFunc = testStopContainerFuncReturnNil
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -390,10 +390,10 @@ func TestDeleteRunningContainer(t *testing.T) {
|
|||||||
|
|
||||||
err = delete(pod.MockContainers[0].ID(), true)
|
err = delete(pod.MockContainers[0].ID(), true)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.DeleteContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
testingImpl.DeleteContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
||||||
return &vcMock.Container{}, nil
|
return &vcmock.Container{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -407,11 +407,11 @@ func TestDeleteRunningContainer(t *testing.T) {
|
|||||||
func TestDeleteContainer(t *testing.T) {
|
func TestDeleteContainer(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -448,7 +448,7 @@ func TestDeleteContainer(t *testing.T) {
|
|||||||
|
|
||||||
err = delete(pod.MockContainers[0].ID(), false)
|
err = delete(pod.MockContainers[0].ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StopContainerFunc = testStopContainerFuncReturnNil
|
testingImpl.StopContainerFunc = testStopContainerFuncReturnNil
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -457,10 +457,10 @@ func TestDeleteContainer(t *testing.T) {
|
|||||||
|
|
||||||
err = delete(pod.MockContainers[0].ID(), false)
|
err = delete(pod.MockContainers[0].ID(), false)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.DeleteContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
testingImpl.DeleteContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
||||||
return &vcMock.Container{}, nil
|
return &vcmock.Container{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -485,7 +485,7 @@ func TestDeleteCLIFunction(t *testing.T) {
|
|||||||
// no container id in the Metadata
|
// no container id in the Metadata
|
||||||
err := fn(ctx)
|
err := fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
||||||
flagSet.Parse([]string{"xyz"})
|
flagSet.Parse([]string{"xyz"})
|
||||||
@ -493,17 +493,17 @@ func TestDeleteCLIFunction(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDeleteCLIFunctionSuccess(t *testing.T) {
|
func TestDeleteCLIFunctionSuccess(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -558,7 +558,7 @@ func TestDeleteCLIFunctionSuccess(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
||||||
flagSet.Parse([]string{pod.ID()})
|
flagSet.Parse([]string{pod.ID()})
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -43,7 +43,7 @@ func TestExecCLIFunction(t *testing.T) {
|
|||||||
// no container-id in the Metadata
|
// no container-id in the Metadata
|
||||||
err := fn(ctx)
|
err := fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// pass container-id
|
// pass container-id
|
||||||
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
||||||
@ -52,7 +52,7 @@ func TestExecCLIFunction(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExecuteErrors(t *testing.T) {
|
func TestExecuteErrors(t *testing.T) {
|
||||||
@ -64,13 +64,13 @@ func TestExecuteErrors(t *testing.T) {
|
|||||||
// missing container id
|
// missing container id
|
||||||
err := execute(ctx)
|
err := execute(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// ListPod error
|
// ListPod error
|
||||||
flagSet.Parse([]string{testContainerID})
|
flagSet.Parse([]string{testContainerID})
|
||||||
err = execute(ctx)
|
err = execute(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// Config path missing in annotations
|
// Config path missing in annotations
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
@ -87,7 +87,7 @@ func TestExecuteErrors(t *testing.T) {
|
|||||||
|
|
||||||
err = execute(ctx)
|
err = execute(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// Container not running
|
// Container not running
|
||||||
configPath := testConfigSetup(t)
|
configPath := testConfigSetup(t)
|
||||||
@ -109,7 +109,7 @@ func TestExecuteErrors(t *testing.T) {
|
|||||||
|
|
||||||
err = execute(ctx)
|
err = execute(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExecuteErrorReadingProcessJson(t *testing.T) {
|
func TestExecuteErrorReadingProcessJson(t *testing.T) {
|
||||||
@ -154,7 +154,7 @@ func TestExecuteErrorReadingProcessJson(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExecuteErrorOpeningConsole(t *testing.T) {
|
func TestExecuteErrorOpeningConsole(t *testing.T) {
|
||||||
@ -198,7 +198,7 @@ func TestExecuteErrorOpeningConsole(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func testExecParamsSetup(t *testing.T, pidFilePath, consolePath string, detach bool) *flag.FlagSet {
|
func testExecParamsSetup(t *testing.T, pidFilePath, consolePath string, detach bool) *flag.FlagSet {
|
||||||
@ -260,10 +260,10 @@ func TestExecuteWithFlags(t *testing.T) {
|
|||||||
// EnterContainer error
|
// EnterContainer error
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.EnterContainerFunc = func(podID, containerID string, cmd vc.Cmd) (vc.VCPod, vc.VCContainer, *vc.Process, error) {
|
testingImpl.EnterContainerFunc = func(podID, containerID string, cmd vc.Cmd) (vc.VCPod, vc.VCContainer, *vc.Process, error) {
|
||||||
return &vcMock.Pod{}, &vcMock.Container{}, &vc.Process{}, nil
|
return &vcmock.Pod{}, &vcmock.Container{}, &vc.Process{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -274,7 +274,7 @@ func TestExecuteWithFlags(t *testing.T) {
|
|||||||
// Process not running error
|
// Process not running error
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
os.Remove(pidFilePath)
|
os.Remove(pidFilePath)
|
||||||
|
|
||||||
@ -288,7 +288,7 @@ func TestExecuteWithFlags(t *testing.T) {
|
|||||||
|
|
||||||
vcProcess := vc.Process{}
|
vcProcess := vc.Process{}
|
||||||
vcProcess.Pid = command.Process.Pid
|
vcProcess.Pid = command.Process.Pid
|
||||||
return &vcMock.Pod{}, &vcMock.Container{}, &vcProcess, nil
|
return &vcmock.Pod{}, &vcmock.Container{}, &vcProcess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -347,7 +347,7 @@ func TestExecuteWithFlagsDetached(t *testing.T) {
|
|||||||
|
|
||||||
vcProcess := vc.Process{}
|
vcProcess := vc.Process{}
|
||||||
vcProcess.Pid = command.Process.Pid
|
vcProcess.Pid = command.Process.Pid
|
||||||
return &vcMock.Pod{}, &vcMock.Container{}, &vcProcess, nil
|
return &vcmock.Pod{}, &vcmock.Container{}, &vcProcess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -417,7 +417,7 @@ func TestExecuteWithInvalidProcessJson(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExecuteWithValidProcessJson(t *testing.T) {
|
func TestExecuteWithValidProcessJson(t *testing.T) {
|
||||||
@ -499,7 +499,7 @@ func TestExecuteWithValidProcessJson(t *testing.T) {
|
|||||||
vcProcess := vc.Process{}
|
vcProcess := vc.Process{}
|
||||||
vcProcess.Pid = command.Process.Pid
|
vcProcess.Pid = command.Process.Pid
|
||||||
|
|
||||||
return &vcMock.Pod{}, &vcMock.Container{}, &vcProcess, nil
|
return &vcmock.Pod{}, &vcmock.Container{}, &vcProcess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -572,7 +572,7 @@ func TestExecuteWithInvalidEnvironment(t *testing.T) {
|
|||||||
// vcAnnotations.EnvVars error due to incorrect environment
|
// vcAnnotations.EnvVars error due to incorrect environment
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGenerateExecParams(t *testing.T) {
|
func TestGenerateExecParams(t *testing.T) {
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
testStopContainerFuncReturnNil = func(podID, containerID string) (vc.VCContainer, error) {
|
testStopContainerFuncReturnNil = func(podID, containerID string) (vc.VCContainer, error) {
|
||||||
return &vcMock.Container{}, nil
|
return &vcmock.Container{}, nil
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -395,7 +395,7 @@ func TestListGetContainersListPodFail(t *testing.T) {
|
|||||||
|
|
||||||
_, err = getContainers(ctx)
|
_, err = getContainers(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestListGetContainers(t *testing.T) {
|
func TestListGetContainers(t *testing.T) {
|
||||||
@ -433,7 +433,7 @@ func TestListGetContainers(t *testing.T) {
|
|||||||
func TestListGetContainersPodWithoutContainers(t *testing.T) {
|
func TestListGetContainersPodWithoutContainers(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ func TestListGetContainersPodWithContainer(t *testing.T) {
|
|||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
defer os.RemoveAll(tmpdir)
|
defer os.RemoveAll(tmpdir)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ func TestListCLIFunctionFormatFail(t *testing.T) {
|
|||||||
{"invalid", invalidFlags},
|
{"invalid", invalidFlags},
|
||||||
}
|
}
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +621,7 @@ func TestListCLIFunctionFormatFail(t *testing.T) {
|
|||||||
|
|
||||||
// invalid output file
|
// invalid output file
|
||||||
assert.Error(err, d)
|
assert.Error(err, d)
|
||||||
assert.False(vcMock.IsMockError(err), d)
|
assert.False(vcmock.IsMockError(err), d)
|
||||||
|
|
||||||
output := filepath.Join(tmpdir, "output")
|
output := filepath.Join(tmpdir, "output")
|
||||||
f, err := os.OpenFile(output, os.O_WRONLY|os.O_CREATE, testFileMode)
|
f, err := os.OpenFile(output, os.O_WRONLY|os.O_CREATE, testFileMode)
|
||||||
@ -634,7 +634,7 @@ func TestListCLIFunctionFormatFail(t *testing.T) {
|
|||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
if d.format == "invalid" {
|
if d.format == "invalid" {
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err), d)
|
assert.False(vcmock.IsMockError(err), d)
|
||||||
} else {
|
} else {
|
||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
}
|
}
|
||||||
@ -651,7 +651,7 @@ func TestListCLIFunctionQuiet(t *testing.T) {
|
|||||||
runtimeConfig, err := newTestRuntimeConfig(tmpdir, testConsole, true)
|
runtimeConfig, err := newTestRuntimeConfig(tmpdir, testConsole, true)
|
||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import (
|
|||||||
"github.com/dlespiau/covertool/pkg/cover"
|
"github.com/dlespiau/covertool/pkg/cover"
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@ -62,7 +62,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// testingImpl is a concrete mock RVC implementation used for testing
|
// testingImpl is a concrete mock RVC implementation used for testing
|
||||||
var testingImpl = &vcMock.VCMock{}
|
var testingImpl = &vcmock.VCMock{}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if version == "" {
|
if version == "" {
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/opencontainers/runc/libcontainer/utils"
|
"github.com/opencontainers/runc/libcontainer/utils"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -83,7 +83,7 @@ func TestGetContainerInfoContainerIDEmptyFailure(t *testing.T) {
|
|||||||
func TestGetContainerInfo(t *testing.T) {
|
func TestGetContainerInfo(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ func TestGetContainerInfo(t *testing.T) {
|
|||||||
func TestGetContainerInfoMismatch(t *testing.T) {
|
func TestGetContainerInfoMismatch(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ func TestValidCreateParamsContainerIDEmptyFailure(t *testing.T) {
|
|||||||
_, err := validCreateParams("", "")
|
_, err := validCreateParams("", "")
|
||||||
|
|
||||||
assert.Error(err, "This test should fail because containerID is empty")
|
assert.Error(err, "This test should fail because containerID is empty")
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetExistingContainerInfoContainerIDEmptyFailure(t *testing.T) {
|
func TestGetExistingContainerInfoContainerIDEmptyFailure(t *testing.T) {
|
||||||
@ -170,7 +170,7 @@ func TestValidCreateParamsContainerIDNotUnique(t *testing.T) {
|
|||||||
|
|
||||||
containerID := testContainerID + testContainerID
|
containerID := testContainerID + testContainerID
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ func TestValidCreateParamsContainerIDNotUnique(t *testing.T) {
|
|||||||
_, err := validCreateParams(testContainerID, "")
|
_, err := validCreateParams(testContainerID, "")
|
||||||
|
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidCreateParamsContainerIDNotUnique2(t *testing.T) {
|
func TestValidCreateParamsContainerIDNotUnique2(t *testing.T) {
|
||||||
@ -212,7 +212,7 @@ func TestValidCreateParamsContainerIDNotUnique2(t *testing.T) {
|
|||||||
|
|
||||||
containerID := testContainerID + testContainerID
|
containerID := testContainerID + testContainerID
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ func TestValidCreateParamsContainerIDNotUnique2(t *testing.T) {
|
|||||||
|
|
||||||
_, err := validCreateParams(testContainerID, "")
|
_, err := validCreateParams(testContainerID, "")
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidCreateParamsInvalidBundle(t *testing.T) {
|
func TestValidCreateParamsInvalidBundle(t *testing.T) {
|
||||||
@ -261,7 +261,7 @@ func TestValidCreateParamsInvalidBundle(t *testing.T) {
|
|||||||
_, err = validCreateParams(testContainerID, bundlePath)
|
_, err = validCreateParams(testContainerID, bundlePath)
|
||||||
// bundle is ENOENT
|
// bundle is ENOENT
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidCreateParamsBundleIsAFile(t *testing.T) {
|
func TestValidCreateParamsBundleIsAFile(t *testing.T) {
|
||||||
@ -286,7 +286,7 @@ func TestValidCreateParamsBundleIsAFile(t *testing.T) {
|
|||||||
_, err = validCreateParams(testContainerID, bundlePath)
|
_, err = validCreateParams(testContainerID, bundlePath)
|
||||||
// bundle exists as a file, not a directory
|
// bundle exists as a file, not a directory
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func testProcessCgroupsPath(t *testing.T, ociSpec oci.CompatOCISpec, expected []string) {
|
func testProcessCgroupsPath(t *testing.T, ociSpec oci.CompatOCISpec, expected []string) {
|
||||||
@ -565,7 +565,7 @@ func TestProcessCgroupsPathForResource(t *testing.T) {
|
|||||||
for _, isPod := range []bool{true, false} {
|
for _, isPod := range []bool{true, false} {
|
||||||
_, err := processCgroupsPathForResource(spec, "", isPod)
|
_, err := processCgroupsPathForResource(spec, "", isPod)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,17 +19,17 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
testPausePodFuncReturnNil = func(podID string) (vc.VCPod, error) {
|
testPausePodFuncReturnNil = func(podID string) (vc.VCPod, error) {
|
||||||
return &vcMock.Pod{}, nil
|
return &vcmock.Pod{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
testResumePodFuncReturnNil = func(podID string) (vc.VCPod, error) {
|
testResumePodFuncReturnNil = func(podID string) (vc.VCPod, error) {
|
||||||
return &vcMock.Pod{}, nil
|
return &vcmock.Pod{}, nil
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -45,11 +45,11 @@ func TestPSCLIAction(t *testing.T) {
|
|||||||
func TestPSFailure(t *testing.T) {
|
func TestPSFailure(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: pod.ID(),
|
MockID: pod.ID(),
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -89,11 +89,11 @@ func TestPSFailure(t *testing.T) {
|
|||||||
func TestPSSuccessful(t *testing.T) {
|
func TestPSSuccessful(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: pod.ID(),
|
MockID: pod.ID(),
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -67,9 +67,9 @@ func TestRunCliAction(t *testing.T) {
|
|||||||
func TestRunInvalidArgs(t *testing.T) {
|
func TestRunInvalidArgs(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
MockContainers: []*vcMock.Container{
|
MockContainers: []*vcmock.Container{
|
||||||
{MockID: testContainerID},
|
{MockID: testContainerID},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ type runContainerData struct {
|
|||||||
consolePath string
|
consolePath string
|
||||||
bundlePath string
|
bundlePath string
|
||||||
configJSON string
|
configJSON string
|
||||||
pod *vcMock.Pod
|
pod *vcmock.Pod
|
||||||
runtimeConfig oci.RuntimeConfig
|
runtimeConfig oci.RuntimeConfig
|
||||||
process *os.Process
|
process *os.Process
|
||||||
tmpDir string
|
tmpDir string
|
||||||
@ -196,11 +196,11 @@ func testRunContainerSetup(t *testing.T) runContainerData {
|
|||||||
configPath := filepath.Join(bundlePath, specConfig)
|
configPath := filepath.Join(bundlePath, specConfig)
|
||||||
|
|
||||||
// pod id and container id must be the same otherwise delete will not works
|
// pod id and container id must be the same otherwise delete will not works
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPid: cmd.Process.Pid,
|
MockPid: cmd.Process.Pid,
|
||||||
@ -599,11 +599,11 @@ func TestRunContainerStartFailNoContainers(t *testing.T) {
|
|||||||
d := testRunContainerSetup(t)
|
d := testRunContainerSetup(t)
|
||||||
defer os.RemoveAll(d.tmpDir)
|
defer os.RemoveAll(d.tmpDir)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -651,5 +651,5 @@ func TestRunContainerStartFailNoContainers(t *testing.T) {
|
|||||||
|
|
||||||
err := run(d.pod.ID(), d.bundlePath, d.consolePath, "", d.pidFilePath, false, d.runtimeConfig)
|
err := run(d.pod.ID(), d.bundlePath, d.consolePath, "", d.pidFilePath, false, d.runtimeConfig)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -31,12 +31,12 @@ func TestStartInvalidArgs(t *testing.T) {
|
|||||||
// Missing container id
|
// Missing container id
|
||||||
_, err := start("")
|
_, err := start("")
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
// Mock Listpod error
|
// Mock Listpod error
|
||||||
_, err = start(testContainerID)
|
_, err = start(testContainerID)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.ListPodFunc = func() ([]vc.PodStatus, error) {
|
testingImpl.ListPodFunc = func() ([]vc.PodStatus, error) {
|
||||||
return []vc.PodStatus{}, nil
|
return []vc.PodStatus{}, nil
|
||||||
@ -49,13 +49,13 @@ func TestStartInvalidArgs(t *testing.T) {
|
|||||||
// Container missing in ListPod
|
// Container missing in ListPod
|
||||||
_, err = start(testContainerID)
|
_, err = start(testContainerID)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStartPod(t *testing.T) {
|
func TestStartPod(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ func TestStartPod(t *testing.T) {
|
|||||||
|
|
||||||
_, err := start(pod.ID())
|
_, err := start(pod.ID())
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StartPodFunc = func(podID string) (vc.VCPod, error) {
|
testingImpl.StartPodFunc = func(podID string) (vc.VCPod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
@ -98,7 +98,7 @@ func TestStartPod(t *testing.T) {
|
|||||||
func TestStartMissingAnnotation(t *testing.T) {
|
func TestStartMissingAnnotation(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,17 +122,17 @@ func TestStartMissingAnnotation(t *testing.T) {
|
|||||||
|
|
||||||
_, err := start(pod.ID())
|
_, err := start(pod.ID())
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStartContainerSucessFailure(t *testing.T) {
|
func TestStartContainerSucessFailure(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
@ -161,7 +161,7 @@ func TestStartContainerSucessFailure(t *testing.T) {
|
|||||||
|
|
||||||
_, err := start(testContainerID)
|
_, err := start(testContainerID)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
|
|
||||||
testingImpl.StartContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
testingImpl.StartContainerFunc = func(podID, containerID string) (vc.VCContainer, error) {
|
||||||
return pod.MockContainers[0], nil
|
return pod.MockContainers[0], nil
|
||||||
@ -189,7 +189,7 @@ func TestStartCLIFunction(t *testing.T) {
|
|||||||
// no container id in the Metadata
|
// no container id in the Metadata
|
||||||
err := fn(ctx)
|
err := fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.False(vcMock.IsMockError(err))
|
assert.False(vcmock.IsMockError(err))
|
||||||
|
|
||||||
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
flagSet = flag.NewFlagSet("container-id", flag.ContinueOnError)
|
||||||
flagSet.Parse([]string{"xyz"})
|
flagSet.Parse([]string{"xyz"})
|
||||||
@ -197,17 +197,17 @@ func TestStartCLIFunction(t *testing.T) {
|
|||||||
|
|
||||||
err = fn(ctx)
|
err = fn(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
assert.True(vcMock.IsMockError(err))
|
assert.True(vcmock.IsMockError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStartCLIFunctionSuccess(t *testing.T) {
|
func TestStartCLIFunctionSuccess(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testPodID,
|
MockID: testPodID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/vcMock"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/vcmock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -49,11 +49,11 @@ func TestStateCliAction(t *testing.T) {
|
|||||||
func TestStateSuccessful(t *testing.T) {
|
func TestStateSuccessful(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
pod := &vcMock.Pod{
|
pod := &vcmock.Pod{
|
||||||
MockID: testContainerID,
|
MockID: testContainerID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pod.MockContainers = []*vcMock.Container{
|
pod.MockContainers = []*vcmock.Container{
|
||||||
{
|
{
|
||||||
MockID: pod.ID(),
|
MockID: pod.ID(),
|
||||||
MockPod: pod,
|
MockPod: pod,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
@ -22,7 +22,7 @@
|
|||||||
// well-known format. Callers can detect this scenario by calling
|
// well-known format. Callers can detect this scenario by calling
|
||||||
// IsMockError().
|
// IsMockError().
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -34,7 +34,7 @@ import (
|
|||||||
|
|
||||||
// mockErrorPrefix is a string that all errors returned by the mock
|
// mockErrorPrefix is a string that all errors returned by the mock
|
||||||
// implementation itself will contain as a prefix.
|
// implementation itself will contain as a prefix.
|
||||||
const mockErrorPrefix = "vcMock forced failure"
|
const mockErrorPrefix = "vcmock forced failure"
|
||||||
|
|
||||||
// SetLogger implements the VC function of the same name.
|
// SetLogger implements the VC function of the same name.
|
||||||
func (m *VCMock) SetLogger(logger logrus.FieldLogger) {
|
func (m *VCMock) SetLogger(logger logrus.FieldLogger) {
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
vc "github.com/kata-containers/runtime/virtcontainers"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
"syscall"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package vcMock
|
package vcmock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
Loading…
Reference in New Issue
Block a user