dependencies

package
v0.0.0-...-c98baff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDependencyCustomResolver

func NewDependencyCustomResolver(lookupIP func(string) ([]net.IP, error)) modules.Dependencies

NewDependencyCustomResolver creates a dependency from a given lookupIP method which returns a custom resolver that uses the specified lookupIP method to resolve hostnames.

func NewHostMaxEphemeralAccountRiskReached

func NewHostMaxEphemeralAccountRiskReached(duration time.Duration) modules.Dependencies

NewHostMaxEphemeralAccountRiskReached is a dependency injection for the host that will ensure the ephemeral account max saved delta is reached by persisting with a set latency.

Types

type DependencyAddLatency

type DependencyAddLatency struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyAddLatency will introduce a latency by sleeping for the specified duration if the argument passed to Distrupt equals str.

func (*DependencyAddLatency) Disrupt

func (d *DependencyAddLatency) Disrupt(s string) bool

Disrupt will sleep for the specified duration if the correct string is provided.

type DependencyBlockScan

type DependencyBlockScan struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyBlockScan blocks the scan progress of the hostdb until Scan is called on the dependency.

func (*DependencyBlockScan) Disrupt

func (d *DependencyBlockScan) Disrupt(s string) bool

Disrupt will block the scan progress of the hostdb. The scan can be started by calling Scan on the dependency.

func (*DependencyBlockScan) Scan

func (d *DependencyBlockScan) Scan()

Scan resumes the blocked scan.

type DependencyDisableAsyncStartup

type DependencyDisableAsyncStartup struct {
	modules.ProductionDependencies
}

DependencyDisableAsyncStartup prevents the async part of a module's creation from being executed.

func (*DependencyDisableAsyncStartup) Disrupt

Disrupt returns true if the correct string is provided.

type DependencyDisableAsyncUnlock

type DependencyDisableAsyncUnlock struct {
	modules.ProductionDependencies
}

DependencyDisableAsyncUnlock will prevent the wallet to catch up to consensus after unlocking it.

func (*DependencyDisableAsyncUnlock) Disrupt

Disrupt will prevent the wallet to catch up to consensus after unlocking it.

type DependencyDisableAutoOnline

type DependencyDisableAutoOnline struct {
	modules.ProductionDependencies
}

DependencyDisableAutoOnline will disable the gateway always being online during testing and dev builds and instead apply the same rules which are used in production builds.

func (*DependencyDisableAutoOnline) Disrupt

func (d *DependencyDisableAutoOnline) Disrupt(s string) bool

Disrupt returns true if the correct string is provided.

type DependencyDisableCloseUploadEntry

type DependencyDisableCloseUploadEntry struct {
	modules.ProductionDependencies
}

DependencyDisableCloseUploadEntry prevents I3vFileEntries in the upload code from being closed.

func (*DependencyDisableCloseUploadEntry) Disrupt

Disrupt prevents I3vfileEntries in the upload code from being closed.

type DependencyDisableContractRecovery

type DependencyDisableContractRecovery struct {
	modules.ProductionDependencies
}

DependencyDisableContractRecovery prevents recoverable contracts from being recovered in threadedContractMaintenance.

func (*DependencyDisableContractRecovery) Disrupt

Disrupt prevents contracts from being recovered in threadedContractMaintenance.

type DependencyDisableRecoveryStatusReset

type DependencyDisableRecoveryStatusReset struct {
	modules.ProductionDependencies
}

DependencyDisableRecoveryStatusReset prevents the fields scanInProgress and atomicRecoveryScanHeight from being reset after the scan is done.

func (*DependencyDisableRecoveryStatusReset) Disrupt

Disrupt will prevent the fields scanInProgress and atomicRecoveryScanHeight from being reset after the scan is done and also prevent automatic contract recovery scans from being triggered.

type DependencyDisableRenewal

type DependencyDisableRenewal struct {
	modules.ProductionDependencies
}

DependencyDisableRenewal prevents contracts from being renewed.

func (*DependencyDisableRenewal) Disrupt

func (d *DependencyDisableRenewal) Disrupt(s string) bool

Disrupt will prevent contracts from being renewed.

type DependencyDisableRepairAndHealthLoops

type DependencyDisableRepairAndHealthLoops struct {
	modules.ProductionDependencies
}

DependencyDisableRepairAndHealthLoops prevents the background loops for repairs and updating directory metadata from running. This includes threadedUploadAndRepair, threadedStuckLoop, and threadedUpdateRenterHealth

func (*DependencyDisableRepairAndHealthLoops) Disrupt

Disrupt will prevent the repair and health loops from running

type DependencyDisableUploadGougingCheck

type DependencyDisableUploadGougingCheck struct {
	modules.ProductionDependencies
}

DependencyDisableUploadGougingCheck ignores the upload gouging check

func (*DependencyDisableUploadGougingCheck) Disrupt

Disrupt will prevent the uploads to fail due to upload gouging

type DependencyDoNotAcceptTxnSet

type DependencyDoNotAcceptTxnSet struct {
	modules.ProductionDependencies
}

DependencyDoNotAcceptTxnSet will not accept a transaction set.

func (*DependencyDoNotAcceptTxnSet) Disrupt

func (d *DependencyDoNotAcceptTxnSet) Disrupt(s string) bool

Disrupt returns true if the correct string is provided.

type DependencyFailUploadStreamFromReader

type DependencyFailUploadStreamFromReader struct {
	modules.ProductionDependencies
}

DependencyFailUploadStreamFromReader prevents I3vFileEntries in the upload code from being closed.

func (*DependencyFailUploadStreamFromReader) Disrupt

Disrupt prevents I3vfileEntries in the upload code from being closed.

type DependencyHighMinHostScore

type DependencyHighMinHostScore struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyHighMinHostScore returns high minimum-allowed host score for GFR to help simulate churn related to low scoring hosts.

func (*DependencyHighMinHostScore) Disrupt

func (d *DependencyHighMinHostScore) Disrupt(s string) bool

Disrupt causes a high min-score for GFR to be returned.

func (*DependencyHighMinHostScore) ForceHighMinHostScore

func (d *DependencyHighMinHostScore) ForceHighMinHostScore(force bool)

ForceHighMinHostScore causes the dependency disrupt to activate.

type DependencyInterruptAfterNCalls

type DependencyInterruptAfterNCalls struct {
	DependencyInterruptOnceOnKeyword
	// contains filtered or unexported fields
}

DependencyInterruptAfterNCalls is a generic dependency that behaves the same way as DependencyInterruptOnceOnKeyword, expect that after calling "Fail", "Disrupt" needs to be called n times for the actual disrupt to happen.

func NewDependencyDisruptUploadStream

func NewDependencyDisruptUploadStream(numChunks int) *DependencyInterruptAfterNCalls

NewDependencyDisruptUploadStream creates a new dependency that closes the reader used for upload streaming to simulate failing connection after numChunks uploaded chunks.

func (*DependencyInterruptAfterNCalls) Disrupt

Disrupt returns true if the correct string is provided, if the flag was set to true by calling fail on the dependency and if Disrupt has been called n times since fail was called.

type DependencyInterruptOnceOnKeyword

type DependencyInterruptOnceOnKeyword struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyInterruptOnceOnKeyword is a generic dependency that interrupts the flow of the program if the argument passed to Disrupt equals str and if f was set to true by calling Fail.

func NewDependencyHostDiskTrouble

func NewDependencyHostDiskTrouble() *DependencyInterruptOnceOnKeyword

NewDependencyHostDiskTrouble creates a new dependency that disrupts storage folder operations due to disk trouble

func NewDependencyInterruptContractSaveToDiskAfterDeletion

func NewDependencyInterruptContractSaveToDiskAfterDeletion() *DependencyInterruptOnceOnKeyword

NewDependencyInterruptContractSaveToDiskAfterDeletion creates a new dependency that interrupts the contract being saved to disk after being removed from static contracts

func NewDependencyInterruptDownloadAfterSendingRevision

func NewDependencyInterruptDownloadAfterSendingRevision() *DependencyInterruptOnceOnKeyword

NewDependencyInterruptDownloadAfterSendingRevision creates a new dependency that interrupts the download on the renter side right after receiving the signed revision from the host.

func NewDependencyInterruptDownloadBeforeSendingRevision

func NewDependencyInterruptDownloadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword

NewDependencyInterruptDownloadBeforeSendingRevision creates a new dependency that interrupts the download on the renter side before sending the signed revision to the host.

func NewDependencyInterruptUploadAfterSendingRevision

func NewDependencyInterruptUploadAfterSendingRevision() *DependencyInterruptOnceOnKeyword

NewDependencyInterruptUploadAfterSendingRevision creates a new dependency that interrupts the upload on the renter side right after receiving the signed revision from the host.

func NewDependencyInterruptUploadBeforeSendingRevision

func NewDependencyInterruptUploadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword

NewDependencyInterruptUploadBeforeSendingRevision creates a new dependency that interrupts the upload on the renter side before sending the signed revision to the host.

func (*DependencyInterruptOnceOnKeyword) Disable

func (d *DependencyInterruptOnceOnKeyword) Disable()

Disable sets the flag to false to make sure that the dependency won't fail.

func (*DependencyInterruptOnceOnKeyword) Disrupt

Disrupt returns true if the correct string is provided and if the flag was set to true by calling fail on the dependency beforehand. After simulating a crash the flag will be set to false and fail has to be called again for another disruption.

func (*DependencyInterruptOnceOnKeyword) Fail

Fail causes the next call to Disrupt to return true if the correct string is provided.

type DependencyLowFundsFormationFail

type DependencyLowFundsFormationFail struct {
	modules.ProductionDependencies
}

DependencyLowFundsFormationFail will cause contract formation to fail due to low funds in the allowance.

func (*DependencyLowFundsFormationFail) Disrupt

Disrupt causes contract formation to fail due to low allowance funds.

type DependencyLowFundsRefreshFail

type DependencyLowFundsRefreshFail struct {
	modules.ProductionDependencies
}

DependencyLowFundsRefreshFail will cause contract renewal to fail due to low funds in the allowance.

func (*DependencyLowFundsRefreshFail) Disrupt

Disrupt causes contract renewal to fail due to low allowance funds.

type DependencyLowFundsRenewalFail

type DependencyLowFundsRenewalFail struct {
	modules.ProductionDependencies
}

DependencyLowFundsRenewalFail will cause contract renewal to fail due to low funds in the allowance.

func (*DependencyLowFundsRenewalFail) Disrupt

Disrupt causes contract renewal to fail due to low allowance funds.

type DependencyPostponeWritePiecesRecovery

type DependencyPostponeWritePiecesRecovery struct {
	modules.ProductionDependencies
}

DependencyPostponeWritePiecesRecovery adds a random sleep in the WritePieces method between calling Seek and Recover as a regression test for randomly corrupting downloads.

func (*DependencyPostponeWritePiecesRecovery) Disrupt

Disrupt returns true if the correct string is provided.

type DependencyToggleWatchdogBroadcast

type DependencyToggleWatchdogBroadcast struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyToggleWatchdogBroadcast can toggle the watchdog's ability to broadcast transactions.

func (*DependencyToggleWatchdogBroadcast) DisableWatchdogBroadcast

func (d *DependencyToggleWatchdogBroadcast) DisableWatchdogBroadcast(disable bool)

DisableWatchdogBroadcast will prevent the watchdog from broadcating transactions.

func (*DependencyToggleWatchdogBroadcast) Disrupt

Disrupt will prevent watchdog from rebroadcasting transactions when broadcasting is disabled.

type DependencyUnsyncedConsensus

type DependencyUnsyncedConsensus struct {
	modules.ProductionDependencies
}

DependencyUnsyncedConsensus makes the consensus set appear unsynced

func (*DependencyUnsyncedConsensus) Disrupt

func (d *DependencyUnsyncedConsensus) Disrupt(s string) bool

Disrupt will prevent the consensus set from appearing synced

type DependencyWithDisableAndEnable

type DependencyWithDisableAndEnable struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

DependencyWithDisableAndEnable adds the ability to disable the dependency

func NewDependencyContractRenewalFail

func NewDependencyContractRenewalFail() *DependencyWithDisableAndEnable

NewDependencyContractRenewalFail creates a new dependency that simulates getting an error while renewing a contract.

func (*DependencyWithDisableAndEnable) Disable

func (d *DependencyWithDisableAndEnable) Disable()

Disable sets the flag to true to make sure that the dependency will fail.

func (*DependencyWithDisableAndEnable) Disrupt

Disrupt returns true if the correct string is provided and the dependency has not been disabled.

func (*DependencyWithDisableAndEnable) Enable

func (d *DependencyWithDisableAndEnable) Enable()

Enable sets the flag to false to make sure that the dependency won't fail.

type HostExpireEphemeralAccounts

type HostExpireEphemeralAccounts struct {
	modules.ProductionDependencies
}

HostExpireEphemeralAccounts is a dependency injection for the host that will expire ephemeral accounts as soon as they get pruned

func (*HostExpireEphemeralAccounts) Disrupt

func (d *HostExpireEphemeralAccounts) Disrupt(s string) bool

Disrupt will interpret a signal from the host and tell the host to force expire all ephemeral accounts on the next prune cycle

type HostRejectAllSessionLocks

type HostRejectAllSessionLocks struct {
	modules.ProductionDependencies
	// contains filtered or unexported fields
}

HostRejectAllSessionLocks is a dependency injection for the host that will cause the host to reject all contracts as though they do not exist.

func (*HostRejectAllSessionLocks) Disrupt

func (d *HostRejectAllSessionLocks) Disrupt(s string) bool

Disrupt will interpret a signal from the host and tell the host to pretend it has no record of the contract.

func (*HostRejectAllSessionLocks) StartRejectingLocks

func (d *HostRejectAllSessionLocks) StartRejectingLocks()

StartRejectingLocks will activate the dependency.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL