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

Commit

Permalink
persist: fix test
Browse files Browse the repository at this point in the history
Fix failing unit test

Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
WeiZhang555 committed Jan 7, 2019
1 parent 5717ac3 commit e58557b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions virtcontainers/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/kata-containers/runtime/virtcontainers/device/config"
"github.com/kata-containers/runtime/virtcontainers/device/drivers"
"github.com/kata-containers/runtime/virtcontainers/device/manager"
"github.com/kata-containers/runtime/virtcontainers/persist"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -225,6 +226,10 @@ func TestContainerAddDriveDir(t *testing.T) {
},
}

if sandbox.store = persist.GetDriver("fs"); sandbox.store == nil {
t.Fatalf("failed to get fs persist driver")
}

contID := "100"
container := Container{
sandbox: sandbox,
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (device *BlockDevice) GetDeviceInfo() interface{} {
return device.BlockDrive
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *BlockDevice) Dump() persistapi.DeviceState {
ds := device.GenericDevice.Dump()
ds.Type = string(device.DeviceType())
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (device *GenericDevice) bumpAttachCount(attach bool) (skip bool, err error)
}
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *GenericDevice) Dump() persistapi.DeviceState {
info := device.DeviceInfo
return persistapi.DeviceState{
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/vfio.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (device *VFIODevice) GetDeviceInfo() interface{} {
return device.VfioDevs
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *VFIODevice) Dump() persistapi.DeviceState {
ds := device.GenericDevice.Dump()
ds.Type = string(device.DeviceType())
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/vhost_user_blk.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (device *VhostUserBlkDevice) GetDeviceInfo() interface{} {
return &device.VhostUserDeviceAttrs
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *VhostUserBlkDevice) Dump() persistapi.DeviceState {
ds := device.GenericDevice.Dump()
ds.Type = string(device.DeviceType())
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/vhost_user_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (device *VhostUserNetDevice) GetDeviceInfo() interface{} {
return &device.VhostUserDeviceAttrs
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *VhostUserNetDevice) Dump() persistapi.DeviceState {
ds := device.GenericDevice.Dump()
ds.Type = string(device.DeviceType())
Expand Down
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/vhost_user_scsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (device *VhostUserSCSIDevice) GetDeviceInfo() interface{} {
return &device.VhostUserDeviceAttrs
}

// Persist convert and return data in persist format
// Dump convert and return data in persist format
func (device *VhostUserSCSIDevice) Dump() persistapi.DeviceState {
ds := device.GenericDevice.Dump()
ds.Type = string(device.DeviceType())
Expand Down

0 comments on commit e58557b

Please sign in to comment.