mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
test: fix unit test nil pointer.
Add filesystem to qemu object. Fix mock_hypervisor Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
4697cf3c79
commit
1f5792ecbb
@ -64,6 +64,9 @@ func (m *mockHypervisor) hotplugAddDevice(devInfo interface{}, devType deviceTyp
|
||||
switch devType {
|
||||
case cpuDev:
|
||||
return m.vCPUs, nil
|
||||
case memoryDev:
|
||||
memdev := devInfo.(*memoryDevice)
|
||||
return memdev.sizeMB, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -348,8 +348,10 @@ func TestHotplugRemoveMemory(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
qemuConfig := newQemuConfig()
|
||||
fs := &filesystem{}
|
||||
q := &qemu{
|
||||
config: qemuConfig,
|
||||
storage: fs,
|
||||
}
|
||||
|
||||
_, err := q.hotplugRemoveDevice(&memoryDevice{0, 128}, memoryDev)
|
||||
@ -360,8 +362,10 @@ func TestHotplugUnsupportedDeviceType(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
qemuConfig := newQemuConfig()
|
||||
fs := &filesystem{}
|
||||
q := &qemu{
|
||||
config: qemuConfig,
|
||||
storage: fs,
|
||||
}
|
||||
|
||||
_, err := q.hotplugAddDevice(&memoryDevice{0, 128}, fsDev)
|
||||
|
Loading…
Reference in New Issue
Block a user