|
NAMEnbdkit-error-filter - inject errors for testing clientsSYNOPSISnbdkit --filter=error PLUGIN [error=EPERM|EIO|ENOMEM|EINVAL|ENOSPC|ESHUTDOWN] [error-rate=10%|0.1] [error-file=/tmp/inject] [error-pread=...] [error-pread-rate=...] [error-pread-file=...] [error-pwrite=...] [error-pwrite-rate=...] [error-pwrite-file=...] [error-trim=...] [error-trim-rate=...] [error-trim-file=...] [error-zero=...] [error-zero-rate=...] [error-zero-file=...] [error-extents=...] [error-extents-rate=...] [error-extents-file=...] [error-cache=...] [error-cache-rate=...] [error-cache-file=...] DESCRIPTION"nbdkit-error-filter" is an nbdkit filter that injects random errors into replies from the server. This is used for testing that NBD clients can handle errors.All parameters are optional, but you should usually specify one of the "error-rate" or "error-*-rate" parameters, otherwise this filter will do nothing. EXAMPLESInject a low rate of errors randomly into the connection:nbdkit --filter=error file disk.img error-rate=1% Reading, trimming, cache and extents (block status) requests will be successful, but all writes and zeroing will return "No space left on device": nbdkit --filter=error file disk.img \ error=ENOSPC \ error-pwrite-rate=100% \ error-zero-rate=100% To make all connections fail hard 60 seconds after the server is started, use: rm -f /tmp/inject nbdkit --filter=error file disk.img \ error-rate=100% \ error-file=/tmp/inject sleep 60; touch /tmp/inject PARAMETERS
NOTESPeculiar debug outputIf you are looking at the debugging output (using "nbdkit -f -v") then you may see peculiar "errors" appearing when using this filter, for example:nbdkit: file.9: debug: error: pread count=1024 offset=0 flags=0x0 In fact these are not errors, nbdkit core is simply printing the name of the filter which happens to be "error". When this filter injects an error you will see something like: nbdkit: file.4: error: injecting ENOSPC error into pwrite FILES
VERSION"nbdkit-error-filter" first appeared in nbdkit 1.6.SEE ALSOnbdkit(1), nbdkit-file-plugin(1), nbdkit-full-plugin(1), nbdkit-filter(3).AUTHORSRichard W.M. JonesCOPYRIGHTCopyright (C) 2018 Red Hat Inc.LICENSERedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Visit the GSP FreeBSD Man Page Interface. |