Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatOpt ¶
type FeatOpt func(*featCfg)
FeatOpt is used to configure failure feature.
func WithIntervalFeatOpt ¶
WithIntervalFeatOpt updates the up time for the feature.
func WithSyncFSFeatOpt ¶
WithSyncFSFeatOpt is to determine if the caller wants to synchronize filesystem before inject failure.
type Flakey ¶
type Flakey interface { // DevicePath returns the flakey device path. DevicePath() string // Filesystem returns filesystem's type. Filesystem() FSType // AllowWrites allows write I/O. AllowWrites(opts ...FeatOpt) error // DropWrites drops all write I/O silently. DropWrites(opts ...FeatOpt) error // ErrorWrites drops all write I/O and returns error. ErrorWrites(opts ...FeatOpt) error // Teardown releases the flakey device. Teardown() error }
Flakey is to inject failure into device.
func InitFlakey ¶
func InitFlakey(flakeyDevice, dataStorePath string, fsType FSType, mkfsOpt string) (_ Flakey, retErr error)
InitFlakey creates an filesystem on a loopback device and returns Flakey on it.
The device-mapper device will be /dev/mapper/$flakeyDevice. And the filesystem image will be created at $dataStorePath/$flakeyDevice.img. By default, the device is available for 2 minutes and size is 10 GiB.
Click to show internal directories.
Click to hide internal directories.