On Wed, May 17, 2023 at 11:06:59AM +0100, Richard W.M. Jones wrote:
This filter adds random data corruption when reading from the
underlying plugin.
---
+++ b/tests/test-evil-small-p.sh
@@ -0,0 +1,57 @@
+
+# Check absence of divide by zero errors.
+nbdkit -U - -fv null 1M \
+ --filter=evil --filter=noextents evil-probability=0 \
+ --run 'nbdcopy "$uri" null:'
+
+# Smallest valid probability.
+nbdkit -U - -fv null 1M \
+ --filter=evil --filter=noextents evil-probability=1e-12 \
+ --run 'nbdcopy "$uri" null:'
+
+# Should be treated same as P = 0.
+nbdkit -U - -fv null 1M \
+ --filter=evil --filter=noextents evil-probability=1e-13 \
+ --run 'nbdcopy "$uri" null:'
diff --git a/tests/test-evil-stuck-high-bits.sh b/tests/test-evil-stuck-high-bits.sh
Maybe worth capturing the output and grepping for the expected
outputs, rather than requiring human post-parsing of the log file?
Same for the large-p counterpart test.
Not a show-stopper. At this point, I think you can go ahead and commit
what you've cleaned up based on these reviews, and we can do any
further cleanups as followups rather than needing to see a full v3
posting.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org