Documentation ¶
Index ¶
Constants ¶
const ( UdevEventAdd = "add" UdevEventRemove = "remove" )
UDEV events available in the system
Variables ¶
This section is empty.
Functions ¶
func TriggerEvent ¶
TriggerEvent triggers a udev event for the device with syspath. The event is generated by writing the event action into syspath/devicename/uevent file. This write will cause UDEV to trigger the corresponding event. It is same as using `udevadm trigger`
Types ¶
type Disk ¶
type Disk struct { // Size in bytes Size int64 // the disk name // eg: /dev/loop9002 Name string // contains filtered or unexported fields }
Disk has the attributes of a virtual disk which is emulated for integration testing.
func NewDisk ¶
NewDisk creates a Disk struct, with a specified size. Also the random disk image name is generated. The actual image is generated only when we try to attach the disk
func (*Disk) AttachDisk ¶
AttachDisk triggers a udev add event for the disk. If the disk is not present, the loop device is created and event is triggered
func (*Disk) DetachAndDeleteDisk ¶
DetachAndDeleteDisk triggers a udev remove event. It detaches the loop device from the backing image. Also deletes the backing image and block device file in /dev
func (*Disk) DetachDisk ¶
DetachDisk triggers a udev remove event for the disk