Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
test: Modify block device test to test for SCSI as well
Browse files Browse the repository at this point in the history
Test for SCSI and block drivers while attaching
block device.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
  • Loading branch information
amshinde committed Feb 22, 2018
1 parent a1a569a commit 07c2c88
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,19 @@ func TestAttachBlockDevice(t *testing.T) {
fs := &filesystem{}
hypervisor := &mockHypervisor{}

hConfig := HypervisorConfig{
BlockDeviceDriver: VirtioBlock,
}

config := &PodConfig{
HypervisorConfig: hConfig,
}

pod := &Pod{
id: testPodID,
storage: fs,
hypervisor: hypervisor,
config: config,
}

contID := "100"
Expand Down Expand Up @@ -376,4 +385,18 @@ func TestAttachBlockDevice(t *testing.T) {

err = device.detach(hypervisor)
assert.Nil(t, err)

container.pod.config.HypervisorConfig.BlockDeviceDriver = VirtioSCSI
err = device.attach(hypervisor, &container)
assert.Nil(t, err)

err = device.detach(hypervisor)
assert.Nil(t, err)

container.state.State = StateReady
err = device.attach(hypervisor, &container)
assert.Nil(t, err)

err = device.detach(hypervisor)
assert.Nil(t, err)
}

0 comments on commit 07c2c88

Please sign in to comment.