1nbdkit-checkwrite-filter(1) NBDKIT nbdkit-checkwrite-filter(1)
2
3
4
6 nbdkit-checkwrite-filter - check writes match contents of plugin
7
9 nbdkit --filter=checkwrite PLUGIN
10
12 "nbdkit-checkwrite-filter" is an nbdkit filter that turns write
13 operations into checks that what is written matches the existing
14 content of the plugin. If the content matches then the write operation
15 succeeds (doing nothing). If not then the write operation fails
16 returning EIO Input/output error.
17
18 The purpose of this filter is to test copying tools as described below.
19
20 The underlying plugin is opened read-only and is never written to. All
21 write-like operations are covered by this filter, such as trimming and
22 zeroing. This filter tests the logical equivalence of the writes,
23 ignoring differences in sparseness.
24
25 Using this filter to test copying tools
26 You can check that a copying tool is copying data correctly by creating
27 an nbdkit instance containing some test data, overlaying this filter,
28 and copying from and to nbdkit at the same time:
29
30 nbdkit -U - --filter=checkwrite data "@32768 1" \
31 --run 'nbdcopy "$uri" "$uri"'
32
33 nbdkit -U - --filter=checkwrite file disk.img \
34 --run 'nbdcopy "$uri" "$uri"'
35
36 If the copying program is buggy then you will see EIO errors and (if
37 the copying program also handles errors correctly) it should exit with
38 an error.
39
40 Other plugins for testing NBD tools
41 If you are doing this kind of testing you will also want to look at
42 nbdkit-random-plugin(1) and nbdkit-sparse-random-plugin(1). These
43 plugins already have this behaviour built in to them (because it is
44 more efficient to build it into the plugin) — you do not need to use
45 this filter with those plugins. This filter is useful for testing with
46 arbitrary plugins.
47
49 There are no parameters specific to this filter. Parameters are passed
50 through to the underlying plugin.
51
53 $filterdir/nbdkit-checkwrite-filter.so
54 The filter.
55
56 Use "nbdkit --dump-config" to find the location of $filterdir.
57
59 "nbdkit-checkwrite-filter" first appeared in nbdkit 1.24.
60
62 nbdkit(1), nbdkit-random-plugin(1), nbdkit-sparse-random-plugin(1),
63 nbdkit-filter(3), nbdkit-plugin(3), nbdcopy(1).
64
66 Richard W.M. Jones
67
69 Copyright (C) 2020 Red Hat Inc.
70
72 Redistribution and use in source and binary forms, with or without
73 modification, are permitted provided that the following conditions are
74 met:
75
76 • Redistributions of source code must retain the above copyright
77 notice, this list of conditions and the following disclaimer.
78
79 • Redistributions in binary form must reproduce the above copyright
80 notice, this list of conditions and the following disclaimer in the
81 documentation and/or other materials provided with the
82 distribution.
83
84 • Neither the name of Red Hat nor the names of its contributors may
85 be used to endorse or promote products derived from this software
86 without specific prior written permission.
87
88 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
89 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
90 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
91 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
92 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
93 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
94 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
95 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
96 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
97 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
98 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
99
100
101
102nbdkit-1.28.2 2021-11-09 nbdkit-checkwrite-filter(1)